Bio::EnsEMBL::Analysis::Tools MiniSeq
SummaryIncluded librariesPackage variablesSynopsisDescriptionGeneral documentationMethods
Toolbar
WebCvsRaw content
Summary
MiniSeq - an artificially constructed cDNA on a genomic sequence
Package variables
No package variables defined.
Included modules
Bio::EnsEMBL::Analysis::Tools::PairAlign
Bio::EnsEMBL::FeaturePair
Bio::EnsEMBL::Utils::Argument qw ( rearrange )
Bio::EnsEMBL::Utils::Exception qw ( throw warning stack_trace_dump verbose )
Bio::PrimarySeq
Inherit
Unavailable
Synopsis
This module is used when we only want to run an analysis over
a part or multiple parts of a sequence.
Description
Contains details of coordinates of all exons that make
up a gene transcript.
Creation:

my $mini = new Bio::EnsEMBL::Analysis::Tools::MiniSeq(-id => $id,
-pairaln => $pairaln);
   $pairaln is a Bio::EnsEMBL::Analysis::PairAlign object containing
one or more feature pairs that represent the mapping of
the genomic coords to the cDNA coords
Manipulation:
    my $align   = $mini->get_PairAlign;
my $cdnaseq = $mini->get_cDNA_sequence;
# We now do some analysis on the cdnaseq that puts sequence
# features on it. We don't want the coordsin the cDNA frame so
# we now pass them back to the miniseq to convert them into
# genomic coordinates.
    my  @newfeatures = $mini->convert_FeaturePairs(@featurepairs);
Methods
convert_FeaturePairDescriptionCode
convert_PepFeaturePairDescriptionCode
convert_SeqFeatureDescriptionCode
get_cDNA_sequenceDescriptionCode
idDescriptionCode
new
No description
Code
pairAlignDescriptionCode
Methods description
convert_FeaturePaircode    nextTop
 Title   : convert_FeaturePair
Usage : my @newfeatures = $self->convert_FeaturePairs($feature)
Function: Converts feature pair coordinates on the cDNA sequence
into an array of feature pairs on the genomic sequence
Example :
Returns : Bio::EnsEMBL::FeaturePair
Args : Array of Bio::EnsEMBL::FeaturePair
convert_PepFeaturePaircodeprevnextTop
 Title   : convert_PepFeaturePair
Usage : my @newfeatures = $self->convert_PepFeaturePair($feature)
Function: Converts feature pair coordinates on the cDNA sequence
into an array of feature pairs on the genomic sequence
Peptide coordinates are maintained.
Example :
Returns : Array of Bio::EnsEMBL::FeaturePair
Args : Bio::EnsEMBL::FeaturePair
convert_SeqFeaturecodeprevnextTop
 Title   : convert_FeaturePair
Usage : my @newfeatures = $self->convert_FeaturePairs($feature)
Function: Converts feature coordinates on the cDNA sequence
into an array of features on the genomic sequence
Example :
Returns : Bio::EnsEMBL::FeaturePair
Args : Array of Bio::EnsEMBL::FeaturePair
get_cDNA_sequencecodeprevnextTop
 Title   : get_cDNA_sequence
Usage : my $seq = $self->get_cDNA_sequence
Function: Returns the cdna sequence corresponding
to the cDNA in the pairAlign object
Example :
Returns : Bio::PrimarySeq
Args : none
idcodeprevnextTop
 Title   : id
Usage : $obj->id($newval)
Function:
Returns : value of id
Args : newvalue (optional)
pairAligncodeprevnextTop
 Title   : pairAlign
Usage : $self->pairAlign($pair)
Function: Get/set method for the pairalign object
that stores the cDNA-genomic exon mapping
Returns : Bio::EnsEMBL::Analysis::PairAlign
Args :
Methods code
convert_FeaturePairdescriptionprevnextTop
sub convert_FeaturePair {
    my ($self,$feature) = @_;

    my @newfeatures;

    my @tmp = @{$self->pairAlign->convert_FeaturePair($feature)};
    push(@newfeatures,@tmp);

    return\@ newfeatures;
}
convert_PepFeaturePairdescriptionprevnextTop
sub convert_PepFeaturePair {
    my ($self,$feature) = @_;

    my @newfeatures;

    my @tmp = @{$self->pairAlign->convert_FeaturePair($feature)};

    # replace protein coordinates
$tmp[0]->hstart($feature->hstart); $tmp[0]->hend($feature->hend); # SMJS strand of peptide should be positive?
$tmp[0]->hstrand(1); push(@newfeatures,@tmp); return\@ newfeatures; } 1;
}
convert_SeqFeaturedescriptionprevnextTop
sub convert_SeqFeature {
    my ($self,$feature) = @_;

    my @newfeatures;

    my @tmp = @{$self->pairAlign->convert_cDNA_feature($feature)};
    push(@newfeatures,@tmp);

    return\@ newfeatures;
}
get_cDNA_sequencedescriptionprevnextTop
sub get_cDNA_sequence {
  my ($self) = @_;

  my $seqstr = "";

  my @exons = @{$self->pairAlign->eachFeaturePair};
  return unless (scalar @exons > 0);

  foreach my $exon (@exons) {
    $seqstr .= $exon->seq;
  }
  return new Bio::PrimarySeq('-id' => "genomic" ,
                             -seq => $seqstr);
}
iddescriptionprevnextTop
sub id {
  my ($self,$arg) = @_;

  if(defined($arg)) {
    $self->{'_id'} = $arg;
  }

  return $self->{'_id'};
}
newdescriptionprevnextTop
sub new {
  my($class,@args) = @_;
  my $self = {};
  bless $self, $class;

  my ($id,$pairalign) = rearrange([qw(ID PAIRALIGN)],@args);
  verbose('warning');
  #No defaults
$self->id($id); $self->pairAlign($pairalign); throw("No input id for MiniSeq") unless($self->id); throw("No input pairalign for MiniSeq") unless($self->pairAlign); return $self;
}
pairAligndescriptionprevnextTop
sub pairAlign {
  my ($self,$pair) = @_;

  if ($pair) {
    if( ! $pair->isa("Bio::EnsEMBL::Analysis::Tools::PairAlign") ) {
      throw("$pair is not a Bio::EnsEMBL::Analysis::Tools::PairAlign!");
    }
    foreach my $p (@{$pair->eachFeaturePair}) {
      if ($p->strand != 1) {
        throw("Can't have a PairAlign object where the strand of the first ".
              "object is reversed");
      }
    }
    $self->{'_pair'} = $pair;
  }
  return $self->{'_pair'};
}
General documentation
CONTACTTop
Describe contact details here
APPENDIXTop
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _