Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix samtools index #84 #85

Merged
merged 2 commits into from
Nov 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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