-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
## Integrating pyrpipe scripts within a workflow management system (Nextflow) | ||
This example shows usage of pyrpipe with Nextflow workflow management system. The example is identical to the [Snakemake example](https://github.com/urmi-21/pyrpipe/tree/master/case_studies/Covid_RNA-Seq). | ||
This example downloads COVID-19 infected human RNA-Seq data from [Rother et. al.](https://www.medrxiv.org/content/10.1101/2020.06.08.20122143v1) published under accession [SRP287810](https://trace.ncbi.nlm.nih.gov/Traces/sra/?study=SRP287810). | ||
|
||
Uses salmon to quantify the RNA-Seq samples and compile The transcripts TPMs for exploratory analysis with [MetaOmGraph](https://github.com/urmi-21/MetaOmGraph) | ||
The final output file of this workflow, `results_TPM.tsv`, can be directly imported in MetaOmGraph together with the metadata file. | ||
|
||
|
||
|
||
## Running this example | ||
|
||
### Build the conda environment (optional) | ||
* Please have conda installed | ||
* Run `conda env create -f env.yaml` | ||
* Activate the environment: `conda activate pyrpipe_human` | ||
|
||
### Prepare reference data | ||
To install the reference data and build Salmon index, run [this file]() as | ||
|
||
`bash prepare_data.sh` | ||
|
||
### Execute using Nextflow | ||
|
||
`nextflow run run_quant.nf` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/usr/bin/env nextflow | ||
|
||
params.outdir = 'myout' | ||
params.infile='runids.txt' | ||
projectdir = projectDir | ||
|
||
srrids= new File("runids.txt").collect {it} | ||
//create a list of outfile paths | ||
def qflist = [] | ||
srrids.each { val -> qflist.add("$projectdir/$params.outdir/$val/salmon_out/quant.sf")} | ||
qflist.each { println it } | ||
|
||
process rnaseq { | ||
|
||
publishDir "$projectdir/$params.outdir" | ||
|
||
input: | ||
val srr from srrids | ||
output: | ||
file "${srr}*" into result | ||
|
||
script: | ||
""" | ||
#!/usr/bin/env python3 | ||
from pyrpipe import sra,mapping,quant | ||
salmon=quant.Salmon(index="$projectdir/human_data/salmon_index") | ||
thisid='${srr}' | ||
print('Processing:',thisid) | ||
sra.SRA(thisid).quant(salmon) | ||
""" | ||
} | ||
|
||
process merge { | ||
input: | ||
file("*") from result.collect() | ||
output: | ||
stdout res | ||
|
||
""" | ||
echo ${qflist} | ||
python ${projectdir}/scripts/merge.py ${qflist.join(",")} ${projectdir}/${params.outdir} | ||
""" | ||
} | ||
|
||
res.subscribe { println it } |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.