-
Notifications
You must be signed in to change notification settings - Fork 5
/
step_2_fake_10X_data.sh
executable file
·61 lines (53 loc) · 2.08 KB
/
step_2_fake_10X_data.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
59
#!/bin/bash
#SCRIPT_PATH=`dirname $0`
source ./profile
BQT=$BARCODE_FREQ_THRESHOLD
echo "Check input files ..."
date
WL=`ls $SUPERNOVA/supernova-cs/*/tenkit/lib/python/tenkit/barcodes/4M-with-alts-february-2016.txt`
echo "10X whitelist in $WL"
if [[ ! -f $WL ]] ; then
echo "ERROR : no barcode white list found in $SUPERNOVA/supernova-cs/*/tenkit/lib/python/tenkit/barcodes/4M-with-alts-february-2016.txt"
echo "Exit ..."
exit 1
fi
if [[ $USE_FILTER == "yes" ]] ; then
if [[ ! -f $SPLIT.1.fq.gz.clean.gz || ! -f $SPLIT.1.fq.gz.clean.gz ]] ; then
echo "error : file $SPLIT.1.fq.gz.clean.gz or $SPLIT.2.fq.gz.clean.gz is not exsist !!! exit ..."
exit 1;
fi
if [[ ! -f $CLEAN_BARCODE_FREQ ]] ; then
echo "ERROR : file $CLEAN_BARCODE_FREQ is not exsist !!! Exit ..."
exit 1;
fi
else
if [[ ! -f $SPLIT.1.fq.gz || ! -f $SPLIT.1.fq.gz ]] ; then
echo "error : file $SPLIT.1.fq.gz or $SPLIT.2.fq.gz is not exsist !!! exit ..."
exit 1;
fi
if [[ ! -f $BARCODE_FREQ ]] ; then
echo "ERROR : file $BARCODE_FREQ is not exsist !!! Exit ..."
exit 1;
fi
fi
if [[ $USE_FILTER == "yes" ]] ; then
date
tag=`date +_%m_%d_%H_%M_%S`
echo "Generate $MERGE ..."
$SCRIPT_PATH/bin/merge_barcodes.pl $CLEAN_BARCODE_FREQ $WL $MERGE $BQT 1> merge_barcode_"$tag".log 2>merge_barcode_"$tag".err || exit 1
echo "Fake 10X data . this will take a long time ... "
date
tag=`date +_%m_%d_%H_%M_%S`
$SCRIPT_PATH/bin/fake_10x.pl $SPLIT.1.fq.gz.clean.gz $SPLIT.2.fq.gz.clean.gz $MERGE >fake_10X_"$tag".log 2>fake_10X_"$tag".err || exit 1
else
date
tag=`date +_%m_%d_%H_%M_%S`
echo "Generate $MERGE ..."
$SCRIPT_PATH/bin/merge_barcodes.pl $BARCODE_FREQ $WL $MERGE $BQT 1> merge_barcode_"$tag".log 2>merge_barcode_"$tag".err || exit 1
echo "Fake 10X data . this will take a long time ... "
date
tag=`date +_%m_%d_%H_%M_%S`
$SCRIPT_PATH/bin/fake_10x.pl $SPLIT.1.fq.gz $SPLIT.2.fq.gz $MERGE >fake_10X_"$tag".log 2>fake_10X_"$tag".err || exit 1
fi
echo "done step 2 ..."
date