repo.or.cz
/
GalaxyCodeBases.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
new file: cell2loc.py
[GalaxyCodeBases.git]
/
perl
/
etc
/
WoodyMiaoLin
/
Tiger
/
StatisticWGS_SNP.pl
blob
9e0f06ee7d1391206b1f1ef8798a4b9510917d8b
1
#!/usr/bin/perl
2
use
strict
;
3
use
warnings
;
4
5
my
$SNP
=
0
;
6
while
(<>) {
7
next if
/^#/
;
8
chomp
;
9
my
@line
=
split
/\t/
;
10
next if
$line
[
7
] =~
/^INDEL/
;
11
next if
$line
[
5
] <
20
;
12
my
$a
=
0
;
13
my
@gt
;
14
foreach
(
9
.
.11
) {
15
my
@sample
=
split
/:/
,
$line
[
$_
];
16
if
(
$sample
[
4
] >=
20
and
$sample
[
2
] >=
1
) {
17
++
$a
;
18
push
@gt
,
$sample
[
0
];
19
}
else
{
20
next
;
21
}
22
}
23
next if
$a
<
2
;
24
my
%allele
;
25
foreach
(
@gt
) {
26
my
@a
=
split
/\/
/;
27
$allele
{
$a
[
0
]} =
1
;
28
$allele
{
$a
[
1
]} =
1
;
29
}
30
++
$SNP
if
(
keys
%allele
) >
1
;
31
}
32
print
"
$SNP
\n
"
;