Skip to content

Instantly share code, notes, and snippets.

@niksmac
Created February 2, 2020 05:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save niksmac/6599a8c0f6934396872a679c0993f367 to your computer and use it in GitHub Desktop.
Save niksmac/6599a8c0f6934396872a679c0993f367 to your computer and use it in GitHub Desktop.
#!/bin/bash
cd /home/ubuntu/
touch pipeline_trace.txt
sleep 15s
node /home/ubuntu/clpush/index.js &
while true;
do
input_directory=`cat inputpath.txt`
w=`cat wpath.txt`
out_directory=`cat outpath.txt`
sleep 2s
echo "$input_directory"
if [ $input_directory ] && [ $w ] && [ $out_directory ]
then
sleep 1s
cd /home/ubuntu
sudo aws s3 cp $input_directory .
sleep 5s
sudo nextflow run https://github.com/OmixPlatform/GWASpipe -c multidocker_qc.config -r ee3cc42c3888c5e1540266029256e5b7f35b310e --vcf_file ./vcf_samples.csv --pheno SMOKER --covariates AGE,SEX
sudo nextflow run h3abionet/h3agwas/plink-assoc.nf -c nextflow_gwas.config --pheno SEX --data results/sample.phe --input_pat results --input_dir ./results --assoc 1 --covariate PAT,MAT --freq
sudo cp /home/ubuntu/results/assoc/SEX.assoc /home/ubuntu/gwas_asscoc.assoc
# sudo nextflow run h3abionet/h3agwas/qc.nf --input_pat sampleA --input_dir ./sample/
sleep 2s
echo "Generating graphs"
echo "# 1. Convert assoc to csv"
python3 convert-to-csv.py gwas_asscoc.assoc gwas_assoc.csv
sleep 1s
## 2. Create graphs
echo "second graph"
python3 generate-graph-manhatten.py full-gwas_assoc.csv gwas.png
python3 generate-pca.py cleaned.eigenvec gwas.png
sleep 1s
# Move files to s3
sudo aws s3 cp /home/ubuntu/results $out_directory --recursive
# Move logs to s3
sudo aws s3 cp pipeline_trace.txt $out_directory --recursive
# nextlfow log s3
sudo aws s3 cp qc_pipeline_trace.csv $out_directory --recursive
# .nextflow.log
sudo aws s3 cp nextflow.log $out_directory
echo "files uploaded succesfully"
break
fi
done
sleep 10s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment