Skip to content
Snippets Groups Projects
Commit aeaacee4 authored by elabaron's avatar elabaron
Browse files

src/RibosomeProfiling.nf : trim 1 base at 5' and 3' end by hisat

parent fbed90fc
No related branches found
No related tags found
No related merge requests found
......@@ -276,6 +276,9 @@ hisat2 -x ${index_id} \
--un-gz ${file_id}_notaligned.fastq.gz \
--rna-strandness ${params.strand} \
--dta \
--no-softclip \
--trim5 1\
--trim3 1\
2> ${file_id}_genome.txt \
| samtools view -bS -F 4 - \
| samtools sort -@ ${task.cpus} -o ${file_id}.bam \
......@@ -316,29 +319,29 @@ process fastqc_genome {
/* Deduplication of reads */
////////////////////////////
process dedup_genome {
tag "$file_id"
publishDir "${params.output}/03_hisat2/dedup/", mode: 'copy'
if (params.do_dedup) {
process dedup_genome {
tag "$file_id"
publishDir "${params.output}/03_hisat2/dedup/", mode: 'copy'
input:
set file_id, file(bam) from HISAT_ALIGNED_DEDUP
input:
set file_id, file(bam) from HISAT_ALIGNED_DEDUP
output:
set file_id, "*.{bam, bai}" into DEDUP_GENOME
file "*.log" into DEDUP_LOG
output:
set file_id, "*.{bam, bai}" into DEDUP_GENOME
file "*.log" into DEDUP_LOG
when:
params.do_dedup
when:
params.do_dedup
"""
umi_tools dedup -I ${bam[0]} \
-S ${file_id}.dedup.bam \
> ${file_id}_dedup.log
"""
}
if (! params.do_dedup) {
HISAT_ALIGNED_DEDUP.into{DEDUP_GENOME}
"""
umi_tools dedup -I ${bam[0]} \
-S ${file_id}.dedup.bam \
> ${file_id}_dedup.log
"""
}
} else {
HISAT_ALIGNED_DEDUP.set{DEDUP_GENOME}
}
DEDUP_GENOME.into{DEDUP_GENOME_HTSEQ;
......@@ -456,7 +459,7 @@ hisat2 -x ${index2_id} \
--rna-strandness ${params.strand} \
--dta\
2> ${file_id}_postgenome.txt \
| samtools view -bS -F 4 - \
| samtools view -bS -F 4 -F 256 - \
| samtools sort -@ ${task.cpus} -o ${file_id}.bam \
&& samtools index ${file_id}.bam
......@@ -473,25 +476,29 @@ POSTGENOME_ALIGNED.into{POSTGENOME_ALIGNED_FASTQC;
/* Deduplication of reads */
////////////////////////////
process dedup_postgenome {
tag "$file_id"
publishDir "${params.output}/05_post_genome_hisat2/dedup/", mode: 'copy'
if (params.do_dedup){
process dedup_postgenome {
tag "$file_id"
publishDir "${params.output}/05_post_genome_hisat2/dedup/", mode: 'copy'
input:
set file_id, file(bam) from POSTGENOME_ALIGNED_DEDUP
input:
set file_id, file(bam) from POSTGENOME_ALIGNED_DEDUP
output:
set file_id, "*.{bam, bai}" into DEDUP_POSTGENOME
file "*.log" into DEDUP_POSTGENOME_LOG
output:
set file_id, "*.{bam, bai}" into DEDUP_POSTGENOME
file "*.log" into DEDUP_POSTGENOME_LOG
when:
params.do_dedup
when:
params.do_dedup
"""
umi_tools dedup -I ${bam[0]} \
-S ${file_id}.dedup.bam \
> ${file_id}_dedup.log
"""
}
} else {
"""
umi_tools dedup -I ${bam[0]} \
-S ${file_id}.dedup.bam \
> ${file_id}_dedup.log
"""
}
process fastqc_postgenome {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment