Skip to content

Commit

Permalink
Fix csvtk grep command for several contigs
Browse files Browse the repository at this point in the history
  • Loading branch information
seppinho committed Jan 10, 2024
1 parent a44e3be commit 6676083
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 6 deletions.
2 changes: 1 addition & 1 deletion modules/local/calculate_statistics.nf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ process CALCULATE_STATISTICS {
## calculate summary statistics
samtools coverage ${bam_file} > samtools_coverage_${bam_file.baseName}.txt
csvtk grep -t -f3 -p 16569 samtools_coverage_${bam_file.baseName}.txt -T -o mtdna.txt
csvtk grep -t -f3 -p 16569 -C '\$' samtools_coverage_${bam_file.baseName}.txt -T -o mtdna.txt
contig=\$(csvtk cut -t -f 1 mtdna.txt)
numreads=\$(csvtk cut -t -f 4 mtdna.txt)
Expand Down
Binary file added tests/data/bam/mitohpc/sample_S.bam
Binary file not shown.
19 changes: 19 additions & 0 deletions tests/mitocalling.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,25 @@ nextflow_pipeline {
assert snapshot(path("${launchDir}/out/variants_ann.txt")).match()
}

}

test("Runs with BAM file including different header contigs") {

when {
params {
project = "test-job"
files = "$projectDir/tests/data/bam/mitohpc/*bam"
mode = "mutserve"
output = "out"
output_reports = "reports"
output_auxiliary = "files"
}
}

then {
assert snapshot(path("${launchDir}/out/variants_ann.txt")).match()
}

}

test("Runs with single BAM file and mutect2") {
Expand Down
10 changes: 5 additions & 5 deletions tests/mitocalling.nf.test.snap
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"Runs with single BAM file and mutect2": {
"Runs with BAM file including different header contigs": {
"content": [
"variants_ann.txt:md5,accf5a353be01302f95b001338cf554a"
"variants_ann.txt:md5,c2aa6c45193a921f4a20238fe9bf6cd8"
],
"timestamp": "2023-12-21T13:01:38.349898"
"timestamp": "2024-01-10T13:45:32.689184313"
},
"Runs with single BAM file and mutserve": {
"content": [
"variants_ann.txt:md5,64598b248689e6225c554b5d32c1bbd9"
"variants_ann.txt:md5,606016ca87ca11897119066253d53c62"
],
"timestamp": "2023-12-21T10:15:48.759709"
"timestamp": "2024-01-10T13:47:14.24639646"
}
}

0 comments on commit 6676083

Please sign in to comment.