2017-09-25 3 views
0

Je veux utiliser snakemake pour créer un pipeline bioinformatique et je l'ai googlé et lu des documents et d'autres choses, mais je ne sais toujours pas comment le faire fonctionner.Règles de Snakemake

Voici quelques-uns de mes fichiers de données brutes.

RAWDATA/010_0_bua_1.fq.gz, RAWDATA/010_0_bua_2.fq.gz
RAWDATA/11_15_ap_1.fq.gz, RAWDATA/11_15_ap_2.fq.gz

... ils sont tous les fichiers jumelés.)

Voici mon align.snakemake

from os.path import join 


STAR_INDEX = "/app/ref/ensembl/human/idx/" 
SAMPLE_DIR = "Rawdata" 
SAMPLES, = glob_wildcards(SAMPLE_DIR + "/{sample}_1.fq.gz") 

R1 = '{sample}_1.fq.gz' 
R2 = '{sample}_2.fq.gz' 


rule alignment: 
    input: 
     r1 = join(SAMPLE_DIR, R1), 
     r2 = join(SAMPLE_DIR, R2), 
    params: 
     STAR_INDEX = STAR_INDEX 
    output: 
     "Align/{sample}.bam" 
    message: 
     "--- mapping STAR---" 
    shell:""" 
     mkdir -p Align/{wildcards.sample} 
     STAR --genomeDir {params.STAR_INDEX} --readFilesCommand zcat --readFilesIn {input.r1} {input.r2} --outFileNamePrefix Align/{wildcards.sample}/log 
""" 

Ce qu'il est. Je cours ce dossier par "snakemake -np -s align.snakemake" et j'ai eu cette erreur.

WorkflowError: Les règles cible ne doivent pas contenir de caractères génériques. Veuillez spécifier des fichiers concrets ou une règle sans caractères génériques.

Je suis désolé que je pose cette question, il y a beaucoup de gens qui l'utilisent plutôt bien. toute aide serait vraiment appréciée. Désolé pour mon anglais.

P.S. J'ai lu le document officiel et le tutoriel mais n'en ai toujours aucune idée.

Répondre

1

Oh, je l'ai fait. Voici ma réponse à ma question pour certaines personnes qui pourraient vouloir de l'aide.

from os.path import join 


STAR_INDEX = "/app/ref/ensembl/human/idx/" 
SAMPLE_DIR = "Rawdata" 
SAMPLES, = glob_wildcards(SAMPLE_DIR + "/{sample}_1.fq.gz") 

R1 = '{sample}_1.fq.gz' 
R2 = '{sample}_2.fq.gz' 


rule all: 
    input: 
     expand("Align/{sample}/Aligned.toTranscriptome.out.bam", sample=SAMPLES) 

rule alignment: 
    input: 
     r1 = join(SAMPLE_DIR, R1), 
     r2 = join(SAMPLE_DIR, R2) 
    params: 
     STAR_INDEX = STAR_INDEX 
    output: 
     "Align/{sample}/Aligned.toTranscriptome.out.bam" 
    threads: 
     8 
    message: 
     "--- Mapping STAR---" 
    shell:""" 
     mkdir -p Align/{wildcards.sample} 
     STAR --genomeDir {params.STAR_INDEX} --outSAMunmapped Within --outFilterType BySJout --outSAMattributes NH HI AS NM MD --outFilterMultimapNmax 20 --outFilterMismatchNmax 999 --outFilterMismatchNoverLmax 0.04 --alignIntronMin 20 --alignIntronMax 1000000 --alignMatesGapMax 1000000 --alignSJoverhangMin 8 --alignSJDBoverhangMin 1 --sjdbScore 1 --runThreadN {threads} --genomeLoad NoSharedMemory --outSAMtype BAM Unsorted --quantMode TranscriptomeSAM --outSAMheaderHD \@HD VN:1.4 SO:unsorted --readFilesCommand zcat --readFilesIn {input.r1} {input.r2} --outFileNamePrefix Align/{wildcards.sample}/log 
"""