Skip to content

Commit

Permalink
Merge pull request #20 from CCBR/filteraligned
Browse files Browse the repository at this point in the history
Rename samtools filter aligned module
  • Loading branch information
kelly-sovacool authored Oct 23, 2023
2 parents 92491d5 + 3abf4a5 commit d6f54f4
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
- custom/bam_to_fastq (#14)
- cutadapt (#11)
- khmer/uniquekmers (#7)
- samtools/filter_aligned (#13)
- samtools/filteraligned (#13,#20)
- also runs samtools sort & outputs index in bai format. (#12)
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

process FILTER_ALIGNED {
process SAMTOOLS_FILTER_ALIGNED {
'''
Given a bam file, filter out reads that aligned.
'''
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: filter_aligned
name: samtools_filter_aligned
description: Filter out aligned reads from a BAM file.
keywords:
- bam
Expand Down
6 changes: 3 additions & 3 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ khmer/uniquekmers:
- modules/CCBR/khmer/uniquekmers/**
- tests/CCBR/khmer/uniquekmers/**

samtools/filter_aligned:
- modules/CCBR/samtools/filter_aligned/**
- tests/modules/CCBR/samtools/filter_aligned/**
samtools/filteraligned:
- modules/CCBR/samtools/filteraligned/**
- tests/modules/CCBR/samtools/filteraligned/**
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

nextflow.enable.dsl = 2

include { BWA_INDEX } from '../../../../../modules/CCBR/bwa/index/main.nf'
include { BWA_MEM } from '../../../../../modules/CCBR/bwa/mem/main.nf'
include { FILTER_ALIGNED } from '../../../../../modules/CCBR/samtools/filter_aligned/main.nf'
include { BWA_INDEX } from '../../../../../modules/CCBR/bwa/index/main.nf'
include { BWA_MEM } from '../../../../../modules/CCBR/bwa/mem/main.nf'
include { SAMTOOLS_FILTER_ALIGNED } from '../../../../../modules/CCBR/samtools/filteraligned/main.nf'

//
// Test with single-end data
Expand All @@ -23,7 +23,7 @@ workflow test_filter_aligned_single_end {

BWA_INDEX ( fasta )
BWA_MEM ( input, BWA_INDEX.out.index )
FILTER_ALIGNED( BWA_MEM.out.bam )
SAMTOOLS_FILTER_ALIGNED( BWA_MEM.out.bam )
}

//
Expand All @@ -44,5 +44,5 @@ workflow test_filter_aligned_paired_end {

BWA_INDEX ( fasta )
BWA_MEM ( input, BWA_INDEX.out.index )
FILTER_ALIGNED( BWA_MEM.out.bam )
SAMTOOLS_FILTER_ALIGNED( BWA_MEM.out.bam )
}
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
- name: samtools filter_aligned test_filter_aligned_single_end
command: nextflow run ./tests/modules/CCBR/samtools/filter_aligned -entry test_filter_aligned_single_end -c ./tests/config/nextflow.config
command: nextflow run ./tests/modules/CCBR/samtools/filteraligned -entry test_filter_aligned_single_end -c ./tests/config/nextflow.config
tags:
- samtools/filter_aligned
- samtools/filteraligned
- samtools
files:
- path: output/bwa/test.bam
md5sum: 33be5394f2873956dcac679d78c7e559
- path: output/bwa/test.bam.bai
md5sum: 9965a3eaf16130c34ded277653b3811f
- path: output/bwa/versions.yml
- path: output/filter/test.unaligned.bam
- path: output/samtools/test.unaligned.bam
md5sum: 60121474c99a15d030b866f459e83a88
- path: output/filter/versions.yml
- path: output/samtools/versions.yml

- name: samtools filter_aligned test_filter_aligned_paired_end
command: nextflow run ./tests/modules/CCBR/samtools/filter_aligned -entry test_filter_aligned_paired_end -c ./tests/config/nextflow.config
command: nextflow run ./tests/modules/CCBR/samtools/filteraligned -entry test_filter_aligned_paired_end -c ./tests/config/nextflow.config
tags:
- samtools/filter_aligned
- samtools/filteraligned
- samtools
files:
- path: output/bwa/test.bam
md5sum: 319a128e8959023f52490030b5ee457c
- path: output/bwa/test.bam.bai
md5sum: 55703b9bdf1b9816853dd5222c31fc2e
- path: output/bwa/versions.yml
- path: output/filter/test.unaligned.bam
- path: output/samtools/test.unaligned.bam
md5sum: 029fb4355a96008d6b30c0dcc0f210cb
- path: output/filter/versions.yml
- path: output/samtools/versions.yml

- name: samtools filter_aligned test_filter_aligned_single_end stub
command: nextflow run ./tests/modules/CCBR/samtools/filter_aligned -entry test_filter_aligned_single_end -c ./tests/config/nextflow.config -stub
command: nextflow run ./tests/modules/CCBR/samtools/filteraligned -entry test_filter_aligned_single_end -c ./tests/config/nextflow.config -stub
tags:
- samtools/filter_aligned
- samtools/filteraligned
- samtools
files:
- path: output/bwa/test.bam
- path: output/bwa/test.bam.bai
- path: output/bwa/versions.yml
- path: output/filter/test.unaligned.bam
- path: output/filter/versions.yml
- path: output/samtools/test.unaligned.bam
- path: output/samtools/versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
@pytest.mark.workflow("samtools filter_aligned test_filter_aligned_paired_end")
def test_unaligned_paired(workflow_dir):
unaligned_bam_file = pysam.AlignmentFile(
pathlib.Path(workflow_dir, "output/filter/test.unaligned.bam"), "rb"
pathlib.Path(workflow_dir, "output/samtools/test.unaligned.bam"), "rb"
)
reads_are_good = list()
for read in unaligned_bam_file:
Expand All @@ -19,7 +19,7 @@ def test_unaligned_paired(workflow_dir):
@pytest.mark.workflow("samtools filter_aligned test_filter_aligned_single_end")
def test_unaligned_single(workflow_dir):
unaligned_bam_file = pysam.AlignmentFile(
pathlib.Path(workflow_dir, "output/filter/test.unaligned.bam"), "rb"
pathlib.Path(workflow_dir, "output/samtools/test.unaligned.bam"), "rb"
)
reads_are_good = list()
for read in unaligned_bam_file:
Expand Down

0 comments on commit d6f54f4

Please sign in to comment.