Skip to content
Snippets Groups Projects
Commit 158a687e authored by Gervaise Henry's avatar Gervaise Henry :cowboy:
Browse files

Add scripts to run from study RID

parent 8dd59f38
Branches
Tags
2 merge requests!37v0.0.1,!36Metadata output update
Pipeline #7833 passed with stages
in 1 hour, 19 minutes, and 21 seconds
......@@ -297,6 +297,8 @@ timeline*.html*
*.tmp
*.swp
*.out
*_studyRID.json
*_studyRID.csv
run*.sh
!.gitkeep
......@@ -5,3 +5,5 @@ rm timeline*.html*
rm .nextflow*.log*
rm -r .nextflow/
rm -r work/
rm *_studyRID.json
rm *_studyRID.csv
#!/usr/bin/env python3
import argparse
import pandas as pd
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
def get_args():
parser = argparse.ArgumentParser()
parser.add_argument('-s', '--studyRID',help="The study RID.",required=True)
args = parser.parse_args()
return args
def main():
args = get_args()
studyRID=pd.read_json(args.studyRID+"_studyRID.json")
if studyRID["RID"].count() > 0:
studyRID["RID"].to_csv(args.studyRID+"_studyRID.csv",header=False,index=False)
else:
raise Exception("No associated replicates found: %s" %
studyRID)
if __name__ == '__main__':
main()
#!/bin/bash
# query GUDMAP/RBK for study RID
echo "curl --location --request GET 'https://www.gudmap.org/ermrest/catalog/2/entity/RNASeq:Replicate/Study_RID="${1}"'" | bash > $1_studyRID.json
# extract replicate RIDs
module load python/3.6.4-anaconda
python3 ./workflow/scripts/splitStudy.py -s $1
# run pipeline on replicate RIDs in parallel
module load nextflow/20.01.0
module load singularity/3.5.3
while read repRID; do echo ${repRID}; done < "$1_studyRID.csv" | xargs -P 5 -I {} nextflow run workflow/rna-seq.nf --repRID {}
# cleanup study RID files
rm $1_studyRID.json
rm $1_studyRID.csv
  • Run in repo root dir: sh workflow/scripts/splitStudy.sh [studyRID]

    It will run in parallel in batches of 5 replicatesRID (this can be changed in splitStudy.sh: xargs -P flag)

0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment