forked from BGI-Qingdao/stlfr2supernova_pipeline
-
Notifications
You must be signed in to change notification settings - Fork 0
/
step_0_split_barode.sh
executable file
·37 lines (33 loc) · 966 Bytes
/
step_0_split_barode.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
#!/bin/bash
#SCRIPT_PATH=`dirname $0`
echo "check profile ... "
date
source ./profile
lane_num=`ls -all $r1 | wc -l`
lane2_num=`ls -all $r2 | wc -l`
if [[ $lane_num != $lane2_num ]] ; then
echo "ERROR : Profile error . please make sure all file is correct !!! "
exit 1
fi
echo "generate $R1 and $R2 ..."
date
if [[ $lane_num -lt 1 ]] ; then
echo "ERROR :File not exsit : $r1 . Exit ... "
exit 1
elif [[ $lane_num -eq 1 ]] ; then
echo "Only 1 lane detect in $r1 . "
ln -s $r1 $R1 ;
ln -s $r2 $R2 ;
else
echo "$lane_num lanes detect in $r1 . "
echo "Start cat all files into tmp_r1.fq.gz ... "
cat $r1 >$R1;
cat $r2 >$R2;
echo "Cat end ... "
fi
echo "split barcode ... "
date
tag=`date +_%m_%d_%H_%M_%S`
$SCRIPT_PATH/stLFR_barcode_split/split_barcode.pl $SCRIPT_PATH/stLFR_barcode_split/barcode_list.txt $R1 $R2 $SPLIT >split_barcode_"$tag".log 2>split_barcode_"$tag".err|| exit 1
echo "done step 0 ..."
date