Commit 141c021e authored by Venkat Malladi's avatar Venkat Malladi
Browse files

Merge conflict resolution

parents 5ec91353 80c522ff
...@@ -8,7 +8,7 @@ warnings.simplefilter(action='ignore', category=FutureWarning) ...@@ -8,7 +8,7 @@ warnings.simplefilter(action='ignore', category=FutureWarning)
def get_args(): def get_args():
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument('-s', '--studyRID', parser.add_argument('-f', '--file',
help="The study RID.", required=True) help="The study RID.", required=True)
args = parser.parse_args() args = parser.parse_args()
return args return args
...@@ -16,13 +16,13 @@ def get_args(): ...@@ -16,13 +16,13 @@ def get_args():
def main(): def main():
args = get_args() args = get_args()
studyRID = pd.read_json(args.studyRID+"_studyRID.json") RID = pd.read_json(args.file+".json")
if studyRID["RID"].count() > 0: if RID["RID"].count() > 0:
studyRID["RID"].to_csv( RID["RID"].to_csv(
args.studyRID+"_studyRID.csv", header=False, index=False) args.file+".csv", header=False, index=False, mode='a')
else: else:
raise Exception("No associated replicates found: %s" % raise Exception("No associated replicates found: %s" %
studyRID) RID)
if __name__ == '__main__': if __name__ == '__main__':
......
...@@ -37,19 +37,33 @@ main(){ ...@@ -37,19 +37,33 @@ main(){
shift $(($OPTIND -1)) shift $(($OPTIND -1))
# Check for mandatory options # Check for mandatory options
if [[ -z $rid ]] || [[ -z $tag ]] || [[ -z $email ]] || [[ -z $out ]]; then if [[ -z ${rid} ]] || [[ -z ${tag} ]] || [[ -z ${email} ]] || [[ -z ${out} ]]; then
usage usage
fi fi
# query GUDMAP/RBK for study RID # query GUDMAP/RBK study RID for experiment RIDs
echo "curl --location --request GET 'https://dev.gudmap.org/ermrest/catalog/2/entity/RNASeq:Replicate/Study_RID="${rid}"'" | bash > $rid\_studyRID.json echo "curl --location --request GET 'https://dev.gudmap.org/ermrest/catalog/2/entity/RNASeq:Experiment/Sequencing_Type=mRNA-Seq/Study_RID="${rid}"'" | bash > ${rid}\_experimentRIDs.json
# extract experiment RIDs
# extract replicate RIDs >${rid}\_experimentRIDs.csv
python3 ./scripts/extract_RIDs.py -f ${rid}\_experimentRIDs
python3 ./scripts/split_study.py -s $rid expRIDs=$(cat ${rid}\_experimentRIDs.csv)
> ${rid}\_studyRID.csv
for expRID in ${expRIDs}
do
# query GUDMAP/RBK experiment RIDs for replicate RIDs
> temp\_${expRID}\_repRIDs.json
echo "curl --location --request GET 'https://dev.gudmap.org/ermrest/catalog/2/entity/RNASeq:Replicate/Experiment_RID="${expRID}"'" | bash >> temp\_${expRID}\_repRIDs.json
# extract replicate RIDs
> temp\_${expRID}\_repRIDs.csv
python3 ./scripts/extract_RIDs.py -f temp\_${expRID}\_repRIDs
cat temp\_${expRID}\_repRIDs.csv >> ${rid}\_studyRID.csv
done
# cleanup study RID files # cleanup study RID files
rm $rid\_studyRID.json rm -f temp*
rm ${rid}\_experimentRIDs.json
rm ${rid}\_experimentRIDs.csv
# make dir for study # make dir for study
mkdir $out/$rid mkdir $out/$rid
...@@ -68,7 +82,7 @@ main(){ ...@@ -68,7 +82,7 @@ main(){
cd rna-seq cd rna-seq
# run pipeline on replicate RIDs in parallel # run pipeline on replicate RIDs in parallel
while read repRID; do echo ${repRID}; sleep 30; done < "../${rid}_studyRID.csv" | xargs -P 5 -I {} nextflow -q run workflow/rna-seq.nf --repRID {} --source dev --deriva /project/BICF/BICF_Core/shared/gudmap/test_data/auth/credential.json --bdbag /project/BICF/BICF_Core/shared/gudmap/test_data/auth/cookies.txt --dev false --upload true --email ${email} -with-report ./output/{}_report.html -with-timeline ./output/{}_timeline.html while read repRID; do echo ${repRID}; sleep 30; done < "../${rid}_studyRID.csv" | xargs -P 5 -I {} nextflow -q run workflow/rna-seq.nf --repRID {} --source dev --deriva /project/BICF/BICF_Core/shared/gudmap/test_data/auth/credential.json --bdbag /project/BICF/BICF_Core/shared/gudmap/test_data/auth/cookies.txt --dev false --upload true --track true --email ${email} -with-report ./output/{}_report.html -with-timeline ./output/{}_timeline.html
} }
......
Markdown is supported
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