fixed compression of basecalled data, added reference alignment step

This commit is contained in:
Tom Kasper
2026-09-19 08:49:46 +01:00
parent 9747494090
commit 15c56b9ffb
2 changed files with 31 additions and 2 deletions
+2 -1
View File
@@ -24,8 +24,9 @@ rule all:
#'../data/reference_genomes/full_reference.mmi', #'../data/reference_genomes/full_reference.mmi',
#'../data/raw_pod5/' #'../data/raw_pod5/'
#'../data/pod5_files_to_pull', #'../data/pod5_files_to_pull',
'../data/basecalled_reads/hac.fastq.gz' #'../data/basecalled_reads/hac.fastq.gz'
#expand('../data/raw_pod5/PBK98658_853a956f_57f83f46_{batch}.pod5',batch=range(1,config["pod5_dataset_size"]+1,config["pod5_stride"])) #expand('../data/raw_pod5/PBK98658_853a956f_57f83f46_{batch}.pod5',batch=range(1,config["pod5_dataset_size"]+1,config["pod5_stride"]))
'../data/aligned_reads/{model}_to_genome.sorted.bam'
use rule * from preparation use rule * from preparation
use rule * from baseline use rule * from baseline
+29 -1
View File
@@ -52,7 +52,7 @@ rule basecall_pod5:
model="hac|fast" model="hac|fast"
shell: shell:
""" """
dorado basecaller --models-directory {config[dorado_model_dir]} --emit-fastq {params.benchmarking} {params.min_qscore} {params.dorado_model} {input.pod5} > {output} dorado basecaller --models-directory {config[dorado_model_dir]} --emit-fastq {params.benchmarking} {params.min_qscore} {params.dorado_model} {input.pod5} | gzip -c > {output}
""" """
rule concatenate_basecalled_fastq: rule concatenate_basecalled_fastq:
@@ -66,4 +66,32 @@ rule concatenate_basecalled_fastq:
shell: shell:
""" """
zcat {input} > {output} zcat {input} > {output}
"""
rule align_reads_to_reference:
input:
fastq='../data/basecalled_reads/{model}.fastq.gz',
ref='../data/reference_genomes/full_reference.mmi'
output:
'../data/aligned_reads/{model}_to_genome.sam'
threads: 32
conda:
'../envs/minimap.yaml'
shell:
"""
minimap2 -ax map-ont -t {threads} {input.ref} {input.fastq} > {output}
"""
rule convert_sam_to_bam:
input:
'../data/aligned_reads/{model}_to_genome.sam'
output:
'../data/aligned_reads/{model}_to_genome.sorted.bam'
threads: 32
conda:
'../envs/samtools.yaml'
shell:
"""
samtools view -b -@ {threads} {input} | samtools sort -@ {threads} > {output}
samtools index -@ {threads} {output}
""" """