-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathgetTM.pl
More file actions
executable file
·58 lines (51 loc) · 1.55 KB
/
getTM.pl
File metadata and controls
executable file
·58 lines (51 loc) · 1.55 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/perl
# Script: getTM.pl
# Description: Parses the 6-9 TM sequences from a TMHMM results file
# Author: Steven Ahrendt
# email: sahrendt0@gmail.com
# Date: 09.17.2014
##################################
use warnings;
use strict;
use Getopt::Long;
use lib '/rhome/sahrendt/Scripts';
#####-----Global Variables-----#####
my $input;
my ($help,$verb);
GetOptions ('i|input=s' => \$input,
'h|help' => \$help,
'v|verbose' => \$verb);
my $usage = "Usage: getTM.pl -i input\nParses the 6-9 TM sequences from a TMHMM results file\nCreates individual files for each architecture\n";
die $usage if $help;
die "No input.\n$usage" if (!$input);
#####-----Main-----#####
open(my $fh, "<", $input) or die "Can't open $input: $!\n";
my $filename = (split(/\./,$input))[0];
open(OUTALL,">","$filename\_all.accnos");
open(OUTSIX,">","$filename\_6.accnos");
open(OUTSEVEN,">","$filename\_7.accnos");
open(OUTEIGHT,">","$filename\_8.accnos");
open(OUTNINE,">","$filename\_9.accnos");
while(my $line = <$fh>)
{
chomp $line;
my($seq_id,$len,$expAA,$first60,$predHel,$topology) = split(/\t/,$line);
$predHel = (split(/=/,$predHel))[1];
if($predHel >= 6 && $predHel <= 9)
{
print OUTALL $seq_id,"\n";
print OUTSIX $seq_id,"\n" if($predHel == 6);
print OUTSEVEN $seq_id,"\n" if($predHel == 7);
print OUTEIGHT $seq_id,"\n" if($predHel == 8);
print OUTNINE $seq_id,"\n" if($predHel == 9);
}
}
close($fh);
close(OUTALL);
close(OUTSIX);
close(OUTSEVEN);
close(OUTEIGHT);
close(OUTNINE);
warn "Done.\n";
exit(0);
#####-----Subroutines-----#####