Revision dafa07df
Added by ChloƩ QUIGNOT 5 months ago
exercise0/Snakefile | ||
---|---|---|
samples=["P01325", "P01308"]
|
||
|
||
rule targets:
|
||
input:
|
||
expand("fasta/{sample}.fasta", sample=samples),
|
||
rule mafft:
|
||
input:
|
||
"fusionFasta/allSequences.fasta",
|
||
output:
|
||
"mafft/mafft_res.fasta",
|
||
shell:
|
||
"""
|
||
mafft {input} > {output}
|
||
"""
|
||
|
||
|
||
rule loadData:
|
||
output:
|
||
"fasta/{sample}.fasta",
|
||
log:
|
||
stdout = "logs/{sample}_wget.stdout",
|
||
stderr = "logs/{sample}_wget.stderr",
|
||
output:
|
||
"fasta/P01325.fasta", "fasta/P01308.fasta",
|
||
params:
|
||
dirFasta = "fasta",
|
||
threads: 1
|
||
shell:
|
||
"""
|
||
wget --output-file {log.stderr} \
|
||
--directory-prefix {params.dirFasta} \
|
||
https://www.uniprot.org/uniprot/{wildcards.sample}.fasta > {log.stdout}
|
||
wget --directory-prefix {params.dirFasta} https://www.uniprot.org/uniprot/P01325.fasta
|
||
wget --directory-prefix {params.dirFasta} https://www.uniprot.org/uniprot/P01308.fasta
|
||
"""
|
||
|
||
|
||
rule fusionFasta:
|
||
input:
|
||
expand("fasta/{sample}.fasta", sample=samples),
|
||
p1="fasta/P01325.fasta",
|
||
p2="fasta/P01308.fasta",
|
||
output:
|
||
"fusionFasta/allSequences.fasta",
|
||
log:
|
||
"logs/fusionData.stderr",
|
||
threads: 1
|
||
shell:
|
||
"""
|
||
cat {input} > {output} 2> {log}
|
||
cat {input.p1} {input.p2} > {output}
|
||
"""
|
||
|
||
|
||
rule mafft:
|
||
input:
|
||
rules.fusionFasta.output,
|
||
output:
|
||
"mafft/mafft_res.fasta",
|
||
log:
|
||
"logs/whichMafft.txt",
|
||
threads: 1
|
||
shell:
|
||
"""
|
||
mafft {input} > {output} 2> {log}
|
||
"""
|
Also available in: Unified diff
simplification de Claire