Package: pyrpipe
pyrpipe: python rna-seq pipelinerIntroductionpyrpipe (Pronounced as "pyre-pipe") is a python package to easily develop bioinformatic or any other computational pipelines in pure python.
pyrpipe provides an easy-to-use framework for importing any UNIX command in python.
pyrpipe comes with specialized classes and functions to easily code RNA-Seq processing workflows.
Pipelines in pyrpipe can be created and extended by integrating third-party tools, executable scripts, or python libraries in an object oriented manner.Preprint is availablehereRead the docshereNOTE:Due to change in API designs, pyrpipe version 0.0.5 and above is not compatible with lower versions.
All the tutorials and documentation have been updated to reflect v0.0.5.What it doesAllows fast and easy development of bioinformatics pipelines in python by providinga high level api to popular RNA-Seq processing tools -- downloading, trimming, alignment, quantificantion and assemblyoptimizes program parameters based on the dataa general framework to execute any linux command from pythoncomprehensive logging features to log all the commands, output and their return statusreport generating features for easy sharing, reproducing, benchmarking and debuggingKey Features (version 0.0.5)Import any UNIX executable command/tool in pythonDry-run feature to check dependencies and commands before executionFlexible and robust handling of options and arguments (both Linux and Java style options)Auto load command options from .yaml filesEasily override threads and memory options using global valuesExtensive logging for all the commandsAutomatically verify Integrity of output targetsResume feature to restart pipelines/jobs from where interruptedCreate reports, MultiQC reports for bioinformatic pipelinesEasily integrated into workflow managers like Snakemake and NextFlow (to schedule jobs, scale jobs, identify paralellel steps in pipelines)What it CAN NOT do by itselfSchedule jobsScale jobs on HPC/cloudIdentify parallel steps in pipelinesPrerequisitespython 3.6 or higherOS: Linux, MacAPI to RNA-Seq tools include:ToolPurposeSRA Tools(v. 2.9.6 or higher)SRA accessTrimgaloreTrimmingBBDukTrimmingHisat2AlignmentSTARAlignmentBowtie2AlignmentKallistoQuantificationSalmonQuantificationStringtieTranscript AssemblyCufflinksTranscript AssemblySamtoolsToolsExamplesGet started with the basictutorial. Read the documentationhere. Several examples are providedhereDownload, trim and align RNA-Seq dataFollowing python code downloads data from SRA, uses Trim Galore to trim the fastq files and STAR to align reads.
More detailed examples are providedherefrom pyrpipe.sra import SRA
from pyrpipe.qc import Trimgalore
from pyrpipe.mapping import Star
trimgalore = Trimgalore(threads=8)
star = Star(index='data/index',threads=4)
for srr in ['SRR976159','SRR978411','SRR971778']:
    SRA(srr).trim(trimgalore).align(star)Import a Unix commandThis simple example imports and runs the Unixgrepcommand. Seethisfor more examples.>>> from pyrpipe.runnable import Runnable
>>> grep=Runnable(command='grep')
>>> grep.run('query1','file1.txt',verbose=True)
>>> grep.run('query2','file2.txt',verbose=True)InstallationPlease follow these instructions:To create a new Conda environment (recommended):NOTE: You need to install the third-party tools to work with pyrpipe. We recomend installing these throughbiocondawhere possible.
An example of setting up the environment using conda is provided below.
It is best toshare your conda environment fileswith pyrpipe scripts to ensure reproducibility.Download and installCondaconda create -n pyrpipe python=3.8conda activate pyrpipeconda install -c bioconda pyrpipe star=2.7.7a sra-tools=2.10.9 stringtie=2.1.4 trim-galore=0.6.6The above command will install pyrpipe and the required tools inside a conda environment.
Alternatively, use the conda environment.yaml file provided in this repository and build the conda environment by runningconda env create -f environment.yamlInstall latest stable versionThrough condaconda install -c bioconda pyrpipeThrough PIPpip install pyrpipe --upgradeIf above command fails due to dependency issues, try:Download therequirements.txtpip install -r requirements.txtpip install pyrpipeTo run tests:Download thetest set(direct link)pip install pytestTo build test_environment. PleaseREAD THISFrom pyrpipe root directory, runpytest tests/test_*Install dev versiongit clone https://github.com/urmi-21/pyrpipe.git
pip install -r pyrpipe/requirements.txt
pip install -e path_to/pyrpipe

#Running tests; From pyrpipe root perform
#To build test_environment (This will download tools): 
cd tests ; . ./build_test_env.sh
#in same terminal
py.test tests/test_*Setting NCBI SRA-ToolsIf you face problems with downloading data from SRA, try configuring the SRA-Tools.
Usevdb-config -ito configure SRA Toolkit. Make sure that:Under theTOOLStab, prefetch downloads to is set to public user-repositoryUnder theCACHEtab, location of public user-repository is not emptyUse the following pyrpipe_diagnostic command to test if SRA-Tools are setup properlypyrpipe_diagnostic testFundingThis work is funded in part by the National Science Foundation award IOS 1546858, "Orphan Genes: An Untapped Genetic Reservoir of Novel Traits".