BioPerl
view release on metacpan or search on metacpan
Bio/Assembly/Contig.pm view on Meta::CPAN
=cut
sub missing_char {
my ($self) = @_;
$self->throw_not_implemented();
}
=head2 match_char
Title : match_char
Usage : $contig->match_char('.')
Function : Gets/sets the match_char attribute of the alignment
Returns : An match_char string,
Argument : An match_char string (optional)
=cut
sub match_char {
my ($self) = @_;
$self->throw_not_implemented();
}
=head2 gap_char
Title : gap_char
Usage : $contig->gap_char('-')
Function : Gets/sets the gap_char attribute of the alignment
Returns : An gap_char string, defaults to '-'
Argument : An gap_char string (optional)
=cut
sub gap_char {
my ($self) = @_;
$self->throw_not_implemented();
}
=head2 symbol_chars
Title : symbol_chars
Usage : my @symbolchars = $contig->symbol_chars;
Function: Returns all the seen symbols (other than gaps)
Returns : array of characters that are the seen symbols
Argument: boolean to include the gap/missing/match characters
=cut
sub symbol_chars{
my ($self) = @_;
$self->throw_not_implemented();
}
=head2 Alignment descriptors
These read only methods describe the MSE in various ways.
=head2 consensus_string
Title : consensus_string
Usage : $str = $contig->consensus_string($threshold_percent)
Function : Makes a strict consensus
Returns :
Argument : Optional threshold ranging from 0 to 100.
The consensus residue has to appear at least threshold %
of the sequences at a given location, otherwise a '?'
character will be placed at that location.
(Default value = 0%)
=cut
sub consensus_string {
my ($self) = @_;
$self->throw_not_implemented();
}
=head2 consensus_iupac
Title : consensus_iupac
Usage : $str = $contig->consensus_iupac()
Function :
Makes a consensus using IUPAC ambiguity codes from DNA
and RNA. The output is in upper case except when gaps in
a column force output to be in lower case.
Note that if your alignment sequences contain a lot of
IUPAC ambiquity codes you often have to manually set
alphabet. Bio::PrimarySeq::_guess_type thinks they
indicate a protein sequence.
Returns : consensus string
Argument : none
Throws : on protein sequences
=cut
sub consensus_iupac {
my ($self) = @_;
$self->throw_not_implemented();
}
=head2 is_flush
Title : is_flush
Usage : if( $contig->is_flush() )
:
:
Function : Tells you whether the alignment
: is flush, ie all of the same length
:
:
Returns : 1 or 0
Argument :
=cut
sub is_flush {
my ($self) = @_;
$self->throw_not_implemented();
Bio/Assembly/Contig.pm view on Meta::CPAN
sub length {
my ($self) = @_;
$self->throw_not_implemented();
}
=head2 maxname_length
Title : maxname_length
Usage : $contig->maxname_length()
Function :
Gets the maximum length of the displayname in the
alignment. Used in writing out various MSE formats.
Returns : integer
Argument :
=cut
sub maxname_length {
my ($self) = @_;
$self->throw_not_implemented();
}
=head2 num_residues
Title : num_residues
Usage : $no = $contig->num_residues
Function : number of residues in total in the alignment
Returns : integer
Argument :
Note : replaces no_residues
=cut
sub num_residues {
my ($self) = @_;
return $self->{'_nof_residues'};
}
=head2 num_sequences
Title : num_sequences
Usage : $depth = $contig->num_sequences
Function : number of sequence in the sequence alignment
Returns : integer
Argument : None
Note : replaces no_sequences
=cut
sub num_sequences {
my ($self) = @_;
return scalar( keys %{ $self->{'_elem'} } );
}
=head2 percentage_identity
Title : percentage_identity
Usage : $id = $contig->percentage_identity
Function: The function calculates the percentage identity of the alignment
Returns : The percentage identity of the alignment (as defined by the
implementation)
Argument: None
=cut
sub percentage_identity{
my ($self) = @_;
$self->throw_not_implemented();
}
=head2 overall_percentage_identity
Title : percentage_identity
Usage : $id = $contig->percentage_identity
Function: The function calculates the percentage identity of
the conserved columns
Returns : The percentage identity of the conserved columns
Args : None
=cut
sub overall_percentage_identity{
my ($self) = @_;
$self->throw_not_implemented();
}
=head2 average_percentage_identity
Title : average_percentage_identity
Usage : $id = $contig->average_percentage_identity
Function: The function uses a fast method to calculate the average
percentage identity of the alignment
Returns : The average percentage identity of the alignment
Args : None
=cut
sub average_percentage_identity {
my ($self) = @_;
$self->throw_not_implemented();
}
=head2 Alignment positions
Methods to map a sequence position into an alignment column and back.
column_from_residue_number() does the former. The latter is really a
property of the sequence object and can done using
L<Bio::LocatableSeq::location_from_column>:
# select somehow a sequence from the alignment, e.g.
my $seq = $contig->get_seq_by_pos(1);
#$loc is undef or Bio::LocationI object
my $loc = $seq->location_from_column(5);
=head2 column_from_residue_number
Title : column_from_residue_number
Usage : $col = $contig->column_from_residue_number( $seqname, $resnumber)
Function:
This function gives the position in the alignment
(i.e. column number) of the given residue number in the
sequence with the given name. For example, for the
alignment
Seq1/91-97 AC..DEF.GH
Seq2/24-30 ACGG.RTY..
Seq3/43-51 AC.DDEFGHI
column_from_residue_number( "Seq1", 94 ) returns 5.
column_from_residue_number( "Seq2", 25 ) returns 2.
column_from_residue_number( "Seq3", 50 ) returns 9.
An exception is thrown if the residue number would lie
outside the length of the aligment
(e.g. column_from_residue_number( "Seq2", 22 )
Note: If the the parent sequence is represented by more than
one alignment sequence and the residue number is present in
them, this method finds only the first one.
Returns : A column number for the position in the alignment of the
given residue in the given sequence (1 = first column)
Args : A sequence id/name (not a name/start-end)
A residue number in the whole sequence (not just that
segment of it in the alignment)
=cut
sub column_from_residue_number {
my ($self) = @_;
$self->throw_not_implemented();
}
=head2 Sequence names
Methods to manipulate the display name. The default name based on the
( run in 1.644 second using v1.01-cache-2.11-cpan-39bf76dae61 )