forked from viash-hub/biobox
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2db6d29
commit 8e3d5c5
Showing
8 changed files
with
116 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: samtools_flagstat | ||
namespace: samtools | ||
description: Counts the number of alignments in SAM/BAM/CRAM files for each FLAG type.. | ||
keywords: [ stats, mapping, counts, bam, sam, cram] | ||
links: | ||
homepage: https://www.htslib.org/ | ||
documentation: https://www.htslib.org/doc/samtools-flagstat.html | ||
repository: https://github.com/samtools/samtools.git | ||
references: | ||
doi: 10.1093/bioinformatics/btp352, 10.1093/gigascience/giab008 | ||
license: MIT/Expat | ||
|
||
argument_groups: | ||
- name: Inputs | ||
arguments: | ||
- name: --bam | ||
type: file | ||
description: | | ||
BAM input files. | ||
- name: --bai | ||
type: file | ||
description: | | ||
BAM index file. | ||
- name: Outputs | ||
arguments: | ||
- name: --output | ||
type: file | ||
description: | | ||
File containing samtools stats output. | ||
direction: output | ||
example: output.flagstat | ||
|
||
resources: | ||
- type: bash_script | ||
path: script.sh | ||
test_resources: | ||
- type: bash_script | ||
path: test.sh | ||
- type: file | ||
path: test_data | ||
engines: | ||
- type: docker | ||
image: quay.io/biocontainers/samtools:1.19.2--h50ea8bc_1 | ||
setup: | ||
- type: docker | ||
run: | | ||
echo "$(samtools --version 2>&1)" > /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,13 @@ | ||
```sh | ||
samtools flagstat --help | ||
``` | ||
Usage: samtools flagstat [options] <in.bam> | ||
--input-fmt-option OPT[=VAL] | ||
Specify a single input file format option in the form | ||
of OPTION or OPTION=VALUE | ||
-@, --threads INT | ||
Number of additional threads to use [0] | ||
--verbosity INT | ||
Set level of verbosity | ||
-O, --output-fmt FORMAT[,OPT[=VAL]]... | ||
Specify output format (json, tsv) |
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,11 @@ | ||
#!/bin/bash | ||
|
||
## VIASH START | ||
## VIASH END | ||
|
||
set -e | ||
|
||
samtools flagstat \ | ||
"$par_input_bam" \ | ||
> "$par_output_stats" | ||
|
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,23 @@ | ||
#!/bin/bash | ||
|
||
echo ">>> Testing $meta_functionality_name" | ||
|
||
"$meta_executable" \ | ||
--bam "$meta_resources_dir/test_data/chr19.bam" \ | ||
--bai "$meta_resources_dir/test_data/chr19.bam.bai" \ | ||
--output "$meta_resources_dir/test_data/chr19.flagstat" | ||
|
||
echo ">>> Checking whether output exists" | ||
[ ! -f "test_data/chr19.flagstat" ] && echo "File 'chr19.flagstat' does not exist!" && exit 1 | ||
|
||
echo ">>> Checking whether output is non-empty" | ||
[ ! -s "test_data/chr19.flagstat" ] && echo "File 'chr19.flagstat' is empty!" && exit 1 | ||
|
||
echo ">>> Checking whether output is correct" | ||
diff "$meta_resources_dir/test_data/chr19.flagstat" "$meta_resources_dir/test_data/chr19_ref.flagstat" || \ | ||
(echo "Output does not match expected output." && exit 1) | ||
|
||
rm "$meta_resources_dir/test_data/chr19.flagstat" | ||
|
||
echo "All tests succeeded!" | ||
exit 0 |
Binary file not shown.
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,13 @@ | ||
55197 + 0 in total (QC-passed reads + QC-failed reads) | ||
0 + 0 secondary | ||
0 + 0 supplementary | ||
0 + 0 duplicates | ||
55197 + 0 mapped (100.00% : N/A) | ||
0 + 0 paired in sequencing | ||
0 + 0 read1 | ||
0 + 0 read2 | ||
0 + 0 properly paired (N/A : N/A) | ||
0 + 0 with itself and mate mapped | ||
0 + 0 singletons (N/A : N/A) | ||
0 + 0 with mate mapped to a different chr | ||
0 + 0 with mate mapped to a different chr (mapQ>=5) |
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,6 @@ | ||
#!/bin/bash | ||
|
||
# Download test data | ||
wget https://github.com/CGATOxford/UMI-tools/raw/master/tests/chr19.bam | ||
wget https://github.com/CGATOxford/UMI-tools/raw/master/tests/chr19.bam.bai | ||
|