-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathIPR_reorder.pl
More file actions
executable file
·38 lines (34 loc) · 871 Bytes
/
IPR_reorder.pl
File metadata and controls
executable file
·38 lines (34 loc) · 871 Bytes
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
# Script: IPR_reorder.pl
# Description: Used in MG_HMM workflow
# Author: Steven Ahrendt
# email: [email protected]
# Date: 02.27.2014
##################################
use warnings;
use strict;
use Getopt::Long;
#####-----Global Variables-----#####
my $input;
my ($help,$verb);
GetOptions ('i|input=s' => \$input,
'h|help' => \$help,
'v|verbose' => \$verb);
my $usage = "Usage: IPR_reorder.pl -i input\nOutput to STDOUT\n";
die $usage if $help;
die "No input.\n$usage" if (!$input);
#####-----Main-----#####
open(IN,"<$input") or die "Can't open $input: $!\n";
while(my $line = <IN>)
{
chomp $line;
$line =~ s/^\s+//;
$line =~ s/\s+$//;
my ($count,$ID,$desc) = split(/\s+/,$line);
$ID = (split(/\./,$ID))[0];
print "$ID;$desc\t$count\n";
}
close(IN);
warn "Done.\n";
exit(0);
#####-----Subroutines-----#####