Skip to content

Commit 6c57921

Browse files
committed
add missing CENPK 100K simulation script
Previous commit missing this straggling PBS script for running StrainID on CENPK data at at depth of 100K.
1 parent 0da7836 commit 6c57921

1 file changed

Lines changed: 68 additions & 0 deletions

File tree

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
#!/bin/bash
2+
#PBS -l nodes=1:ppn=6
3+
#PBS -l pmem=24gb
4+
#PBS -l walltime=00:05:00
5+
#PBS -A open
6+
#PBS -o logs/depth.sid.CENPK.100K.log.out
7+
#PBS -e logs/depth.sid.CENPK.100K.log.err
8+
#PBS -t 1-1000
9+
10+
module load gcc/8.3.1
11+
module load bedtools/2.27.1
12+
module load bwa/0.7.15
13+
module load samtools/1.5
14+
module load anaconda3
15+
source activate genopipe
16+
17+
# FIRST CHANGE PATH TO EXECUTE
18+
WRK=/path/to/GenoPipe/paper/SyntheticStrain
19+
cd $WRK
20+
21+
INFO=`sed "3q;d" depth_simulations.txt`
22+
LOCUS=`awk '{print $1}' <(echo $INFO)`
23+
DEPTH=`awk '{print $2}' <(echo $INFO)`
24+
BASE=`awk '{print $3}' <(echo $INFO)`
25+
26+
REF=`echo $LOCUS | awk -F'_' '{print $1}'`
27+
SEED=$(($BASE+$PBS_ARRAYID))
28+
29+
OUTPUT=$WRK/results/$LOCUS\_$DEPTH
30+
BAM=$WRK/results/$LOCUS\_$DEPTH/BAM/Simulation_$PBS_ARRAYID.bam
31+
TEMP=$WRK/temp3-$PBS_ARRAYID
32+
33+
[ -d $OUTPUT/ID ] || mkdir $OUTPUT/ID
34+
[ -d logs ] || mkdir logs
35+
[ -d $TEMP ] || mkdir $TEMP
36+
37+
#Check that BAM file was generated first
38+
if [ ! -f $BAM ];
39+
then
40+
echo "BAM input for ${LOCUS}_${DEPTH}_${PBS_ARRAYID} does not exist. Exiting."
41+
exit
42+
fi
43+
#Check that BAM Index file exists
44+
if [ ! -f $BAM.bai ];
45+
then
46+
echo "BAI missing for for ${LOCUS}_${DEPTH}_${PBS_ARRAYID}. Exiting."
47+
exit
48+
fi
49+
50+
# Set-up Temp directory
51+
cd $TEMP
52+
echo $BAM
53+
ln -s $BAM
54+
ln -s $BAM.bai
55+
56+
GENOME=$WRK/../input/$REF.fa
57+
DATABASE=$WRK/../db/$REF\_VCF
58+
GENOPIPE=$WRK/../..
59+
60+
## Execute Single StrainID and record time
61+
cd $GENOPIPE/StrainID
62+
echo "**Begin executing StrainID for ${LOCUS}_${DEPTH}..."
63+
{ time bash identify-Strain.sh -i $TEMP -g $GENOME -v $DATABASE -o $OUTPUT/ID -s $SEED > $OUTPUT/ID/Simulation_$PBS_ARRAYID.std ; } 2> $OUTPUT/ID/Simulation_$PBS_ARRAYID.time
64+
echo "...single StrainID for ${LOCUS} ${DEPTH} finished."
65+
cd $WRK
66+
67+
## Clean-up
68+
rm -r $TEMP

0 commit comments

Comments
 (0)