Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated cdd2cog.pl to work with 2014 version of COG #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions cdd2cog/cdd2cog.pl
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ =head1 LICENSE
}
$Skip = $line[0];

my $pssm_id = $1 if $line[1] =~ /^CDD\:(\d+)/; # get PSSM-Id from the subject hit
my $pssm_id = $1 if $line[1] =~ /^gnl\|CDD\|(\d+)/; # get PSSM-Id from the subject hit
my $cog = $CDDid{$pssm_id}; # get the COG# according to the PSSM-Id as listed in 'cddid.tbl'
$Cog_Stats{$cog}++; # increment hit-number for specific COG

Expand Down Expand Up @@ -388,7 +388,7 @@ sub parse_cdd_cog {
while (<$fun_fh>) {
chomp;
$_ =~ s/^\s*|\s+$//g; # get rid of all leading and trailing whitespaces
if (/^\[(\w)\]\s*(.+)$/) {
if (/^(\w)\s*(.+)$/) {
$Fun{$1} = {'desc' => $2, 'count' => 0}; # anonymous hash in hash
# $1 = single-letter functional category, $2 = description of functional category
# count used to find functional categories not present in the query proteins for final overall assignment statistics
Expand All @@ -400,13 +400,15 @@ sub parse_cdd_cog {
open (my $whog_fh, "<", "$Whog_File");
print "Parsing COGs '$Whog_File' file ...\n"; # status message
while (<$whog_fh>) {
if (/^#/) { # skip header line
next;
}
chomp;
$_ =~ s/^\s*|\s+$//g; # get rid of all leading and trailing whitespaces
if (/^\[(\w+)\]\s*(COG\d{4})\s+(.+)$/) {
$Whog{$2} = {'function' => $1, 'desc' => $3}; # anonymous hash in hash
# $1 = single-letter functional categories, maximal five per COG (only COG5032 with five)
# $2 = COG#, $3 = COG protein description
}
my @line = split(/\t/, $_); # split tab-separated cognames
$Whog{$line[0]} = {'function' => $line[1], 'desc' => $line[2]}; # anonymous hash in hash
# $2 = single-letter functional categories, maximal five per COG (only COG5032 with five)
# $1 = COG#, $3 = COG protein description
}
close $whog_fh;

Expand Down