Skip to content

Commit

Permalink
Merge branch 'hotfix/v2.1.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
keiranmraine committed Mar 4, 2016
2 parents a93df3b + e4bd724 commit 14c2549
Show file tree
Hide file tree
Showing 16 changed files with 307 additions and 391 deletions.
57 changes: 0 additions & 57 deletions MYMETA.json

This file was deleted.

38 changes: 0 additions & 38 deletions MYMETA.yml

This file was deleted.

Binary file modified docs.tar.gz
Binary file not shown.
12 changes: 6 additions & 6 deletions lib/Sanger/CGP/Vagrent.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@ package Sanger::CGP::Vagrent;

##########LICENCE##########
# Copyright (c) 2014 Genome Research Ltd.
#
#
# Author: Cancer Genome Project [email protected]
#
#
# This file is part of VAGrENT.
#
#
# VAGrENT is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation; either version 3 of the License, or (at your option) any
# later version.
#
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
# details.
#
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
##########LICENCE##########
Expand All @@ -26,7 +26,7 @@ use strict;
use Const::Fast qw(const);

use base 'Exporter';
our $VERSION = '2.1.2';
our $VERSION = '2.1.3';
our @EXPORT = qw($VERSION);

1;
64 changes: 34 additions & 30 deletions lib/Sanger/CGP/Vagrent/Annotators/AbstractAnnotator.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@ package Sanger::CGP::Vagrent::Annotators::AbstractAnnotator;

##########LICENCE##########
# Copyright (c) 2014 Genome Research Ltd.
#
#
# Author: Cancer Genome Project [email protected]
#
#
# This file is part of VAGrENT.
#
#
# VAGrENT is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation; either version 3 of the License, or (at your option) any
# later version.
#
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
# details.
#
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
##########LICENCE##########
Expand All @@ -28,6 +28,7 @@ use Log::Log4perl;
use POSIX qw(ceil);
use Data::Dumper;
use Attribute::Abstract;
use Const::Fast qw(const);

use Sanger::CGP::Vagrent qw($VERSION);

Expand All @@ -38,20 +39,19 @@ use base qw(Sanger::CGP::Vagrent::Ontology::SequenceOntologyClassifier);

my $log = Log::Log4perl->get_logger(__PACKAGE__);


1;

# constant reference values for consensus splice site values.
use constant CONSENSUS_SPLICE_OFFSETS => (-2, -1, 1, 2, 5);
use constant CONSENSUS_SPLICE_BEFORE_BOUNDRY => -2;
use constant CONSENSUS_SPLICE_AFTER_BOUNDRY => 5;
const my @CONSENSUS_SPLICE_OFFSETS => (-2, -1, 1, 2, 5);
const my $CONSENSUS_SPLICE_BEFORE_BOUNDRY => -2;
const my $CONSENSUS_SPLICE_AFTER_BOUNDRY => 5;

# constant value representing the cutoff for intronic calls
use constant INTRONIC_OFFSET_CUTOFF => 11;
const my $INTRONIC_OFFSET_CUTOFF => 11;

use constant UPDOWNSTREAM_5KB_CUTOFF => 5000;
use constant UPSTREAM_2KB_CUTOFF => -2000;
use constant DOWNSTREAM_500BP_CUTOFF => 500;
const my $UPDOWNSTREAM_5KB_CUTOFF => 5000;
const my $UPSTREAM_2KB_CUTOFF => -2000;
const my $DOWNSTREAM_500BP_CUTOFF => 500;

1;

sub new {
my $proto = shift;
Expand All @@ -63,6 +63,10 @@ sub new {
return $self;
}

sub getConsensusSpliceOffsets {
return @CONSENSUS_SPLICE_OFFSETS;
}

sub getAnnotation {
my ($self,$var) = @_;
my @ann = $self->_getAnnotation($var);
Expand Down Expand Up @@ -462,7 +466,7 @@ sub _buildProteinAnnotation {
# something has gone wrong
return undef;
}

my $mtDna = $self->_getMutatedCdsSequence($wtDna,$cdsMinPos,$cdsMaxPos,$cAnnot->getMt());
my $mtProt = Bio::Seq->new(-seq => $prePad . $mtDna . $postPad)->translate->seq(); # mutant protein sequence
my $maxMtProt = Bio::Seq->new(-seq => $prePad . $mtDna . substr($tran->getcDNASeq,$tran->getCdsMaxPos()))->translate->seq(); # maximised protein sequence, overruns the natural stop and translates to the end of the transcript
Expand Down Expand Up @@ -513,7 +517,7 @@ sub _buildProteinAnnotation {
substr($wt,-1,1,'');
substr($mt,-1,1,'');
}

#warn "|$wt| to |$mt|\n";
if($wt ne ''){
# wild type residue has been changed
Expand Down Expand Up @@ -843,7 +847,7 @@ sub _buildUnknownMRNAAnnotation {

sub _isOffsetAConsensusSpliceDistance {
my ($self,$offset) = @_;
foreach my $cf($self->CONSENSUS_SPLICE_OFFSETS){
foreach my $cf(@CONSENSUS_SPLICE_OFFSETS){
if($offset == $cf){
return 1;
}
Expand All @@ -852,40 +856,40 @@ sub _isOffsetAConsensusSpliceDistance {
}

sub _getConsesnsusSpliceBeforeBoundry {
return CONSENSUS_SPLICE_BEFORE_BOUNDRY;
return $CONSENSUS_SPLICE_BEFORE_BOUNDRY;
}

sub _getConsesnsusSpliceAfterBoundry {
return CONSENSUS_SPLICE_AFTER_BOUNDRY;
return $CONSENSUS_SPLICE_AFTER_BOUNDRY;
}

sub _isIntronicOffsetDistance {
my ($self,$offset) = @_;
if(abs($offset) >= $self->INTRONIC_OFFSET_CUTOFF){
if(abs($offset) >= $INTRONIC_OFFSET_CUTOFF){
return 1;
}
return 0;
}

sub _isWithin5KBOffsetDistance {
my ($self,$offset) = @_;
if(abs($offset) <= $self->UPDOWNSTREAM_5KB_CUTOFF){
if(abs($offset) <= $UPDOWNSTREAM_5KB_CUTOFF){
return 1;
}
return 0;
}

sub _isWithin2KBUpstreamOffsetDistance {
my ($self,$offset) = @_;
if($offset < 0 && $offset >= $self->UPSTREAM_2KB_CUTOFF){
if($offset < 0 && $offset >= $UPSTREAM_2KB_CUTOFF){
return 1;
}
return 0;
}

sub _isWithin500BPDownstreamOffsetDistance {
my ($self,$offset) = @_;
if($offset > 0 && $offset <= $self->DOWNSTREAM_500BP_CUTOFF){
if($offset > 0 && $offset <= $DOWNSTREAM_500BP_CUTOFF){
return 1;
}
return 0;
Expand All @@ -897,7 +901,7 @@ sub _coversStartCodon {
# if the transcript isn't protein coding it can't have a start codon
return 0;
}

my ($startMin,$startMax);
if($anno->getContext eq Sanger::CGP::Vagrent::Data::Annotation::getmRNAAnnotationContext()){
$startMin = $tran->getCdsMinPos;
Expand All @@ -909,7 +913,7 @@ sub _coversStartCodon {
# don't know, assume no
return 0;
}

if($anno->hasClassification($self->getInsertionClass)){
# insertions are a special case, coordinates are outside the variant
if($anno->getMinPos < $startMax && $anno->getMaxPos > $startMin){
Expand Down Expand Up @@ -944,7 +948,7 @@ sub _coversStopCodon {
# don't know, assume no
return 0;
}

if($anno->hasClassification($self->getInsertionClass)){
# insertions are a special case, coordinates are outside the variant
if($anno->getMinPos < $stopMax && $anno->getMaxPos > $stopMin){
Expand Down Expand Up @@ -1010,10 +1014,10 @@ sub _canAnnotateToCDS {
if($anno->hasClassification($self->getInsertionClass)){
# insertions are a special case.
# Coordinates are the last WT positions, and not the first variant ones like everything else

print 'ANNO POS: '.$anno->getMinPos.' , '.$anno->getMinOffset.' - '.$anno->getMaxPos.' , '.$anno->getMaxOffset."\n" if $self->_debug();
print 'CDS POS: '.$tran->getCdsMinPos.' , '.$tran->getCdsMaxPos."\n" if $self->_debug();

if($anno->getMaxPos < $tran->getCdsMinPos || $anno->getMinPos > $tran->getCdsMaxPos){
# ends before CDS or starts afterwards
return 0;
Expand Down Expand Up @@ -1051,7 +1055,7 @@ sub _canAnnotateToCDS {
} elsif($anno->hasClassification($self->getUnknownVariantClass)){
return 0;
} elsif($anno->hasClassification($self->getInsertionClass) && $anno->hasClassification($self->get5PrimeUtrVariantClass)){
# odd case, insertions close to the start codons can be described on the CDS even though they don't change it.
# odd case, insertions close to the start codons can be described on the CDS even though they don't change it.
return 1;
} else {
my $msg = "Unable to calculate CDS relevance - UNKNOWN CLASSIFICATION: ".join(' ',$anno->getClassifications);
Expand Down
Loading

0 comments on commit 14c2549

Please sign in to comment.