Skip to content
Snippets Groups Projects
Commit 96a62c84 authored by William McLaren's avatar William McLaren
Browse files

Fix to partial codon

parent 9fab6115
No related branches found
No related tags found
No related merge requests found
......@@ -327,20 +327,20 @@ sub type_variation {
my $start = $pep_coords[0]->start();
my $codon_cds_start = ($start * 3) - 2;
my $end = $pep_coords[0]->end();
my $last_codon_length = length($cds) - ($codon_cds_start - 1);
if($start <= length($cds)) {
my $test_seq = substr($cds, $codon_cds_start-1);
if(length($test_seq) < 3) {
$var->type("PARTIAL_CODON");
# add the CDS coords
$var->cds_start($cds_coords[0]->start + ($exon_phase > 0 ? $exon_phase : 0));
$var->cds_end($cds_coords[0]->end + ($exon_phase > 0 ? $exon_phase : 0));
if($last_codon_length < 3 && $last_codon_length >= 0) {
$var->type("PARTIAL_CODON");
return [$var];
}
# add the CDS coords
$var->cds_start($cds_coords[0]->start + ($exon_phase > 0 ? $exon_phase : 0));
$var->cds_end($cds_coords[0]->end + ($exon_phase > 0 ? $exon_phase : 0));
# add the cDNA coords
$var->cdna_start($cdna_coords[0]->start);
$var->cdna_end($cdna_coords[0]->end);
return [$var];
}
}
......
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