Skip to content

Commit

Permalink
functional tests, changelog, remove defaults from config
Browse files Browse the repository at this point in the history
  • Loading branch information
emmarousseau committed Sep 2, 2024
1 parent d200f22 commit dd89f35
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 52 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@
- `bedtools_getfasta`: extract sequences from a FASTA file for each of the
intervals defined in a BED/GFF/VCF file (PR #59).

* `fq_subsample`: Sample a subset of records from single or paired FASTQ files (PR #147).

## MINOR CHANGES

* Uniformize component metadata (PR #23).
Expand Down
6 changes: 2 additions & 4 deletions src/fq_subsample/config.vsh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,10 @@ argument_groups:
- name: "--output_1"
type: file
direction: output
default: $id.read_1.subsampled.fastq
description: Sampled read 1 fastq files. Output will be gzipped if ends in `.gz`.
- name: "--output_2"
type: file
direction: output
default: $id.read_2.subsampled.fastq
description: Sampled read 2 fastq files. Output will be gzipped if ends in `.gz`.

- name: "Options"
Expand Down Expand Up @@ -58,14 +56,14 @@ engines:
setup:
- type: docker
env:
- TZ Europe/Brussels
- TZ=Europe/Brussels
run: |
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && \
apt-get update && \
apt-get install -y --no-install-recommends build-essential git-all curl && \
curl https://sh.rustup.rs -sSf | sh -s -- -y && \
. "$HOME/.cargo/env" && \
git clone --depth 1 --branch v0.11.0 https://github.com/stjude-rust-labs/fq.git && \
git clone --depth 1 --branch v0.12.0 https://github.com/stjude-rust-labs/fq.git && \
mv fq /usr/local/ && cd /usr/local/fq && \
cargo install --locked --path . && \
mv /usr/local/fq/target/release/fq /usr/local/bin/
Expand Down
14 changes: 7 additions & 7 deletions src/fq_subsample/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,32 @@ echo ">>> Testing $meta_executable"

echo ">>> Testing for paired-end reads"
"$meta_executable" \
--input_1 $meta_resources_dir/test_data/a.1.fastq \
--input_2 $meta_resources_dir/test_data/a.1.fastq \
--input_1 $meta_resources_dir/test_data/a.3.fastq.gz \
--input_2 $meta_resources_dir/test_data/a.4.fastq.gz \
--record_count 3 \
--seed 1 \
--output_1 a.1.subsampled.fastq \
--output_2 a.2.subsampled.fastq

echo ">> Checking if the correct files are present"
[ ! -f "a.1.subsampled.fastq" ] && echo "Subsampled FASTQ file for read 1 is missing!" && exit 1
[ ! -s "a.1.subsampled.fastq" ] && echo "Subsampled FASTQ file is empty!" && exit 1
[ $(wc -l < a.1.subsampled.fastq) -ne 12 ] && echo "Subsampled FASTQ file for read 1 does not contain the expected number of records" && exit 1
[ ! -f "a.2.subsampled.fastq" ] && echo "Subsampled FASTQ file for read 2 is missing" && exit 1
[ ! -s "a.2.subsampled.fastq" ] && echo "Subsampled FASTQ file is empty" && exit 1
[ $(wc -l < a.2.subsampled.fastq) -ne 12 ] && echo "Subsampled FASTQ file for read 2 does not contain the expected number of records" && exit 1

rm a.1.subsampled.fastq a.2.subsampled.fastq

echo ">>> Testing for single-end reads"
"$meta_executable" \
--input_1 $meta_resources_dir/test_data/a.1.fastq \
--input_2 $meta_resources_dir/test_data/a.1.fastq \
--input_1 $meta_resources_dir/test_data/a.3.fastq.gz \
--record_count 3 \
--seed 1 \
--output_1 a.1.subsampled.fastq


echo ">> Checking if the correct files are present"
[ ! -f "a.1.subsampled.fastq" ] && echo "Subsampled FASTQ file is missing" && exit 1
[ ! -s "a.1.subsampled.fastq" ] && echo "Subsampled FASTQ file is empty" && exit 1
[ $(wc -l < a.1.subsampled.fastq) -ne 12 ] && echo "Subsampled FASTQ file does not contain the expected number of records" && exit 1

echo ">>> Tests finished successfully"
exit 0
Expand Down
21 changes: 0 additions & 21 deletions src/fq_subsample/test_data/a.1.fastq

This file was deleted.

20 changes: 0 additions & 20 deletions src/fq_subsample/test_data/a.2.fastq

This file was deleted.

Binary file added src/fq_subsample/test_data/a.3.fastq.gz
Binary file not shown.
Binary file added src/fq_subsample/test_data/a.4.fastq.gz
Binary file not shown.

0 comments on commit dd89f35

Please sign in to comment.