Snakemake:HISAT2index建立并使用触摸对齐

问题描述 投票:0回答:1

继我之前的问题:Snakemake: HISAT2 alignment of many RNAseq reads against many genomes UPDATED。我想在snakemake中使用hisat2运行touch对齐。我有几个后缀为1.ht2l至.8.ht2l的基因组文件

bob.1.ht2l
...
bob.8.ht2l
steve.1.ht2l 
...
steve.8.ht2l

和sereval RNAseq样本

flower_kevin_1.fastq.gz
flower_kevin_2.fastq.gz
flower_daniel_1.fastq.gz
flower_daniel_2.fastq.gz 

我需要针对每个基因组对齐所有rnaseq读数。

workdir: "/path/to/dir/"

(HISAT2_INDEX_PREFIX,)=glob_wildcards('/path/to/dir/{prefix}.fasta')
(SAMPLES,)=glob_wildcards("/path/to/dir/{sample}_1.fastq.gz")

rule all:
    input: 
        expand("{prefix}.{sample}.bam", zip, prefix=HISAT2_INDEX_PREFIX, sample=SAMPLES)

rule hisat2_build:
    input:
        database="/path/to/dir/{prefix}.fasta"
    output:
        done = touch("{prefix}")
    threads: 2
    shell:
        ("/Tools/hisat2-2.1.0/hisat2-build -p {threads} {input.database} {wildcards.prefix}")

rule hisat2:
    input:
        hisat2_prefix_done = "{prefix}",
        fastq1="/path/to/dir/{sample}_1.fastq.gz",
        fastq2="/path/to/dir/{sample}_2.fastq.gz"
    output:
        bam = "{prefix}.{sample}.bam",
        txt = "{prefix}.{sample}.txt",
    log: "{prefix}.{sample}.snakemake_log.txt"
    threads: 50
    shell:
        "/Tools/hisat2-2.1.0/hisat2 -p {threads} -x {wildcards.prefix}"
        " -1 {input.fastq1} -2 {input.fastq2}  --summary-file {output.txt} |"
        "/Tools/samtools-1.9/samtools sort -@ {threads} -o {output.bam}"

[输出使我bobsteve仅与一个rna-seq样本(即flower_kevin)对齐。我不知道该怎么解决。任何建议都会有所帮助。

snakemake
1个回答
0
投票

我通过从全部规则中删除zip解决了问题。仍然欢迎对代码语法的批评。

© www.soinside.com 2019 - 2024. All rights reserved.