Commit 72e1b25 Pablo Riesgo-Ferreiro
authored Mar 25, 2024
File tree 3 files changed +52
-3
lines changed
3 files changed +52
-3
lines changed Original file line number Diff line number Diff line change
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.1.0/ ) ,
6
+ and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
7
+
8
+ ## [ Unreleased]
9
+
10
+ ### Added
11
+
12
+ ### Changed
13
+
14
+ ### Removed
15
+
16
+
17
+ ## [ 0.3.0] - 2024-03-25
18
+
19
+ ### Changed
20
+
21
+ - Replaced GATKs SamToFastq by bedtools bamtofastq to avoid issue with unmated reads
22
+
23
+
24
+ ## [ 0.2.0] - 2024-03-25
25
+
26
+ ### Added
27
+
28
+ - Add support for BAM files as input files. It extracts the reads aligned to the MHC region in the canonical
29
+ chromosome 6 + all reads from chromosome 6 alt contigs + unmapped reads and converts into FASTQs
30
+
31
+
32
+ ## [ 0.1.0] - 2022-11-02
33
+
34
+ - First release!
35
+
36
+
37
+ [ unreleased ] : https://github.com/tron-bioinformatics/tronflow-hla-hd/compare/v0.3.0...HEAD
38
+ [ 0.3.0 ] : https://github.com/tron-bioinformatics/tronflow-hla-hd/compare/v0.2.0...v0.3.0
39
+ [ 0.2.0 ] : https://github.com/tron-bioinformatics/tronflow-hla-hd/compare/v0.1.0...v0.2.0
40
+ [ 0.1.0 ] : https://github.com/tron-bioinformatics/tronflow-hla-hd/releases/tag/v0.1.0
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ process BAM2FASTQ {
5
5
publishDir " ${ params.output} /${ name} " , mode: " copy" , pattern: " *.txt"
6
6
module params. bowtie2_module
7
7
8
- conda (params. enable_conda ? " bioconda::samtools=1.18 bioconda::gatk4=4.2.5.0 " : null )
8
+ conda (params. enable_conda ? " bioconda::samtools=1.18 bioconda::bedtools=2.31.1 " : null )
9
9
10
10
input:
11
11
tuple val(name), val(bam)
@@ -31,12 +31,21 @@ process BAM2FASTQ {
31
31
32
32
#Merge bam files
33
33
samtools merge -o ${ name} .merge.bam ${ name} .unmap.bam ${ name} .mhc.bam
34
+ rm -f ${ name} .unmap.bam
35
+ rm -f ${ name} .mhc.bam
36
+
37
+ # sort BAM by read name
38
+ samtools sort -n ${ name} .merge.bam -o ${ name} .merge.sorted.bam
39
+ rm -f ${ name} .merge.bam
34
40
35
41
#Create fastq
36
- gatk SamToFastq --VALIDATION_STRINGENCY SILENT -I ${ name} .merge.bam -F ${ name} .hlatmp.1.fastq -F2 ${ name} .hlatmp.2.fastq
42
+ bedtools bamtofastq -i ${ name} .merge.sorted. bam -fq ${ name} .hlatmp.1.fastq -fq2 ${ name} .hlatmp.2.fastq
37
43
38
44
#Change fastq ID
39
45
cat ${ name} .hlatmp.1.fastq |awk '{if(NR%4 == 1){O=\$ 0;gsub("/1"," 1",O);print O}else{print \$ 0}}' | gzip > ${ name} .hla.1.fastq.gz
40
46
cat ${ name} .hlatmp.2.fastq |awk '{if(NR%4 == 1){O=\$ 0;gsub("/2"," 2",O);print O}else{print \$ 0}}' | gzip > ${ name} .hla.2.fastq.gz
47
+
48
+ rm -f ${ name} .hlatmp.1.fastq
49
+ rm -f ${ name} .hlatmp.2.fastq
41
50
"""
42
51
}
Original file line number Diff line number Diff line change 39
39
// Capture exit codes from upstream processes when piping
40
40
process. shell = [' /bin/bash' , ' -euo' , ' pipefail' ]
41
41
42
- VERSION = ' 0.2 .0'
42
+ VERSION = ' 0.3 .0'
43
43
44
44
manifest {
45
45
name = ' TRON-Bioinformatics/tronflow-hlahd'
You can’t perform that action at this time.
0 commit comments