File: eiprscan-sort.pl

package info (click to toggle)
emboss 6.6.0%2Bdfsg-12
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 571,584 kB
  • sloc: ansic: 460,579; java: 29,383; perl: 13,573; sh: 12,753; makefile: 3,294; csh: 706; asm: 351; xml: 239; pascal: 237; modula3: 8
file content (30 lines) | stat: -rwxr-xr-x 659 bytes parent folder | download | duplicates (9)
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
#!/usr/bin/perl -w

$filename = shift @ARGV;

open (IN, $filename) || die "failed to open '$filename'";

@outfields = ("BlastProDom", "Coil", "Gene3D", "HMMPanther",
	      "HMMPfam", "HMMSmart", "HMMTigr", "FPrintScan", "ScanRegExp",
	      "ProfileScan", "superfamily", "Seg", "SignalP", "TmHmm");

while (<IN>) {
    @fields = split (/\t/);
    $text{$fields[3]} .= $_;
}
close IN;

open (OUT, ">$filename")  || die "failed to open '$filename'";
foreach $f (@outfields) {
    if(defined($text{$f})) {
	print OUT "$text{$f}";
    }
    $text{$f} = "";
}

foreach $f (sort(keys(%text))) {
    if($text{$f} ne "") {
	print OUT "$text{$f}";
    }
}
close OUT;