File: dot2tab.pl

package info (click to toggle)
kissplice 2.6.7-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 16,752 kB
  • sloc: cpp: 8,783; python: 1,618; perl: 389; sh: 72; makefile: 18
file content (38 lines) | stat: -rw-r--r-- 767 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/perl -w


if(@ARGV !=3){
print "format:dot2tab.pl file1.txt file1_edges.txt file1_nodes_attributes.txt \n";
print "Please specify the names of the input and output files\n"; 
exit 1;
}

$infile=shift; 
$outfile1=shift;
$outfile2=shift;

open(IN, "$infile") || die "Cannot open: $!\n";

open(OUT, ">$outfile1") || die "Cannot open: $!\n";


open(OUT2, ">$outfile2") || die "Cannot open the file: $!\n";



while($line=<IN>){
chomp($line);

#3 -> 159919 [label="RF"];
if(($line=~m/^(\d+) -> (\d+) \[label=\"(\w+)\"\]/)){
#print $line;
print OUT "$1\t$2\t$3\n";
}


#191605 [label="AATCATTTCTAATATAGGTTTATTCCATACA / TGTATGGAATAAACCTATATTAGAAATGATT 12:0"];
if($line=~m/^(\d+) \[label=\"(\w+) \/ (\w+) (\d+):(\d+)\"\]/){
print OUT2 "$1\t$2\t$3\t$4\t$5\n";
}

}