ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/gclib/scripts/mapdomaincoord.pl
Revision: 24
Committed: Tue Jul 26 21:46:39 2011 UTC (8 years, 1 month ago) by gpertea
File size: 707 byte(s)
Log Message:
Line File contents
1 #!/usr/bin/perl
2
3 ($proteinsearches,$protdom)=@ARGV;
4
5 open(F,$proteinsearches);
6 while(<F>) {
7 chomp;
8 @a=split;
9 $name=substr($a[0],1);
10 $beg{$name}=$a[1];
11 $end{$name}=$a[2];
12 <F>;
13 }
14 close(F);
15
16 open(F,$protdom);
17 while(<F>) {
18 chomp;
19 @a=split;
20 @b=split(/_/,$a[0]);
21 $newname=$b[0];
22 for($i=1;$i<$#b;$i++) {
23 $newname.="_".$b[$i];
24 }
25
26 if($beg{$a[0]}<$end{$a[0]}) {
27 $newbeg=$beg{$a[0]}+($a[1]-1)*3;
28 $newend=$beg{$a[0]}+($a[2]-1)*3+2;
29 }
30 else {
31 $newbeg=$beg{$a[0]}-($a[1]-1)*3;
32 $newend=$beg{$a[0]}-($a[2]-1)*3-2;
33 }
34 printf("%s %20d %10d %20s %5d %5d %5s %10s %s\n",$newname,$newbeg,$newend,$a[3],$a[4],$a[5],$a[6],$a[7],$a[8],$a[9]);
35 }
36 close(F);

Properties

Name Value
svn:executable *