forked from mandricigor/imrep
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathimrep.huge.sh
executable file
·45 lines (26 loc) · 902 Bytes
/
imrep.huge.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
##########################################################################################
#### This is the wrapper script for ImReP to handle huge fasta/fastq read files ####
##########################################################################################
inputfile=$1
nrchunks=$2
outputfile=$3
DATE=`date +%Y-%m-%d-%H-%M-%S`
tmpdir=/tmp/experiment-${DATE}
inputs=$tmpdir/inputs
outputs=$tmpdir/outputs
mkdir -p $tmpdir
mkdir -p $inputs
mkdir -p $outputs
prefix=$inputs/tmpfile
split -n $nrchunks -d -e $inputfile $prefix
for f in `ls $inputs`; do
echo "python imrep.py --noCast --fastq $inputs/$f $outputs/$f &" >> $tmpdir/runAll.sh
done
echo "wait" >> $tmpdir/runAll.sh
bash $tmpdir/runAll.sh > /dev/null
for f in `ls $outputs`; do
tail -n +2 $outputs/$f >> $tmpdir/merged.out
done
python cast.py $tmpdir/merged.out $outputfile
rm -rf $tmpdir
echo "DONE"