Skip to content
Snippets Groups Projects
Commit 372438ee authored by Xavier Grand's avatar Xavier Grand
Browse files

Add Alignment Score filtration but need to take into account the length of reads.

parent eb1df0db
No related branches found
No related tags found
No related merge requests found
#!/bin/sh #!/bin/sh
docker pull lbmc/samtools:1.14 # docker pull xgrand/samtools:1.14
# docker build src/.docker_modules/samtools/1.14 -t 'lbmc/samtools:1.14' docker build src/.docker_modules/samtools/1.14 -t 'xgrand/samtools:1.14'
# docker push lbmc/samtools:1.14 docker push xgrand/samtools:1.14
docker buildx build --platform linux/amd64,linux/arm64 -t "lbmc/samtools:1.14" --push src/.docker_modules/samtools/1.14 # docker buildx build --platform linux/amd64,linux/arm64 -t "xgrand/samtools:1.14" --push src/.docker_modules/samtools/1.14
FROM staphb/samtools:1.17-2023-06
\ No newline at end of file
#!/bin/sh
# docker pull xgrand/samtools:1.17
docker build src/.docker_modules/samtools/1.17 -t 'xgrand/samtools:1.17'
docker push xgrand/samtools:1.17
# docker buildx build --platform linux/amd64,linux/arm64 -t "xgrand/samtools:1.17" --push src/.docker_modules/samtools/1.17
...@@ -104,10 +104,11 @@ params.kit_barcoding = "" ...@@ -104,10 +104,11 @@ params.kit_barcoding = ""
params.basecalling_out = "01_basecalling/" params.basecalling_out = "01_basecalling/"
params.barcoding_out = "02_barcoding/" params.barcoding_out = "02_barcoding/"
params.fastq_out = "03_fastq/" params.fastq_out = "03_fastq/"
params.seqkit_grep_out = "14_seqkit/" params.seqkit_grep_out = "03_fastq/"
params.porechop_out = "15_porechop/" params.porechop_out = "03_fastq/"
params.cutadapt_out = "04_cutadapt/" params.cutadapt_out = "04_cutadapt/"
params.minimap2_genome_out = "05_minimap2/" params.minimap2_genome_out = "05_minimap2/"
params.filtered_bam_out = "05_minimap2/"
params.start_position_counts_out = "06_start_positions/" params.start_position_counts_out = "06_start_positions/"
params.nanosplicer_out = "07_nanosplicer/" params.nanosplicer_out = "07_nanosplicer/"
params.rna_count_out = "08_RNA_count/" params.rna_count_out = "08_RNA_count/"
...@@ -171,7 +172,6 @@ if(!params.skipBC) { ...@@ -171,7 +172,6 @@ if(!params.skipBC) {
} }
} }
// include { barecode } from "./nf_modules/barecode/main.nf"
include { barcoding_cpu } from "./nf_modules/ont-guppy/main.nf" include { barcoding_cpu } from "./nf_modules/ont-guppy/main.nf"
include { control_basecalling } from "./nf_modules/pycoqc/main.nf" include { control_basecalling } from "./nf_modules/pycoqc/main.nf"
include { control_bam } from "./nf_modules/pycoqc/main.nf" include { control_bam } from "./nf_modules/pycoqc/main.nf"
...@@ -182,6 +182,7 @@ include { seqkit_grep } from "./nf_modules/seqkit/main.nf" ...@@ -182,6 +182,7 @@ include { seqkit_grep } from "./nf_modules/seqkit/main.nf"
include { sort_bam } from './nf_modules/samtools/main.nf' addParams(sort_bam_out: params.minimap2_genome_out) include { sort_bam } from './nf_modules/samtools/main.nf' addParams(sort_bam_out: params.minimap2_genome_out)
include { index_bam } from './nf_modules/samtools/main.nf' addParams(index_bam_out: params.minimap2_genome_out) include { index_bam } from './nf_modules/samtools/main.nf' addParams(index_bam_out: params.minimap2_genome_out)
include { sort_index_bam } from './nf_modules/samtools/main.nf' addParams(indexed_bam_out: params.minimap2_genome_out) include { sort_index_bam } from './nf_modules/samtools/main.nf' addParams(indexed_bam_out: params.minimap2_genome_out)
include { filter_as } from './nf_modules/samtools/main.nf'
include { start_position_counts } from "./nf_modules/samtools/main.nf" include { start_position_counts } from "./nf_modules/samtools/main.nf"
include { start_position_individuals } from "./nf_modules/start_positions/main.nf" include { start_position_individuals } from "./nf_modules/start_positions/main.nf"
include { jwr_checker } from "./nf_modules/nanosplicer/main.nf" include { jwr_checker } from "./nf_modules/nanosplicer/main.nf"
...@@ -258,8 +259,11 @@ workflow { ...@@ -258,8 +259,11 @@ workflow {
hbv_genome(cut_5pRACE.out.fastq_cutadapt, genome.collect()) hbv_genome(cut_5pRACE.out.fastq_cutadapt, genome.collect())
//Filter
filter_as(hbv_genome.out.bam)
//Index //Index
sort_index_bam(hbv_genome.out.bam) sort_index_bam(filter_as.out.filtered_bam)
//Quality control //Quality control
if(params.skipBC == false) { if(params.skipBC == false) {
......
...@@ -18,7 +18,7 @@ profiles { ...@@ -18,7 +18,7 @@ profiles {
docker.enabled = true docker.enabled = true
process { process {
errorStrategy = 'finish' errorStrategy = 'finish'
memory = '12GB' memory = '16GB'
withLabel: big_mem_mono_cpus { withLabel: big_mem_mono_cpus {
cpus = 1 cpus = 1
} }
......
...@@ -4,7 +4,7 @@ container_url = "xgrand/porechop:${version}" ...@@ -4,7 +4,7 @@ container_url = "xgrand/porechop:${version}"
params.porechop_out = "" params.porechop_out = ""
process porechop { process porechop {
container = "${container_url}" container = "${container_url}"
label "small_mem_multi_cpus" label "big_mem_multi_cpus"
tag "$barcode" tag "$barcode"
if (params.porechop_out != "") { if (params.porechop_out != "") {
publishDir "results/${params.porechop_out}", mode: 'copy' publishDir "results/${params.porechop_out}", mode: 'copy'
...@@ -14,9 +14,11 @@ process porechop { ...@@ -14,9 +14,11 @@ process porechop {
tuple val(barcode), path(fastq) tuple val(barcode), path(fastq)
output: output:
tuple val(barcode), path("*"), emit: porechoped_fastq tuple val(barcode), path("${barcode}/${barcode}_merged_porechoped.fastq.gz"), emit: porechoped_fastq
script: script:
""" """
mkdir ${barcode}
cd ${barcode}/
porechop --input ${fastq} -o ${barcode}_merged_porechoped.fastq.gz --threads ${task.cpus} porechop --input ${fastq} -o ${barcode}_merged_porechoped.fastq.gz --threads ${task.cpus}
""" """
} }
\ No newline at end of file
version = "1.7" version = "1.17"
container_url = "lbmc/samtools:${version}" container_url = "xgrand/samtools:${version}"
params.sort_bam_out ="" params.sort_bam_out =""
process sort_bam { process sort_bam {
...@@ -87,4 +87,27 @@ cd ${barcode}/ ...@@ -87,4 +87,27 @@ cd ${barcode}/
samtools sort -@ ${task.cpus} ../${bam} -o ${barcode}_sorted.bam samtools sort -@ ${task.cpus} ../${bam} -o ${barcode}_sorted.bam
samtools index -@ ${task.cpus} ${barcode}_sorted.bam samtools index -@ ${task.cpus} ${barcode}_sorted.bam
""" """
}
params.filtered_bam_out = ""
process filter_as {
container = "${container_url}"
label "big_mem_multi_cpus"
tag "${barcode}"
if (params.filtered_bam_out != "") {
publishDir "results/${params.filtered_bam_out}", mode: 'copy'
}
input:
tuple val(barcode), path(bam)
output:
tuple val(barcode), path("${barcode}/*_AS500.bam"), emit: filtered_bam
script:
"""
mkdir ${barcode}
cd ${barcode}/
samtools view -Shb -e '[AS]>=500' -@ ${task.cpus} ../${bam} -o ${barcode}_AS500.bam
"""
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment