-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add fastq_split option * add fastq_split option to atac chip and rna & test * add num of parts to split fastq to config * update test for snp with split and call snps
- Loading branch information
Showing
22 changed files
with
206 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,4 @@ dist/* | |
.ipynb_checkpoints/ | ||
seqnado/_version.py | ||
|
||
2023-04-27_test_snp/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ dependencies: | |
- deeptools | ||
- trim-galore | ||
- fastqc | ||
- fastqsplitter | ||
- multiqc | ||
- trackhub | ||
- seaborn | ||
|
2 changes: 1 addition & 1 deletion
2
seqnado/workflow/envs/profiles/profile_drmaa_singularity/config.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,44 @@ | ||
import seqnado.utils as utils | ||
|
||
if config["split_fastq"] == "no": | ||
rule align_paired: | ||
input: | ||
fq1="seqnado_output/trimmed/{sample}_1.fastq.gz", | ||
fq2="seqnado_output/trimmed/{sample}_2.fastq.gz", | ||
params: | ||
index=config["genome"]["indicies"], | ||
options=utils.check_options(config["bowtie2"]["options"]), | ||
output: | ||
bam="seqnado_output/aligned/raw/{sample}.bam", | ||
threads: config["bowtie2"]["threads"] | ||
resources: | ||
mem_mb=4000 // int(config["bowtie2"]["threads"]) | ||
log: | ||
"seqnado_output/logs/align/{sample}.log", | ||
shell: | ||
"""bowtie2 -p {threads} -x {params.index} -1 {input.fq1} -2 {input.fq2} {params.options} 2> {log} | | ||
samtools view -bS - > {output.bam} && | ||
samtools sort -@ {threads} -o {output.bam}_sorted {output.bam} >> {log} 2>&1 && | ||
mv {output.bam}_sorted {output.bam} | ||
""" | ||
|
||
rule align_paired: | ||
input: | ||
fq1="seqnado_output/trimmed/{sample}_1.fastq.gz", | ||
fq2="seqnado_output/trimmed/{sample}_2.fastq.gz", | ||
params: | ||
index=config["genome"]["indicies"], | ||
options=utils.check_options(config["bowtie2"]["options"]), | ||
output: | ||
bam=temp("seqnado_output/aligned/raw/{sample}.bam"), | ||
threads: config["bowtie2"]["threads"] | ||
resources: | ||
mem_mb=4000 // int(config["bowtie2"]["threads"]) | ||
log: | ||
"seqnado_output/logs/align/{sample}.log", | ||
shell: | ||
"""bowtie2 -p {threads} -x {params.index} -1 {input.fq1} -2 {input.fq2} {params.options} 2> {log} | | ||
samtools view -bS - > {output.bam} && | ||
samtools sort -@ {threads} -o {output.bam}_sorted {output.bam} >> {log} 2>&1 && | ||
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=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} | ||
# """ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import seqnado.utils as utils | ||
PARTS=[str (x) for x in range(int(config["split_fastq_parts"]))] | ||
if config["split_fastq"] == "yes": | ||
if config["read_type"] == "paired": | ||
rule split_fq: | ||
input: | ||
unpack(lambda wc: seqnado.utils.translate_fq_files(wc, samples=FASTQ_SAMPLES, paired=True)), | ||
output: | ||
expand("seqnado_output/fastq_split/{{sample}}_{part}_{read}.fastq.gz", part=PARTS, read=["1", "2"]), | ||
params: | ||
split1=expand("-o seqnado_output/fastq_split/{{sample}}_{part}_1.fastq.gz", part=PARTS), | ||
split2=expand("-o seqnado_output/fastq_split/{{sample}}_{part}_2.fastq.gz", part=PARTS), | ||
resources: | ||
mem_mb=750, | ||
shell:""" | ||
fastqsplitter -i {input.fq1} {params.split1} && | ||
fastqsplitter -i {input.fq2} {params.split2} | ||
""" | ||
|
||
rule trimgalore_paired: | ||
input: | ||
split1="seqnado_output/fastq_split/{sample}_{part}_1.fastq.gz", | ||
split2="seqnado_output/fastq_split/{sample}_{part}_2.fastq.gz", | ||
output: | ||
trimmed1=temp("seqnado_output/trimmed/{sample}_{part}_1_trimmed.fq.gz"), | ||
trimmed2=temp("seqnado_output/trimmed/{sample}_{part}_2_trimmed.fq.gz"), | ||
threads: 4 | ||
resources: | ||
mem_mb=750, | ||
params: | ||
options=utils.check_options(config['trim_galore']['options']), | ||
trim_dir="seqnado_output/trimmed" | ||
log:"seqnado_output/logs/trimming/{sample}_{part}.log", | ||
shell:""" | ||
trim_galore --cores {threads} {params.options} --basename {wildcards.sample}_{wildcards.part} --paired --output_dir {params.trim_dir} {input.split1} {input.split2} >> {log} 2>&1 && | ||
mv {params.trim_dir}/{wildcards.sample}_{wildcards.part}_val_1.fq.gz {output.trimmed1} && | ||
mv {params.trim_dir}/{wildcards.sample}_{wildcards.part}_val_2.fq.gz {output.trimmed2} | ||
""" | ||
|
||
rule align_split: | ||
input: | ||
fq1="seqnado_output/trimmed/{sample}_{part}_1_trimmed.fq.gz", | ||
fq2="seqnado_output/trimmed/{sample}_{part}_2_trimmed.fq.gz", | ||
output: | ||
bam=temp("seqnado_output/aligned/split/{sample}_{part}.bam"), | ||
params: | ||
index=config["genome"]["indicies"], | ||
options=utils.check_options(config["bowtie2"]["options"]), | ||
threads: config["bowtie2"]["threads"] | ||
resources: | ||
mem_mb=4000 // int(config["bowtie2"]["threads"]) | ||
log:"seqnado_output/logs/aligned/split/{sample}_part{part}.log", | ||
shell:""" | ||
bowtie2 -p {threads} -x {params.index} -1 {input.fq1} -2 {input.fq2} {params.options} 2> {log} | | ||
samtools view -bS - > {output.bam} && | ||
samtools sort -@ {threads} -o {output.bam}_sorted {output.bam} >> {log} 2>&1 && | ||
mv {output.bam}_sorted {output.bam} | ||
""" | ||
|
||
rule merge_bams: | ||
input: | ||
expand("seqnado_output/aligned/split/{{sample}}_{part}.bam", part=PARTS), | ||
output: | ||
bam=temp("seqnado_output/aligned/raw/{sample}.bam"), | ||
threads: 4 | ||
log:"seqnado_output/logs/merge/{sample}.log", | ||
shell:""" | ||
samtools merge -o {output.bam} -@ {threads} -h {input} >> {log} 2>&1 | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.