-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcircexplorer1_starter_1.pl
executable file
·56 lines (43 loc) · 1.82 KB
/
circexplorer1_starter_1.pl
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
#/usr/bin/perl -w
use strict;
# starting vars
my$currdir=`pwd`;
my$starttime= time;
open(ER,'>>',"/home/daniel/logfile_auto.log")||die "$!"; # global logfile
chdir "/media/daniel/NGS1/RNASeq/find_circ/circexplorer/CIRCexplorer/";
`rm Chimeric.out.junction`;
`rm fusion_junction.txt`;
# first get reference place for hg19
my$bowtwiindexplace="/media/daniel/NGS1/RNASeq/find_circ/circexplorer/CIRCexplorer/";
# change to reference place for execution
if(!($currdir eq $bowtwiindexplace)){
chdir $bowtwiindexplace;
}
# two read lanes, one sample name for first layer of automation
my$infile1=$ARGV[0];
chomp $infile1;
my$infile2=$ARGV[1];
chomp $infile2;
my$samplename=$ARGV[2];
chomp $samplename;
# if dir changes during chdir, then append old dir onto filename to preserve path
my$fullfileone="$infile1";
my$fullfiletwo="$infile2";
print ER "-\nsample $samplename processing:\n";
#### start of circexplorer1
mkdir "run_$samplename";
# make dir, move files there, one dir per sample per group
# about 30 min in single core
my$tophatout=`STAR --chimSegmentMin 10 --runThreadN 10 --genomeDir . --readFilesIn ../../$fullfileone ../../$fullfiletwo --limitBAMsortRAM 512000000000`;
# creates auto_$samplename dir in test/
print ER "errors during STAR alignment:\n $tophatout\n";
my$btofq= `star_parse.py Chimeric.out.junction fusion_junction.txt`;
print ER "errors converting:\n $btofq\n";
`mv Chimeric.out.junction run_$samplename/`;
my$tophattwoout=`CIRCexplorer.py -j fusion_junction.txt -g hg19.fa -r hg19_ref.txt`;
# now move all files into dir?
`mv CIRCexplorer_circ.txt run_$samplename/`;
my$fulltime=((time - $starttime)/60);
print ER "############################################################\nsample $samplename done :\n";
print ER "errors running circexplorer1:\n$tophattwoout\n";
print ER "done processing $samplename in $fulltime minutes \n";