Skip to content

Commit

Permalink
threading & more memory
Browse files Browse the repository at this point in the history
  • Loading branch information
MateuszChilinski committed Jul 31, 2024
1 parent a41e349 commit 30a3846
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,6 @@ RUN pip3 install plumbum

RUN curl -s https://get.nextflow.io | bash && mv nextflow /opt/

RUN wget https://github.com/SFGLab/nf-hichip/archive/refs/tags/1.8.tar.gz && tar -xvzf 1.8.tar.gz && mv nf-hichip-1.8/* . && rm 1.8.tar.gz && rm -r nf-hichip-1.8
RUN wget https://github.com/SFGLab/nf-hichip/archive/refs/tags/1.9.tar.gz && tar -xvzf 1.9.tar.gz && mv nf-hichip-1.9/* . && rm 1.9.tar.gz && rm -r nf-hichip-1.9

RUN /opt/nextflow
8 changes: 4 additions & 4 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ process Mapping {

script:
"""
bwa mem -M -v 0 -t ${params.threads} ${params.ref} ${fastq1} ${fastq2} | samtools view -bh - > ${sample}_output.bam
bwa mem -M -v 0 -t ${params.threads} ${params.ref} ${fastq1} ${fastq2} | samtools view -@ ${params.threads} -bh - > ${sample}_output.bam
"""
}

Expand All @@ -94,8 +94,8 @@ process FilterQuality {

script:
"""
samtools view -F 0x04 -b ${mapped_bam} > ${sample}_output_removed_not_aligned.bam
samtools view -q ${params.mapq} -@ ${params.threads} -b ${sample}_output_removed_not_aligned.bam > ${sample}_output_filtered.bam
samtools view -@ ${params.threads} -F 0x04 -b ${mapped_bam} > ${sample}_output_removed_not_aligned.bam
samtools view -@ ${params.threads} -q ${params.mapq} -b ${sample}_output_removed_not_aligned.bam > ${sample}_output_filtered.bam
"""
}

Expand All @@ -110,7 +110,7 @@ process RemoveDuplicates {

script:
"""
samtools sort -n -@ ${params.threads} -m 1G ${bam} -o - | samtools fixmate -@ ${params.threads} - - | samtools rmdup -S - ${sample}_dedup.bam
samtools sort -n -@ ${params.threads} -m ${params.mem}G ${bam} -o - | samtools fixmate -@ ${params.threads} - - | samtools rmdup -S - ${sample}_dedup.bam
"""
}

Expand Down
16 changes: 8 additions & 8 deletions main_chipseq.nf
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ process Mapping {

script:
"""
bwa mem -M -v 0 -t ${params.threads} ${params.ref} ${fastq1} ${fastq2} | samtools view -bh - > ${sample}_output.bam
bwa mem -M -v 0 -t ${params.threads} ${params.ref} ${input1} ${input2} | samtools view -bh - > ${sample}_input_output.bam
bwa mem -M -v 0 -t ${params.threads} ${params.ref} ${fastq1} ${fastq2} | samtools view -@ ${params.threads} -bh - > ${sample}_output.bam
bwa mem -M -v 0 -t ${params.threads} ${params.ref} ${input1} ${input2} | samtools view -@ ${params.threads} -bh - > ${sample}_input_output.bam
"""
}

Expand All @@ -104,10 +104,10 @@ process FilterQuality {

script:
"""
samtools view -F 0x04 -b ${mapped_bam} > ${sample}_output_removed_not_aligned.bam
samtools view -F 0x04 -b ${bam_input} > ${sample}_input_output_removed_not_aligned.bam
samtools view -q ${params.mapq} -@ ${params.threads} -b ${sample}_output_removed_not_aligned.bam > ${sample}_output_filtered.bam
samtools view -q ${params.mapq} -@ ${params.threads} -b ${sample}_input_output_removed_not_aligned.bam > ${sample}_input_output_filtered.bam
samtools view -@ ${params.threads} -F 0x04 -b ${mapped_bam} > ${sample}_output_removed_not_aligned.bam
samtools view -@ ${params.threads} -F 0x04 -b ${bam_input} > ${sample}_input_output_removed_not_aligned.bam
samtools view -@ ${params.threads} -q ${params.mapq} -b ${sample}_output_removed_not_aligned.bam > ${sample}_output_filtered.bam
samtools view -@ ${params.threads} -q ${params.mapq} -b ${sample}_input_output_removed_not_aligned.bam > ${sample}_input_output_filtered.bam
"""
}

Expand All @@ -124,8 +124,8 @@ process RemoveDuplicates {

script:
"""
samtools sort -n -@ ${params.threads} -m 1G ${bam} -o - | samtools fixmate -@ ${params.threads} - - | samtools rmdup -S - ${sample}_dedup.bam
samtools sort -n -@ ${params.threads} -m 1G ${input_bam} -o - | samtools fixmate -@ ${params.threads} - - | samtools rmdup -S - ${sample}_input_dedup.bam
samtools sort -n -@ ${params.threads} -m ${params.mem}G ${bam} -o - | samtools fixmate -@ ${params.threads} - - | samtools rmdup -S - ${sample}_dedup.bam
samtools sort -n -@ ${params.threads} -m ${params.mem}G ${input_bam} -o - | samtools fixmate -@ ${params.threads} - - | samtools rmdup -S - ${sample}_input_dedup.bam
"""
}

Expand Down

0 comments on commit 30a3846

Please sign in to comment.