Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### `Added`

### `Fixed`
* [#145](https://github.com/nf-core/eager/issues/145) - Added Picard Memory Handling [fix](https://github.com/nf-core/eager/issues/144)

* [#145](https://github.com/nf-core/eager/pull/145) - Added Picard Memory Handling [fix](https://github.com/nf-core/eager/issues/144)
* [#147](https://github.com/nf-core/eager/pull/147) - Fix Samtools Index for [large references](https://github.com/nf-core/eager/issues/146)

## [2.0.5] - 2019-01-28

Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,18 @@ James Fellows Yates, Raphael Eisenhofer and Judith Neukamm. If you want to
contribute, please open an issue and ask to be added to the project - happy to
do so and everyone is welcome to contribute here!

## Contributors

- [James A. Fellows-Yates](https://github.com/jfy133)
- [Stephen Clayton](https://github.com/sc13-bioinf)
- [Judith Neukamm](https://github.com/JudithNeukamm)
- [Raphael Eisenhofer](https://github.com/EisenRa)
- [Maxime Garcia](https://github.com/MaxUlysse)
- [Luc Venturini](https://github.com/lucventurini)
- [Hester van Schalkwyk](https://github.com/hesterjvs)

If you've contributed and you're missing in here, please let me know and I'll add you in.

## Tool References

* **EAGER v1**, CircularMapper, DeDup* Peltzer, A., Jäger, G., Herbig, A., Seitz, A., Kniep, C., Krause, J., & Nieselt, K. (2016). EAGER: efficient ancient genome reconstruction. Genome Biology, 17(1), 1–14. [https://doi.org/10.1186/s13059-016-0918-z](https://doi.org/10.1186/s13059-016-0918-z) Download: [https://github.com/apeltzer/EAGER-GUI](https://github.com/apeltzer/EAGER-GUI) and [https://github.com/apeltzer/EAGER-CLI](https://github.com/apeltzer/EAGER-CLI)
Expand Down
34 changes: 17 additions & 17 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ process bwa {

output:
file "*.sorted.bam" into ch_mapped_reads_idxstats,ch_mapped_reads_filter,ch_mapped_reads_preseq, ch_mapped_reads_damageprofiler
file "*.bai" into ch_bam_index_for_damageprofiler
file "*.csi" into ch_bam_index_for_damageprofiler


script:
Expand All @@ -658,7 +658,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 "${prefix}".sorted.bam
samtools index -c "${prefix}".sorted.bam
"""
}

Expand Down Expand Up @@ -703,7 +703,7 @@ process circularmapper{

output:
file "*.sorted.bam" into ch_mapped_reads_idxstats_cm,ch_mapped_reads_filter_cm,ch_mapped_reads_preseq_cm, ch_mapped_reads_damageprofiler_cm
file "*.bai"
file "*.csi"

script:
filter = "${params.circularfilter}" ? '' : '-f true -x false'
Expand All @@ -715,7 +715,7 @@ process circularmapper{
bwa samse -r "@RG\\tID:ILLUMINA-${prefix}\\tSM:${prefix}\\tPL:illumina" $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 "${prefix}".sorted.bam
samtools index -c "${prefix}".sorted.bam
"""
}

Expand All @@ -731,15 +731,15 @@ process bwamem {

output:
file "*.sorted.bam" into ch_bwamem_mapped_reads_idxstats,ch_bwamem_mapped_reads_filter,ch_bwamem_mapped_reads_preseq, ch_bwamem_mapped_reads_damageprofiler
file "*.bai"
file "*.csi"


script:
prefix = reads[0].toString() - ~/(_R1)?(\.combined\.)?(prefixed)?(_trimmed)?(_val_1)?(\.fq)?(\.fastq)?(\.gz)?$/
fasta = "${index}/*.fasta"
"""
bwa mem -t ${task.cpus} $fasta $reads -R "@RG\\tID:ILLUMINA-${prefix}\\tSM:${prefix}\\tPL:illumina" | samtools sort -@ ${task.cpus} -O bam - > "${prefix}".sorted.bam
samtools index -@ ${task.cpus} "${prefix}".sorted.bam
samtools index -c -@ ${task.cpus} "${prefix}".sorted.bam
"""
}

Expand Down Expand Up @@ -786,38 +786,38 @@ process samtools_filter {
file "*filtered.bam" into ch_bam_filtered_qualimap, ch_bam_filtered_dedup, ch_bam_filtered_markdup, ch_bam_filtered_pmdtools, ch_bam_filtered_angsd, ch_bam_filtered_gatk
file "*.fastq.gz" optional true
file "*.unmapped.bam" optional true
file "*.bai"
file "*.csi"

script:
prefix="$bam" - ~/(\.bam)?/

if("${params.bam_discard_unmapped}" && "${params.bam_unmapped_type}" == "discard"){
"""
samtools view -h -b $bam -@ ${task.cpus} -F4 -q ${params.bam_mapping_quality_threshold} -o ${prefix}.filtered.bam
samtools index ${prefix}.filtered.bam
samtools index -c ${prefix}.filtered.bam
"""
} else if("${params.bam_discard_unmapped}" && "${params.bam_unmapped_type}" == "bam"){
"""
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 index ${prefix}.filtered.bam
samtools index -c ${prefix}.filtered.bam
"""
} else if("${params.bam_discard_unmapped}" && "${params.bam_unmapped_type}" == "fastq"){
"""
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 index ${prefix}.filtered.bam
samtools index -c ${prefix}.filtered.bam
samtools fastq -tn ${prefix}.unmapped.bam | pigz -p ${task.cpus} > ${prefix}.unmapped.fastq.gz
rm ${prefix}.unmapped.bam
"""
} else if("${params.bam_discard_unmapped}" && "${params.bam_unmapped_type}" == "both"){
"""
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 index ${prefix}.filtered.bam
samtools index -c ${prefix}.filtered.bam
samtools fastq -tn ${prefix}.unmapped.bam | pigz -p ${task.cpus} > ${prefix}.unmapped.fastq.gz
"""
} else { //Only apply quality filtering, default
"""
samtools view -h -b $bam -@ ${task.cpus} -q ${params.bam_mapping_quality_threshold} -o ${prefix}.filtered.bam
samtools index ${prefix}.filtered.bam
samtools index -c ${prefix}.filtered.bam
"""
}
}
Expand All @@ -841,7 +841,7 @@ process dedup{
file "*.hist" into ch_hist_for_preseq
file "*.log" into ch_dedup_results_for_multiqc
file "${prefix}.sorted.bam" into ch_dedup_bam
file "*.bai"
file "*.csi"

script:
prefix="${bam.baseName}"
Expand All @@ -852,14 +852,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 "$prefix".sorted.bam
samtools index -c "$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 "$prefix".sorted.bam
samtools index -c "$prefix".sorted.bam
"""
}
}
Expand Down Expand Up @@ -1037,15 +1037,15 @@ process bam_trim {

output:
file "*.trimmed.bam" into ch_trimmed_bam_for_genotyping
file "*.bai"
file "*.csi"

script:
prefix="${bam.baseName}"
softclip = "${params.bamutils_softclip}" ? '-c' : ''
"""
bam trimBam $bam tmp.bam -L ${params.bamutils_clip_left} -R ${params.bamutils_clip_right} ${softclip}
samtools sort -@ ${task.cpus} tmp.bam -o ${prefix}.trimmed.bam
samtools index ${prefix}.trimmed.bam
samtools index -c ${prefix}.trimmed.bam
"""
}

Expand Down