Created
October 25, 2016 21:58
-
-
Save ShaiberAlon/958650dd8b4a026a6f6e5c4f64905020 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 | |
set -e | |
DIR=Metaphlan_output | |
job=Metaphlan_Primates | |
email=alon.shaiber@gmail.com | |
WAIT () { | |
python /workspace/meren/wait_for_cluster.py $1 | |
} | |
LOG () { | |
msg="[`date`] $1" | |
echo $msg >> $job-log.txt | |
echo $msg | mail -s "Update on $job" $email | |
} | |
CALL_MET () { | |
sample=$1 | |
R1=$2 | |
R2=$3 | |
clusterize -log $DIR/$sample\_metaphlan_profile.txt metaphlan2.py $R1,$R2 --bowtie2out $DIR/$sample\_bowtie2.bz2 --nproc 5 --input_type fastq | |
} | |
LOG Hi! | |
LOG `echo $mpa_dir` | |
while read sample R1 R2;do | |
if [ "$sample" == "sample" ]; then continue; fi | |
CALL_MET $sample $R1 $R2 | |
done < samples.txt | |
WAIT metaphlan2.py | |
LOG "All done!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment