Skip to content

Commit

Permalink
start addressing #4
Browse files Browse the repository at this point in the history
Sequence for feature can be obtained but may need to make BioSeq object,
otherwise, using direct translation does not account for frame, etc..
  • Loading branch information
bretonics committed May 9, 2017
1 parent 8cd7ea4 commit 55888e3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Bioinformatics/Seq/Features.pm
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ sub _saveFeatures {
my ($seqObj) = @_;
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 @@ -128,8 +127,10 @@ sub _saveFeatures {
my $primaryTag = $feat->primary_tag;

if ($primaryTag eq 'CDS') {
my $strand = $feat->strand;
# my $seq = $feat->seq->seq;
my $strand = $feat->strand;
$strand == 1 ? $strand = '+' : $strand = '-';

print $FH "$strain\t$strand\t";

for my $tag (@tags) {
Expand All @@ -142,7 +143,7 @@ sub _saveFeatures {
}
}
# Handle translation if not protein file
print $FH $seq->translate($seq) if($molecule eq 'PRT');
# print $FH translate($seq) if($molecule eq 'DNA');
print $FH "\n"; # new line for each CDS
}
}
Expand Down

0 comments on commit 55888e3

Please sign in to comment.