Skip to content

Commit

Permalink
Update on script.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
tgaspe committed Jul 22, 2024
1 parent 72c3ab9 commit 8be954c
Showing 1 changed file with 33 additions and 17 deletions.
50 changes: 33 additions & 17 deletions src/fastqc/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,27 @@
[[ "$par_nano" == "false" ]] && unset par_nano
[[ "$par_nofilter" == "false" ]] && unset par_nofilter
[[ "$par_extract" == "false" ]] && unset par_extract
#[[ -z "$par_java" ]] && unset par_java
[[ "$par_noextract" == "false" ]] && unset par_noextract
[[ "$par_nogroup" == "false" ]] && unset par_nogroup
#[[ "$par_min_length" == "false" ]] && unset par_min_length
#[[ "$par_format" == "false" ]] && unset par_format
#[[ "$par_threads" == "false" ]] && unset par_threads
#[[ "$par_contaminants" == "false" ]] && unset par_contaminants
#[[ "$par_adapters" == "false" ]] && unset par_adapters
#[[ "$par_limits" == "false" ]] && unset par_limits
#[[ "$par_kmers" == "false" ]] && unset par_kmers
[[ "$par_quiet" == "false" ]] && unset par_quiet
#[[ "$par_dir" == "false" ]] && unset par_dir

# run fastqc
# if more than one file is passed
if [[ "$par_input" == *","* ]]; then

# Retrieve the first path from the comma-separated input
par_input1=$(echo "$par_input" | cut -d',' -f1)
# Retrieve the directory of the input file
input_dir=$(dirname "$par_input1")
# Convert comma to space separated
par_input=$(echo $par_input | tr ',' ' ')

else # if only one file is passed
# Retrives the directory of the input file
input_dir=$(dirname "$par_input")
fi
echo "input_dir: $input_dir"

run fastqc
fastqc \
${par_outdir:+--outdir "$par_outdir"} \
${par_casava:+--casava} \
Expand All @@ -43,11 +50,6 @@ fastqc \
$par_input


# Retrives the directory of the input file
input_dir=$(dirname "$par_input")

#echo "input is: $par_input"

# Both outputs args passed
if [[ -n "$par_html" ]] && [[ -n "$par_zip" ]]; then
mv "$input_dir"/*.html "$par_html"
Expand All @@ -64,9 +66,23 @@ fi


# Questions:
# Should I unzip the zip file and make multiple other outputs for the viash component?
# Should I unzip the zip file output and make multiple other outputs options for the viash component?
# TODO: handle the output args if multiple files are passed
# - if multiple files are passed, for the output args I can either change the config to multiple=false
# and pass just a dir as argument and mv the files to this dir,
# and would also work as well in the case of just one file passed (rename would be possible).
# i guess I can discuss this with jakub and see what he thinks is best
# because this is very similar to the -outdir flag!
# Do I create a code for the multiple files case where I also rename the files to the output args?




#[[ -z "$par_java" ]] && unset par_java
#[[ "$par_min_length" == "false" ]] && unset par_min_length
#[[ "$par_format" == "false" ]] && unset par_format
#[[ "$par_threads" == "false" ]] && unset par_threads
#[[ "$par_contaminants" == "false" ]] && unset par_contaminants
#[[ "$par_adapters" == "false" ]] && unset par_adapters
#[[ "$par_limits" == "false" ]] && unset par_limits
#[[ "$par_kmers" == "false" ]] && unset par_kmers
#[[ "$par_dir" == "false" ]] && unset par_dir

0 comments on commit 8be954c

Please sign in to comment.