-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaccessTransition.pl
executable file
·58 lines (46 loc) · 1.22 KB
/
accessTransition.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
57
58
#!/usr/bin/perl
$/=undef;
#Author: Santhilal Subhash
#Contact: [email protected]
#script v1.2
open(IN,$ARGV[0]);
($inRef,$inAlt)=split(":",$ARGV[1]);
$FilterQual=$ARGV[2];
$inDP=$ARGV[3];
$strand=$ARGV[4];
$TCdp=$ARGV[5];
$file=<IN>;
@line=split("\n",$file);
foreach $line(@line)
{
if(!($line=~/#/))
{
($chr,$pos,$id,$ref,$alt,$qual,$filt,$info,$format,$sample)=split("\t",$line);
if($inRef ne $inAlt)
{
if($ref eq $inRef && $alt eq $inAlt && $qual>=$FilterQual)
{
($ns,$nsVal,$dp,$dpVal)=split(/[;=]/,$info);
($gt,$gq,$gl,$dp,$ra,$aa,$sr,$sa)=split(/[:]/,$sample);
($ref_dpF,$ref_dpR)=split(/[\|]/,$sr);
($alt_dpF,$alt_dpR)=split(/[\|]/,$sa);
$TotalDp=$ref_dpF+$ref_dpR+$alt_dpF+$alt_dpR;
$refVSalt=(($alt_dpF+$alt_dpR)/($TotalDp))*100;
if($strand eq "FR")
{
if($TotalDp>=$inDP && $alt_dpF>=$TCdp)
{
print "$chr\t$pos\t$ref\t$alt\t$ref_dpF\t$ref_dpR\t$alt_dpF\t$alt_dpR\t$TotalDp\t$refVSalt\n";
}
}
if($strand eq "RR")
{
if($TotalDp>=$inDP && $alt_dpR>=$TCdp)
{
print "$chr\t$pos\t$ref\t$alt\t$ref_dpF\t$ref_dpR\t$alt_dpF\t$alt_dpR\t$TotalDp\t$refVSalt\n";
}
}
}
}
}
}