diff --git a/seqnado/workflow/rules/align.smk b/seqnado/workflow/rules/align.smk index a25bc91d..9e0ff6c6 100644 --- a/seqnado/workflow/rules/align.smk +++ b/seqnado/workflow/rules/align.smk @@ -1,6 +1,7 @@ import seqnado.utils as utils if config["split_fastq"] == "False": + rule align_paired: input: fq1="seqnado_output/trimmed/{sample}_1.fastq.gz", @@ -22,6 +23,7 @@ if config["split_fastq"] == "False": mv {output.bam}_sorted {output.bam} """ + rule align_paired: input: fq1="seqnado_output/trimmed/{sample}_1.fastq.gz", @@ -34,7 +36,7 @@ rule align_paired: threads: config["bowtie2"]["threads"] resources: mem_mb=4000, - time='0-04:00:00', + time="0-04:00:00", log: "seqnado_output/logs/align/{sample}.log", shell: @@ -44,22 +46,26 @@ rule align_paired: mv {output.bam}_sorted {output.bam} """ - # rule align_single: - # input: - # fq1="seqnado_output/trimmed/{sample}.fastq.gz", - # params: - # index=config["genome"]["indicies"], - # options=config["bowtie2"]["options"], - # output: - # bam=temp("seqnado_output/aligned/raw/{sample}.bam"), - # resources: - # mem_mb=4000 // int(config["bowtie2"]["threads"]) - # threads: config["bowtie2"]["threads"] - # log: - # "seqnado_output/logs/align/{sample}.log", - # shell: - # """bowtie2 -p {threads} -x {params.index} -U {input.fq1} {params.options} 2> {log} | - # samtools view -bS - > {output.bam} && - # samtools sort -@ {threads} -o {output.bam}_sorted {output.bam} && - # mv {output.bam}_sorted {output.bam} - # """ + +rule align_single: + input: + fq1="seqnado_output/trimmed/{sample}.fastq.gz", + params: + index=config["genome"]["indicies"], + options=utils.check_options(config["bowtie2"]["options"]), + output: + bam=temp("seqnado_output/aligned/raw/{sample}.bam"), + resources: + mem_mb=4000, + threads: config["bowtie2"]["threads"] + log: + "seqnado_output/logs/align/{sample}.log", + shell: + """bowtie2 -p {threads} -x {params.index} -U {input.fq1} {params.options} 2> {log} | + samtools view -bS - > {output.bam} && + samtools sort -@ {threads} -o {output.bam}_sorted {output.bam} && + mv {output.bam}_sorted {output.bam} + """ + + +ruleorder: align_paired > align_single