-
Notifications
You must be signed in to change notification settings - Fork 1
/
circtools_create_detect_files_paired.sh
executable file
·52 lines (40 loc) · 1.64 KB
/
circtools_create_detect_files_paired.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
#!/bin/bash
# @Author: Tobias Jakobi <tjakobi>
# @Email: tobias.jakobi@med.uni-heidelberg.de
# @Project: University Hospital Heidelberg, Section of Bioinformatics and Systems Cardiology
# @License: CC BY-NC-SA
#SBATCH -n 1
#SBATCH -N 1
#SBATCH -c 2
#SBATCH --mem=10G
#SBATCH -J "prepare-dcc"
#SBATCH --mail-type=END,FAIL,TIME_LIMIT_80
#SBATCH --mail-user=tobias.jakobi@med.uni-heidelberg.de
# check if we have 2 arguments
if [ ! $# == 2 ]; then
echo "Usage: $0 [STAR source dir] [DCC destination dir]"
exit
fi
SRC=${1}
DEST=${2}
if [ ! -d "$SRC" ]; then
echo "Source directory $SRC does not exist!"
exit;
fi
if [ ! -d "$DEST" ]; then
echo "DCC directory $DEST does not exist!"
exit;
fi
cd $SRC/
parallel ln -s `pwd`/{1}/mate{2}/Chimeric.out.junction ../$DEST/{1}.mate{2}.Chimeric.out.junction ::: * ::: 1 2
parallel ln -s `pwd`/{1}/mate{2}/Aligned.noS.bam ../$DEST/{1}.mate{2}.bam ::: * ::: 1 2
parallel ln -s `pwd`/{1}/mate{2}/Aligned.noS.bam.bai ../$DEST/{1}.mate{2}.bam.bai ::: * ::: 1 2
parallel ln -s `pwd`/{1}/Chimeric.out.junction ../$DEST/{1}.Chimeric.out.junction ::: *
parallel ln -s `pwd`/{1}/Aligned.noS.bam ../$DEST/{1}.bam ::: *
parallel ln -s `pwd`/{1}/Aligned.noS.bam.bai ../$DEST/{1}.bam.bai ::: *
parallel ln -s `pwd`/{1}/SJ.out.tab ../$DEST/{1}.SJ.out.tab ::: *
cd ..
ls $DEST/*.bam | grep bam | grep -v bai | grep -v mate | grep -v bam_files > $DEST/bam_files.txt
ls $DEST/*.junction | grep Chimeric.out.junction | grep mate1 | grep -v fixed > $DEST/mate1
ls $DEST/*.junction | grep Chimeric.out.junction | grep mate2 | grep -v fixed > $DEST/mate2
ls $DEST/*.junction | grep Chimeric.out.junction | grep -v mate > $DEST/samplesheet