Skip to content

Commit

Permalink
address #4 but needs refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
bretonics committed May 5, 2017
1 parent 19df9ca commit 7704ce0
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions Bioinformatics/Seq/Features.pm
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,11 @@ sub lookUpFeatures {
# Save features to file
sub _saveFeatures {
my ($seqObj) = @_;
my @tags = qw(gene inference start end product protein_id translation);
my $strain = $seqObj->display_id;
my $outFile = 'features_' . $strain . '.txt';
my @tags = qw(gene locus_tag inference start end product protein_id translation);
my $strain = $seqObj->display_id;
my $seq = $seqObj->seq;
my $molecule = $seqObj->molecule;
my $outFile = 'features_' . $strain . '.txt';
# $file =~ /(.+\/)?(.+)\..+/;
my $FH = getFH('>', $outFile);

Expand All @@ -130,6 +132,9 @@ sub _saveFeatures {
$feat->has_tag($tag) ? print $FH $feat->get_tag_values($tag), "\t" : print $FH " \t" ;
}
}
# Handle translation if not protein file
my $translation = _translate() if($molecule eq 'PRT');
print $FH $translation;
print $FH "\n"; # new line for each CDS
}
}
Expand All @@ -148,6 +153,12 @@ sub _printFeatures {
}
}

sub _translate {
my ($seq) = @_;
say($seq->translate($seq));
}


=head1 COPYRIGHT AND LICENSE
Andres Breton (C) 2017
Expand Down

0 comments on commit 7704ce0

Please sign in to comment.