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
modified: Makefile
[GalaxyCodeBases.git]
/
perl
/
etc
/
WoodyMiaoLin
/
PbeBefore2015
/
make_input.pl
blob
2c457fb7ab10470c55c4e706a26d14f374b616b3
1
#!/usr/bin/perl
2
use
strict
;
3
use
warnings
;
4
5
open
I
,
"<"
,
"Origin_STR_SNP_All.txt"
;
6
open
O1
,
">"
,
"Origin_STR_SNP_All_12loci.txt"
;
7
open
O2
,
">"
,
"StructureInput.txt"
;
8
9
my
$a
= <
I
>;
10
$a
=~
s/\r//
;
11
print
O1
$a
;
12
while
(<
I
>) {
13
s/\r\n//
;
14
my
@a
=
split
/\t/
;
15
splice
@a
,
0
,
3
;
16
my
$n
=
0
;
17
foreach
(
0
..
33
) {
18
++
$n
if
(
int
(
$_
/2) == $_/
2
)
and
$a
[
$_
];
19
if
(
$_
>=
20
and
$_
<=
29
) {
20
$a
[
$_
] =~
s/^1//
;
21
}
22
}
23
if
(
$n
>=
12
) {
24
print
O1
"
$_
\n
"
;
25
print
O2
join
(
"
\t
"
,
@a
),
"
\n
"
;
26
}
27
}
28
close
I
;
29
close
O1
;
30
close
O2
;