-
Notifications
You must be signed in to change notification settings - Fork 1
/
fq2bfq.sh
executable file
·58 lines (39 loc) · 1.2 KB
/
fq2bfq.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/sh
#if [ $# -lt 1 ]; then
# echo Usage: $0 readDir
# exit
#fi
source ./initvars.sh
#maq='/mit/awcheng/Desktop/App/maq-0.6.7.roadrunner/maq';
#maq should be in PATH
maq='maq'
#readDir='/nfs/coldfact/awcheng/Bill/Blood/fastq';
#readDir=$1
#cd $readDir;
cd $fastqDir
#if [ -e $logDir/fq2bfq.std* ]; then
# rm $logDir/fq2bfq.std*
#fi
echo "" > $logDir/fq2bfq.stderr
echo "" > $logDir/fq2bfq.stdout
for i in *.fastq; do
#echo $i >> "sol2sanger.stderr";
#echo $i >> $logDir/
nonExtFileName=${i/.fastq/}
sampleName=$(getSampleName "$i") #${i/.fastq/}
echo "processing sample" $sampleName of file $i
echo $i for sample $sampleName >> $logDir/fq2bfq.stderr #"../bfq/fastq2bfq.stderr";
echo $i for sample $sampleName >> $logDir/fq2bfq.stdout #"../bfq/fastq2bfq.stdout";
#if [ -e ../bfq/$sampleName ]; then
# rm -R ../bfq/$sampleName
#fi;
if [ ! -d $bfqDir/$sampleName ]; then
mkdir $bfqDir/$sampleName
fi;
echo "now spliting $i"
split -l 8000000 $i $bfqDir/$sampleName/$nonExtFileName
for j in $bfqDir/$sampleName/${nonExtFileName}*; do
echo "converting $j to the binary format" as $j.bfq
$maq fastq2bfq $j $j.bfq >> $logDir/fq2bfq.stdout 2>> $logDir/fq2bfq.stderr
done;
done;