Skip to content
Snippets Groups Projects
Commit a9f80e01 authored by Alessandro Vullo's avatar Alessandro Vullo
Browse files

Correct substringing CDS string

parent 09b3a039
No related branches found
No related tags found
No related merge requests found
......@@ -393,32 +393,29 @@ sub _check_start_and_stop {
return (0,0) unless defined $trans->translation;
my $tln = $trans->translation;
my $cds_seq = uc($trans->translateable_seq);
my $coding_start = $trans->cdna_coding_start;
my $coding_end = $trans->cdna_coding_end;
my $cds_seq = uc($trans->translateable_seq); # uc($trans->spliced_seq);
my $startseq = substr($cds_seq,$coding_start-1,3);
my $endseq = substr($cds_seq,$coding_end-3,3);
my $startseq = substr($cds_seq, 0, 3);
my $endseq = substr($cds_seq, -3);
my $has_start = 1;
my $has_end = 1;
# reimplemented because verterbrate specific
# $has_start = 0 if ($startseq ne "ATG");
# $has_end = 0 if ($endseq ne "TAG" && $endseq ne "TGA" && $endseq ne "TAA");
$has_start = 0 if ($startseq ne "ATG");
$has_end = 0 if ($endseq ne "TAG" && $endseq ne "TGA" && $endseq ne "TAA");
my ($attrib) = @{ $trans->slice()->get_all_Attributes('codon_table') };
# my ($attrib) = @{ $trans->slice()->get_all_Attributes('codon_table') };
my $codon_table_id;
$codon_table_id = $attrib->value()
if defined $attrib;
$codon_table_id ||= 1; # default vertebrate codon table
# my $codon_table_id;
# $codon_table_id = $attrib->value()
# if defined $attrib;
# $codon_table_id ||= 1; # default vertebrate codon table
my $codon_table = Bio::Tools::CodonTable->new( -id => $codon_table_id );
# my $codon_table = Bio::Tools::CodonTable->new( -id => $codon_table_id );
$has_start = 0 unless $codon_table->is_start_codon($startseq);
$has_end = 0 unless $codon_table->is_ter_codon($endseq);
# $has_start = 0 unless $codon_table->is_start_codon($startseq);
# $has_end = 0 unless $codon_table->is_ter_codon($endseq);
return ($has_start, $has_end);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment