Skip to content

Commit

Permalink
tmpdir bug
Browse files Browse the repository at this point in the history
  • Loading branch information
tgaspe committed Aug 22, 2024
1 parent 5c3ed84 commit 03f7f74
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/fastqc/config.vsh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ argument_groups:

- name: Outputs
description: |
At least one of the following output options must be used:
--html, --zip
At least one of the output options (--html or --zip) must be used:
arguments:

- name: --html
Expand Down
9 changes: 5 additions & 4 deletions src/fastqc/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,19 @@ for file in "${input[@]}"; do
# Removes everthing after the first dot of the basename
sample_name=$(basename "${file}" | sed 's/\..*$//')
if [[ -n "$par_html" ]]; then
input_html="$tempdir/${sample_name}_fastqc.html"
input_html="${tmpdir}/${sample_name}_fastqc.html"
html_file="${par_html//\*/$sample_name}"
mv "$input_html" "$html_file"
fi
if [[ -n "$par_zip" ]]; then
input_zip="$tempdir/${sample_name}_fastqc.zip"
input_zip="${tmpdir}/${sample_name}_fastqc.zip"
zip_file="${par_zip//\*/$sample_name}"
mv "$input_zip" "$zip_file"
fi
if [[ -n "$par_extract" ]]; then
# moves the extracted directory to the same directory as the input file
extract_dir="$tempdir/${sample_name}_fastqc"
# Moves the extracted directory to the same directory as the input file
extract_dir="${tmpdir}/${sample_name}_fastqc"
mv "$extract_dir" "$file_dir"
fi
done

2 changes: 2 additions & 0 deletions src/fastqc/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ echo "-> Run Test1: one input"
"$meta_executable" \
--extract \
--input "../input_1.fq" \
--html "*_fastqc.html" \
--zip "*_fastqc.zip" \

assert_file_exists "input_1_fastqc.html"
assert_file_exists "input_1_fastqc.zip"
Expand Down

0 comments on commit 03f7f74

Please sign in to comment.