Skip to content

Commit

Permalink
tweaked stat script
Browse files Browse the repository at this point in the history
  • Loading branch information
MathiasEskildsen committed Jul 5, 2024
1 parent a883884 commit 55e3cb6
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions workflow/scripts/nanoplot.sh → workflow/scripts/nanoplots.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,34 +114,18 @@ done
# Finished unzipping, moving and concatenating passed .fastq files


# Start of statistics workflow
input="$project_dir/fastqs"
output="$project_dir/stats"
#Create output directories for each input file in the output directory
# Use find to locate files with the pattern "_concatenated.fastq"
files=$(find "$input"/* -type f -name "*_merged.fastq")
for file in $files; do
# Extract the subdirectory name from the file path
subdirectory_name=$(basename "$file" _merged.fastq)
# Construct the output directory path based on the subdirectory name
output_dir="${output}/${subdirectory_name}"
# Create the output directory if it doesn't exist
echo "created directory for $subdirectory_name in $output"
mkdir -p "$output_dir"
done

input_dir="$project_dir/fastqs"
output_dir="$project_dir/stats"

files=( $(ls ${input_dir}/*/*_merged.fastq) )
files=( $(ls ${input_dir}/*/*.fastq) )
# Create function for NanoPlot
statistics() {
local file="$1"
local threads="$2"
local output_dir="$3"

# Extract subdirectory name
local subdirectory_name=$(basename "$(dirname "$file")")
local subdirectory_name=$(basename "$file" .fastq)

# Create output directory within the specified output_dir
local output="$output_dir/$subdirectory_name"
Expand Down

0 comments on commit 55e3cb6

Please sign in to comment.