Skip to content

Commit

Permalink
Merge pull request #85 from nf-core/fix_samtools_index
Browse files Browse the repository at this point in the history
Fix samtools index #84
  • Loading branch information
apeltzer authored Nov 17, 2018
2 parents 29a394a + e55dae4 commit e8a186b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
* [#80](https://github.com/nf-core/eager/pull/80) - BWA Index file handling
* [#77](https://github.com/nf-core/eager/pull/77) - Lots of documentation updates by [@jfy133](https://github.com/jfy133)

### `Fixed`
* [#84](https://github.com/nf-core/eager/pull/85) - Fix for [Samtools index issues](https://github.com/nf-core/eager/issues/84)

## [2.0.2] - 2018-11-03

### `Changed`
Expand Down
12 changes: 6 additions & 6 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ process bwa {
"""
bwa aln -t ${task.cpus} $fasta $reads -n ${params.bwaalnn} -l ${params.bwaalnl} -k ${params.bwaalnk} -f "${reads.baseName}.sai"
bwa samse -r "@RG\\tID:ILLUMINA-${prefix}\\tSM:${prefix}\\tPL:illumina" $fasta "${reads.baseName}".sai $reads | samtools sort -@ ${task.cpus} -O bam - > "${prefix}".sorted.bam
samtools index -@ ${task.cpus} "${prefix}".sorted.bam
samtools index "${prefix}".sorted.bam
"""
}

Expand Down Expand Up @@ -642,7 +642,7 @@ process circularmapper{
bwa samse -r "@RG\\tID:ILLUMINA-${prefix}\\tSM:${prefix}\\tPL:illumina" "${fasta.baseName}_${params.circularextension}.fasta" "${reads.baseName}".sai $reads > tmp.out
realignsamfile -e ${params.circularextension} -i tmp.out -r $fasta $filter
samtools sort -@ ${task.cpus} -O bam tmp_realigned.bam > "${prefix}".sorted.bam
samtools index -@ ${task.cpus} "${prefix}".sorted.bam
samtools index "${prefix}".sorted.bam
"""
}

Expand Down Expand Up @@ -724,12 +724,12 @@ process samtools_filter {
"""
samtools view -h $bam | tee >(samtools view - -@ ${task.cpus} -f4 -q ${params.bam_mapping_quality_threshold} -o ${prefix}.unmapped.bam) >(samtools view - -@ ${task.cpus} -F4 -q ${params.bam_mapping_quality_threshold} -o ${prefix}.filtered.bam)
samtools fastq -tn "${prefix}.unmapped.bam" | gzip > "${prefix}.unmapped.fq.gz"
samtools index -@ ${task.cpus} ${prefix}.filtered.bam
samtools index ${prefix}.filtered.bam
"""
} else {
"""
samtools view -h $bam | tee >(samtools view - -@ ${task.cpus} -f4 -q ${params.bam_mapping_quality_threshold} -o ${prefix}.unmapped.bam) >(samtools view - -@ ${task.cpus} -q ${params.bam_mapping_quality_threshold} -o ${prefix}.filtered.bam)
samtools index -@ ${task.cpus} ${prefix}.filtered.bam
samtools index ${prefix}.filtered.bam
"""
}
}
Expand Down Expand Up @@ -764,14 +764,14 @@ process dedup{
dedup -i $bam $treat_merged -o . -u
mv *.log dedup.log
samtools sort -@ ${task.cpus} "$prefix"_rmdup.bam -o "$prefix".sorted.bam
samtools index -@ ${task.cpus} "$prefix".sorted.bam
samtools index "$prefix".sorted.bam
"""
} else {
"""
dedup -i $bam $treat_merged -o . -u
mv *.log dedup.log
samtools sort -@ ${task.cpus} "$prefix"_rmdup.bam -o "$prefix".sorted.bam
samtools index -@ ${task.cpus} "$prefix".sorted.bam
samtools index "$prefix".sorted.bam
"""
}
}
Expand Down

0 comments on commit e8a186b

Please sign in to comment.