Snippet for snakemake pipelines

public public 1yr ago 0 bookmarks

snakemake_snippet

Snippet for snakemake pipelines. Use it to create your pipelines, just change files.

Command files commented in key points. Snippet has example of rules with python code and tools installed automaticly with conda . This snippet is runnable, it needs only snakemake available in you environment.

Structure

  • argparse_wrapper.py - scripts ahat parses arguments, creates config files and runs snakemake

  • workflow/Snakefile - main pipeline file, collects rules needed for run and structure of the pipeline

  • workflow/rules - folder with rules to run

  • workflow/envs - folder with conda env settings for rules

  • workflow/scripts - example of script used in one rule

  • test - folder with files needed to test snippet

Usage

Clone the repository and try to run snippet, for example: ./argparse_wrapper.py -a ./test/assembly_with_Ns.fasta -hifi ./test/hifi_reads.fastq -o ./test/test_output -d This command will dry run the script and list a steps to be done. Delete -d to run pipeline.

Code Snippets

 8
 9
10
run:
    with open(output.splitted_assembly, 'w') as fw:
        for header, seq in split_fasta_by_N(input.assembly):
14
15
16
17
18
19
20
shell: """
minimap2 -ax map-hifi {input.assembly_splitted_by_n} {input.hifi} -t {threads} \
| samtools view -b -u - \
| samtools sort -@ {threads} -T tmp > {output.alignment_bam} \
&& samtools flagstat {output.alignment_bam} > {output.alignment_stats} \
&& bedtools genomecov -bga -split -ibam {output.alignment_bam} > {output.coverage_bed}
"""
ShowHide 1 more snippets with no or duplicated tags.

Login to post a comment if you would like to share your experience with this workflow.

Do you know this workflow well? If so, you can request seller status , and start supporting this workflow.

Free

Created: 1yr ago
Updated: 1yr ago
Maitainers: public
URL: https://github.com/zilov/snakemake_snippet
Name: snakemake_snippet
Version: 1
Badge:
workflow icon

Insert copied code into your website to add a link to this workflow.

Downloaded: 0
Copyright: Public Domain
License: None
  • Future updates

Related Workflows

cellranger-snakemake-gke
snakemake workflow to run cellranger on a given bucket using gke.
A Snakemake workflow for running cellranger on a given bucket using Google Kubernetes Engine. The usage of this workflow ...