Created
February 2, 2020 07:27
-
-
Save niksmac/ac62768f0dec7a78ca03bd0d2b16ee39 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
cd /home/ubuntu/ | |
touch pipeline_trace.txt | |
sleep 5s | |
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 3s | |
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 --recursive | |
# Move graphs | |
sudo aws s3 cp . $out_directory --recursive --exclude "*" --include "*.png" | |
echo "files uploaded succesfully" | |
break | |
fi | |
done | |
sleep 6s | |
sudo poweroff |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment