Created
February 2, 2020 06:15
-
-
Save niksmac/0e07a9b5b0426443113897ddd0dffaac to your computer and use it in GitHub Desktop.
This file contains hidden or 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 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 | |
# Move graphs | |
sudo aws s3 cp /home/ubuntu/man-gwas.png `$out_directory`/man-gwas.png | |
sudo aws s3 cp /home/ubuntu/pca-gwas.png `$out_directory`/pca-gwas.png | |
sudo aws s3 cp /home/ubuntu/qq-gwas.png `$out_directory`/qq-gwas.png | |
echo "files uploaded succesfully" | |
break | |
fi | |
done | |
sleep 10s | |
sudo poweroff |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment