-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* initial commit dedup * Revert "initial commit dedup" This reverts commit 38f586b. * full component with two tests * adjust arg names, container base image, test data size --------- Co-authored-by: Robrecht Cannoodt <[email protected]>
- Loading branch information
1 parent
2f8bf02
commit c3d87f5
Showing
8 changed files
with
184 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
name: "rseqc_inferexperiment" | ||
namespace: "rseqc" | ||
description: | | ||
Infer strandedness from sequencing reads | ||
links: | ||
homepage: https://rseqc.sourceforge.net/ | ||
documentation: https://rseqc.sourceforge.net/#infer-experiment-py | ||
issue_tracker: https://github.com/MonashBioinformaticsPlatform/RSeQC/issues | ||
repository: https://github.com/MonashBioinformaticsPlatform/RSeQC | ||
references: | ||
doi: 10.1093/bioinformatics/bts356 | ||
license: GPL-3.0 | ||
authors: | ||
- __merge__: /src/_authors/emma_rousseau.yaml | ||
roles: [ author, maintainer ] | ||
|
||
argument_groups: | ||
- name: "Input" | ||
arguments: | ||
- name: "--input_file" | ||
alternatives: ["-i"] | ||
type: file | ||
required: true | ||
description: input alignment file in BAM or SAM format | ||
- name: "--refgene" | ||
alternatives: ["-r"] | ||
type: file | ||
required: true | ||
description: Reference gene model in bed format | ||
|
||
- name: "Output" | ||
arguments: | ||
- name: "--output" | ||
type: file | ||
direction: output | ||
required: true | ||
description: Output file (txt) of strandness report. | ||
example: $id.strandedness.txt | ||
|
||
- name: "Options" | ||
arguments: | ||
- name: "--sample_size" | ||
alternatives: ["-s"] | ||
type: integer | ||
description: | | ||
Number of reads sampled from SAM/BAM file. Default: 200000 | ||
example: 200000 | ||
- name: "--mapq" | ||
alternatives: ["-q"] | ||
type: integer | ||
description: | | ||
Minimum mapping quality (phred scaled) to determine uniquely mapped reads. Default: 30 | ||
example: 30 | ||
|
||
resources: | ||
- type: bash_script | ||
path: script.sh | ||
|
||
test_resources: | ||
- type: bash_script | ||
path: test.sh | ||
- path: test_data | ||
|
||
engines: | ||
- type: docker | ||
image: python:3.10 | ||
setup: | ||
- type: python | ||
packages: [ RSeQC ] | ||
- type: docker | ||
run: | | ||
echo "RSeQC - infer_experiment.py: $(infer_experiment.py --version | cut -d' ' -f2)" > /var/software_versions.txt | ||
runners: | ||
- type: executable | ||
- type: nextflow |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
``` | ||
infer_eperiment.py --help | ||
``` | ||
|
||
Usage: infer_experiment.py [options] | ||
|
||
|
||
Options: | ||
--version show program's version number and exit | ||
-h, --help show this help message and exit | ||
-i INPUT_FILE, --input-file=INPUT_FILE | ||
Input alignment file in SAM or BAM format | ||
-r REFGENE_BED, --refgene=REFGENE_BED | ||
Reference gene model in bed fomat. | ||
-s SAMPLE_SIZE, --sample-size=SAMPLE_SIZE | ||
Number of reads sampled from SAM/BAM file. | ||
default=200000 | ||
-q MAP_QUAL, --mapq=MAP_QUAL | ||
Minimum mapping quality (phred scaled) for an | ||
alignment to be considered as "uniquely mapped". | ||
default=30 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
set -eo pipefail | ||
|
||
infer_experiment.py \ | ||
-i $par_input_file \ | ||
-r $par_refgene \ | ||
${par_sample_size:+-s "${par_sample_size}"} \ | ||
${par_mapq:+-q "${par_mapq}"} \ | ||
> $par_output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
#!/bin/bash | ||
|
||
# define input and output for script | ||
input_bam="$meta_resources_dir/test_data/sample.bam" | ||
input_bed="$meta_resources_dir/test_data/test.bed12" | ||
output="strandedness.txt" | ||
|
||
echo ">>> Prepare test output data" | ||
|
||
cat > "$meta_resources_dir/test_data/strandedness.txt" <<EOF | ||
This is PairEnd Data | ||
Fraction of reads failed to determine: 0.0000 | ||
Fraction of reads explained by "1++,1--,2+-,2-+": 1.0000 | ||
Fraction of reads explained by "1+-,1-+,2++,2--": 0.0000 | ||
EOF | ||
|
||
cat > "$meta_resources_dir/test_data/strandedness2.txt" <<EOF | ||
Unknown Data type | ||
EOF | ||
|
||
################################################################################ | ||
# run executable and tests | ||
|
||
echo ">>> Test 1: Test with default parameters" | ||
|
||
"$meta_executable" \ | ||
--input_file "$input_bam" \ | ||
--refgene "$input_bed" \ | ||
--output "$output" | ||
|
||
exit_code=$? | ||
[[ $exit_code != 0 ]] && echo "Non zero exit code: $exit_code" && exit 1 | ||
|
||
echo ">> Checking whether output can be found and has content" | ||
|
||
[ ! -f "$output" ] && echo "$output is missing" && exit 1 | ||
[ ! -s "$output" ] && echo "$output is empty" && exit 1 | ||
|
||
|
||
echo ">> Checking whether output is correct" | ||
diff "$output" "$meta_resources_dir/test_data/strandedness.txt" || { echo "Output is not correct"; exit 1; } | ||
|
||
rm "$output" | ||
|
||
################################################################################ | ||
|
||
echo ">>> Test 2: Test with non-default sample size and map quality" | ||
|
||
"$meta_executable" \ | ||
--input_file "$input_bam" \ | ||
--refgene "$input_bed" \ | ||
--output "$output" \ | ||
--sample_size 150000 \ | ||
--mapq 90 | ||
|
||
exit_code=$? | ||
[[ $exit_code != 0 ]] && echo "Non zero exit code: $exit_code" && exit 1 | ||
|
||
echo ">> Checking whether output can be found and has content" | ||
|
||
[ ! -f "$output" ] && echo "$output is missing" && exit 1 | ||
[ ! -s "$output" ] && echo "$output is empty" && exit 1 | ||
|
||
echo ">> Checking whether output is correct" | ||
diff "$output" "$meta_resources_dir/test_data/strandedness2.txt" || { echo "Output is not correct"; exit 1; } | ||
|
||
|
||
echo "All tests passed" | ||
|
||
exit 0 |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
MT192765.1 1242 1264 nCoV-2019_5_LEFT 1 + 1242 1264 0 2 10,12, 0,10, | ||
MT192765.1 1573 1595 nCoV-2019_6_LEFT 2 + 1573 1595 0 2 7,15, 0,7, | ||
MT192765.1 1623 1651 nCoV-2019_5_RIGHT 1 - 1623 1651 0 2 14,14, 0,14, | ||
MT192765.1 1942 1964 nCoV-2019_6_RIGHT 2 - 1942 1964 0 2 11,11 0,11, |
Binary file not shown.