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
/
justonce
/
sperm
/
cntsnpns.pl
blob
00b17761470af44176fb26d4ca0349558f7d326e
1
#!/usr/bin/env perl
2
use
strict
;
3
use
warnings
;
4
5
die
"Usage:
$0
<stat.txt> <flag>
\n
"
if
@ARGV
<
2
;
6
my
(
$inf
,
$flag
)=
@ARGV
;
7
8
my
$sum
=
0
;
9
10
open
I
,
'<'
,
$inf
or die
$!;
11
while
(<
I
>) {
12
next if
/\[/
;
13
chomp
;
14
my
@a
=
split
/\t/
;
15
if
( (
$a
[
2
] &
$flag
)==
$flag
) {
16
$sum
+=
$a
[
1
];
17
print join
(
"
\t
"
,
$a
[
0
],
$a
[
2
],
$a
[
1
],
$sum
),
"
\n
"
;
18
}
19
}
20
close
I
;
21
my
$v
=
sprintf
(
"
%b
"
,
$flag
);
22
print
"Sum[${v}] =
$sum
\n
"
;