GithubHelp home page GithubHelp logo

ritatam / snakemake_ont_consensus_build Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 1.31 MB

A mini snakemake pipeline to batch construct consensus sequences from long nanopore amplicons w/ medaka for a set of samples

Python 41.71% Shell 58.29%

snakemake_ont_consensus_build's Introduction

Consensus sequence construction from ONT long amplicons using USEARCH and medaka - Snakemake workflow

A mini snakemake pipeline for batch constructing consensus sequences from long nanopore amplicons with medaka for a set of samples.

The pipeline includes the following steps:

  1. usearch -cluster_fast for clustering read sequences to find centroid with the largest cluster size (i.e. draft sequence)
  2. mini_align for aligning the reads to a draft/intermediate sequence
  3. medaka consensus for running consensus algorithm across assembly regions
  4. medaka stitch for collating results from step 3 to create consensus sequence

Steps 2-4 (wrapped up in medaka_polish.sh) are the medaka polishing steps, and will be iterated for four rounds as advised by medaka documentation. This snakemake script will automatically install medaka package (defined in envs/medaka.yaml) in your working directory without requiring admin priviledges. The final consensus from the 4th polishing round will be renamed as *.final_consensus.fa.

At the end of pipeline, the final consensus sequences of all samples will be merged into a single FASTA file (all_samples.final_consensus.fa) in the output directory.

Clone this repository

git clone https://github.com/ritatam/snakemake_ont_consensus_build.git
cd snakemake_ont_consensus_build

Dependencies

Configuration

Paths and parameters can be edited in config.yaml.

  1. input_reads_dir: Input directory containing all the *.fastq amplicon read files (e.g. s_cerevisiae.fastq, a_flavus.fastq, ...) to be processed simultaneously (via snakemake)
  2. output_dir: Output directory to store draft and polished consensus sequences per sample (as subdirectories). All the intermediate files will be stored in the output sample/polish/intermediate_files directory.
  3. usearch_path: Path to the USEARCH binary. Note: This has been already configured to use the USEARCH binary in the repo's external_program folder, so user will not need to download it independently.
  4. usearch_id: Minimum sequence identity for USEARCH read clustering, ranging between 0.0 and 1.0.
  5. medaka_model: Medaka model for consensus polishing, based on the basecaller used. See medaka documentation for details.
  6. threads: Number of threads to use in medaka polishing.

Executing the pipeline

Install the required conda environemnt without running the pipeline. Subsequent runs with flag --use-conda will utilise the local environment stored in your working directory (/.snakemake/conda) without requiring internet connection.

snakemake --use-conda --conda-create-envs-only -c1

Dry-run the pipeline to print the commands and the corresponding i/o files, without running the pipeline.

snakemake --use-conda -np

Run the pipeline and specify number of cores to use (e.g. 8 cores)

snakemake --use-conda -c8 

snakemake_ont_consensus_build's People

Contributors

ritatam avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.