展开

snakemake生信流程库

最后发布时间 : 2022-09-25 23:31:14 浏览量 :

https://workflowhub.eu/
https://snakemake.github.io/snakemake-workflow-catalog/

https://github.com/snakemake-workflows/rna-seq-star-deseq2/blob/master/workflow/rules/common.smk
https://github.com/c-kroeger/snakemake-hisat2-stringtie/blob/master/Snakefile

def get_fq(wildcards):
    if config["trimming"]["activate"]:
        # activated trimming, use trimmed data
        if is_paired_end(wildcards.sample):
            # paired-end sample
            return dict(
                zip(
                    ["fq1", "fq2"],
                    expand(
                        "results/trimmed/{sample}_{unit}_{group}.fastq.gz",
                        group=["R1", "R2"],
                        **wildcards,
                    ),
                )
            )
        # single end sample
        return {"fq1": "trimmed/{sample}_{unit}_single.fastq.gz".format(**wildcards)}
    else:
        # no trimming, use raw reads
        u = units.loc[(wildcards.sample, wildcards.unit), ["fq1", "fq2"]].dropna()
        if pd.isna(u["fq1"]):
            # SRA sample (always paired-end for now)
            accession = u["sra"]
            return dict(
                zip(
                    ["fq1", "fq2"],
                    expand(
                        "sra/{accession}_{group}.fastq",
                        accession=accession,
                        group=["R1", "R2"],
                    ),
                )
            )
        if not is_paired_end(wildcards.sample):
            return {"fq1": f"{u.fq1}"}
        else:
            return {"fq1": f"{u.fq1}", "fq2": f"{u.fq2}"}
apptainer exec   --bind /data:/data   /data/wangyang/SitobionAvenae/.snakemake/singularity/99ad75c5c3fe1f848fdcd99e722cb216.simg   hisat2-build  -p 20 resources/genome.fasta resources/hisat2_genome/genome
snakemake.io.unpack