NAME
Bio::SimpleAlign - Multiple alignments held as a set of sequences
SYNOPSIS
# Use Bio::AlignIO to read in the alignment$str = Bio::AlignIO->new(-file => 't/data/testaln.pfam');$aln = $str->next_aln();# Describeprint $aln->length;print $aln->num_residues;print $aln->is_flush;print $aln->num_sequences;print $aln->score;print $aln->percentage_identity;print $aln->consensus_string(50);# Find the position in the alignment for a sequence location$pos = $aln->column_from_residue_number('1433_LYCES', 14); # = 6;# Extract sequences and check values for the alignment column $posforeach $seq ($aln->each_seq) {$res = $seq->subseq($pos, $pos);$count{$res}++;}foreach $res (keys %count) {printf "Res: %s Count: %2d\n", $res, $count{$res};}# Manipulate$aln->remove_seq($seq);$mini_aln = $aln->slice(20,30); # get a block of columns$mini_aln = $aln->select_noncont(1,3,5,7,11); # select certain sequences$new_aln = $aln->remove_columns([20,30]); # remove by position$new_aln = $aln->remove_columns(['mismatch']); # remove by property# Analyze$str = $aln->consensus_string($threshold_percent);$str = $aln->match_line();$str = $aln->cigar_line();$id = $aln->percentage_identity;# See the module documentation for details and more methods.
DESCRIPTION
SimpleAlign is an object that handles a multiple sequence alignment (MSA). It is very permissive of types (it does not insist on sequences being all same length, for example). Think of it as a set of sequences with a whole series of built-in manipulations and methods for reading and writing alignments.
SimpleAlign uses Bio::LocatableSeq, a subclass of Bio::PrimarySeq, to store its sequences. These are subsequences with a start and end positions in the parent reference sequence. Each sequence in the SimpleAlign object is a Bio::LocatableSeq.
SimpleAlign expects the combination of name, start, and end for a given sequence to be unique in the alignment, and this is the key for the internal hashes (name, start, end are abbreviated "nse" in the code). However, in some cases people do not want the name/start-end to be displayed: either multiple names in an alignment or names specific to the alignment (ROA1_HUMAN_1, ROA1_HUMAN_2 etc). These names are called "displayname", and generally is what is used to print out the alignment. They default to name/start-end.
The SimpleAlign Module is derived from the Align module by Ewan Birney.
FEEDBACK
Mailing Lists
User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to one of the Bioperl mailing lists. Your participation is much appreciated.
[email protected] - General discussionhttp://bioperl.org/wiki/Mailing_lists - About the mailing lists
Support
Please direct usage questions or support issues to the mailing list:
rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible.
Reporting Bugs
Report bugs to the Bioperl bug tracking system to help us keep track the bugs and their resolution. Bug reports can be submitted via the web:
https://github.com/bioperl/bioperl-live/issues
AUTHOR
Ewan Birney, [email protected]
CONTRIBUTORS
Allen Day, allenday-at-ucla.edu, Richard Adams, Richard.Adams-at-ed.ac.uk, David J. Evans, David.Evans-at-vir.gla.ac.uk, Heikki Lehvaslaiho, heikki-at-bioperl-dot-org, Allen Smith, allens-at-cpan.org, Jason Stajich, jason-at-bioperl.org, Anthony Underwood, aunderwood-at-phls.org.uk, Xintao Wei & Giri Narasimhan, giri-at-cs.fiu.edu Brian Osborne, bosborne at alum.mit.edu Weigang Qiu, Weigang at GENECTR-HUNTER-CUNY-EDU Hongyu Zhang, forward at hongyu.org Jay Hannah, jay at jays.net Alexandr Bezginov, albezg at gmail.com
SEE ALSO
Bio::LocatableSeq
APPENDIX
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _
new
Title : newUsage : my $aln = Bio::SimpleAlign->new();Function : Creates a new simple align objectReturns : Bio::SimpleAlignArgs : -source => string representing the source programwhere this alignment came from-annotation => Bio::AnnotationCollectionI-seq_annotation => Bio::AnnotationCollectionI for sequences (requires -annotation also be set)-seqs => array ref containing Bio::LocatableSeq or Bio::Seq::Meta-consensus => consensus string-consensus_meta => Bio::Seq::Meta object containing consensus met information (kludge)
Modifier methods
These methods modify the MSA by adding, removing or shuffling complete sequences.
add_seq
Title : add_seqUsage : $myalign->add_seq($newseq);$myalign->add_seq(-SEQ=>$newseq, -ORDER=>5);Function : Adds another sequence to the alignment. *Does not* alignit - just adds it to the hashes.If -ORDER is specified, the sequence is inserted at thethe position spec'd by -ORDER, and existing sequencesare pushed down the storage array.Returns : nothingArgs : A Bio::LocatableSeq objectPositive integer for the sequence position (optional)
See Bio::LocatableSeq for more information
remove_seq
Title : remove_seqUsage : $aln->remove_seq($seq);Function : Removes a single sequence from an alignmentReturns :Argument : a Bio::LocatableSeq object
purge
Title : purgeUsage : $aln->purge(0.7);Function: Removes sequences above given sequence similarityThis function will grind on large alignments. Beware!Example :Returns : An array of the removed sequencesArgs : float, threshold for similarity
sort_alphabetically
Title : sort_alphabeticallyUsage : $ali->sort_alphabeticallyFunction : Changes the order of the alignment to alphabetical on namefollowed by numerical by number.Returns :Argument :
sort_by_list
Title : sort_by_listUsage : $aln_ordered=$aln->sort_by_list($list_file)Function : Arbitrarily order sequences in an alignmentReturns : A new Bio::SimpleAlign objectArgument : a file listing sequence names in intended order (one name per line)
set_new_reference
Title : set_new_referenceUsage : $aln->set_new_reference(3 or 'B31'): Select the 3rd sequence, orthe sequence whoes name is "B31" (full, exact, and case-sensitive),as the reference (1st) sequenceFunction : Change/Set a new reference (i.e., the first) sequenceReturns : a new Bio::SimpleAlign object.Throws an exception if designated sequence not foundArgument : a positive integer of sequence order, or a sequence namein the original alignment
uniq_seq
Title : uniq_seqUsage : $aln->uniq_seq(): Remove identical sequences inin the alignment. Ambiguous base ("N", "n") andleading and ending gaps ("-") are NOT counted asdifferences.Function : Make a new alignment of unique sequence types (STs)Returns : 1a. if called in a scalar context,a new Bio::SimpleAlign object (all sequences renamed as "ST")1b. if called in an array context,a new Bio::SimpleAlign object, and a hashref whose keysare sequence types, and whose values are arrayrefs tolists of sequence ids within the corresponding sequence type2. if $aln->verbose > 0, ST of each sequence is sent toSTDERR (in a tabular format)Argument : None
Sequence selection methods
Methods returning one or more sequences objects.
each_seq
Title : each_seqUsage : foreach $seq ( $align->each_seq() )Function : Gets a Seq object from the alignmentReturns : Seq objectArgument :
each_alphabetically
Title : each_alphabeticallyUsage : foreach $seq ( $ali->each_alphabetically() )Function : Returns a sequence object, but the objects are returnedin alphabetically sorted order.Does not change the order of the alignment.Returns : Seq objectArgument :
each_seq_with_id
Title : each_seq_with_idUsage : foreach $seq ( $align->each_seq_with_id() )Function : Gets a Seq objects from the alignment, the contentsbeing those sequences with the given name (there may bemore than one)Returns : Seq objectArgument : a seq name
get_seq_by_pos
Title : get_seq_by_posUsage : $seq = $aln->get_seq_by_pos(3) # third sequence from the alignmentFunction : Gets a sequence based on its position in the alignment.Numbering starts from 1. Sequence positions larger thannum_sequences() will throw an error.Returns : a Bio::LocatableSeq objectArgs : positive integer for the sequence position
get_seq_by_id
Title : get_seq_by_idUsage : $seq = $aln->get_seq_by_id($name) # seq named $nameFunction : Gets a sequence based on its name.Sequences that do not exist will warn and return undefReturns : a Bio::LocatableSeq objectArgs : string for sequence name
seq_with_features
Title : seq_with_featuresUsage : $seq = $aln->seq_with_features(-pos => 1,-consensus => 60-mask =>sub { my $consensus = shift;for my $i (1..5){my $n = 'N' x $i;my $q = '\?' x $i;while($consensus =~ /[^?]$q[^?]/){$consensus =~ s/([^?])$q([^?])/$1$n$2/;}}return $consensus;});Function: produces a Bio::Seq object by first splicing gaps from -pos(by means of a splice_by_seq_pos() call), then creatingfeatures using non-? chars (by means of a consensus_string()call with stringency -consensus).Returns : a Bio::Seq objectArgs : -pos : required. sequence from which to build the Bio::Seqobject-consensus : optional, defaults to consensus_string()'sdefault cutoff value-mask : optional, a coderef to apply to consensus_string()'soutput before building features. this may be useful forclosing gaps of 1 bp by masking over them with N, forinstance
Create new alignments
The result of these methods are horizontal or vertical subsets of the current MSA.
select
Title : selectUsage : $aln2 = $aln->select(1, 3) # three first sequencesFunction : Creates a new alignment from a continuous subset ofsequences. Numbering starts from 1. Sequence positionslarger than num_sequences() will throw an error.Returns : a Bio::SimpleAlign objectArgs : positive integer for the first sequencepositive integer for the last sequence to include (optional)
select_noncont
Title : select_noncontUsage : # 1st and 3rd sequences, sorted$aln2 = $aln->select_noncont(1, 3)# 1st and 3rd sequences, sorted (same as first)$aln2 = $aln->select_noncont(3, 1)# 1st and 3rd sequences, unsorted$aln2 = $aln->select_noncont('nosort',3, 1)Function : Creates a new alignment from a subset of sequences. Numberingstarts from 1. Sequence positions larger than num_sequences() willthrow an error. Sorts the order added to new alignment by default,to prevent sorting pass 'nosort' as the first argument in the list.Returns : a Bio::SimpleAlign objectArgs : array of integers for the sequences. If the string 'nosort' ispassed as the first argument, the sequences will not be sortedin the new alignment but will appear in the order listed.
select_noncont_by_name
Title : select_noncont_by_nameUsage : my $aln2 = $aln->select_noncont_by_name('A123', 'B456');Function : Creates a new alignment from a subset of sequences which areselected by name (sequence ID).Returns : a Bio::SimpleAlign objectArgs : array of names (i.e., identifiers) for the sequences.
slice
Title : sliceUsage : $aln2 = $aln->slice(20,30)Function : Creates a slice from the alignment inclusive of start andend columns, and the first column in the alignment is denoted 1.Sequences with no residues in the slice are excluded from thenew alignment and a warning is printed. Slice beyond the length ofthe sequence does not do padding.Returns : A Bio::SimpleAlign objectArgs : Positive integer for start column, positive integer for end column,optional boolean which if true will keep gap-only columns in the newlycreated slice. Example:$aln2 = $aln->slice(20,30,1)
remove_columns
Title : remove_columnsUsage : $aln2 = $aln->remove_columns(['mismatch','weak']) or$aln2 = $aln->remove_columns([0,0],[6,8])Function : Creates an aligment with columns removed corresponding tothe specified type or by specifying the columns by number.Returns : Bio::SimpleAlign objectArgs : Array ref of types ('match'|'weak'|'strong'|'mismatch'|'gaps'|'all_gaps_columns') or array ref where the referenced arraycontains a pair of integers that specify a range.The first column is 0
remove_gaps
Title : remove_gapsUsage : $aln2 = $aln->remove_gapsFunction : Creates an aligment with gaps removedReturns : a Bio::SimpleAlign objectArgs : a gap character(optional) if none specified takenfrom $self->gap_char,[optional] $all_gaps_columns flag (1 or 0, default is 0)indicates that only all-gaps columns should be deleted
Used from method remove_columns in most cases. Set gap character using gap_char().
Change sequences within the MSA
These methods affect characters in all sequences without changing the alignment.
splice_by_seq_pos
Title : splice_by_seq_posUsage : $status = splice_by_seq_pos(1);Function: splices all aligned sequences where the specified sequencehas gaps.Example :Returns : 1 on successArgs : position of sequence to splice by
map_chars
Title : map_charsUsage : $ali->map_chars('\.','-')Function : Does a s/$arg1/$arg2/ on the sequences. Useful for gapcharacters.Note that the first argument is interpreted as a regexpso be careful and escape any wild card characters (e.g.do $ali->map_chars('\.','-') to replace periods with dashes.Returns : 1 on successArgument : A regexp and a string
uppercase
Title : uppercase()Usage : $ali->uppercase()Function : Sets all the sequences to uppercaseReturns : 1 on successArgument :
cigar_line
Title : cigar_line()Usage : %cigars = $align->cigar_line()Function : Generates a "cigar" (Compact Idiosyncratic Gapped AlignmentReport) line for each sequence in the alignment. Examples are"1,60" or "5,10:12,58", where the numbers refer to conservedpositions within the alignment. The keys of the hash are theNSEs (name/start/end) assigned to each sequence.Args : threshold (optional, defaults to 100)Returns : Hash of strings (cigar lines)
match_line
Title : match_line()Usage : $line = $align->match_line()Function : Generates a match line - much like consensus stringexcept that a line indicating the '*' for a match.Args : (optional) Match line characters ('*' by default)(optional) Strong match char (':' by default)(optional) Weak match char ('.' by default)Returns : String
gap_line
Title : gap_line()Usage : $line = $align->gap_line()Function : Generates a gap line - much like consensus stringexcept that a line where '-' represents gapArgs : (optional) gap line characters ('-' by default)Returns : string
all_gap_line
Title : all_gap_line()Usage : $line = $align->all_gap_line()Function : Generates a gap line - much like consensus stringexcept that a line where '-' represents all-gap columnArgs : (optional) gap line characters ('-' by default)Returns : string
gap_col_matrix
Title : gap_col_matrix()Usage : my $cols = $align->gap_col_matrix()Function : Generates an array where each element in the array is ahash reference with a key of the sequence name and avalue of 1 if the sequence has a gap at that columnReturns : Reference to an arrayArgs : Optional: gap line character ($aln->gap_char or '-' by default)
match
Title : match()Usage : $ali->match()Function : Goes through all columns and changes residues that areidentical to residue in first sequence to match '.'character. Sets match_char.USE WITH CARE: Most MSA formats do not support matchcharacters in sequences, so this is mostly for outputonly. NEXUS format (Bio::AlignIO::nexus) can handleit.Returns : 1 on successArgument : a match character, optional, defaults to '.'
unmatch
Title : unmatch()Usage : $ali->unmatch()Function : Undoes the effect of method match. Unsets match_char.Returns : 1 on successArgument : a match character, optional, defaults to '.'
See match and match_char
MSA attributes
Methods for setting and reading the MSA attributes.
Note that the methods defining character semantics depend on the user to set them sensibly. They are needed only by certain input/output methods. Unset them by setting to an empty string ('').
id
Title : idUsage : $myalign->id("Ig")Function : Gets/sets the id field of the alignmentReturns : An id stringArgument : An id string (optional)
accession
Title : accessionUsage : $myalign->accession("PF00244")Function : Gets/sets the accession field of the alignmentReturns : An acc stringArgument : An acc string (optional)
description
Title : descriptionUsage : $myalign->description("14-3-3 proteins")Function : Gets/sets the description field of the alignmentReturns : An description stringArgument : An description string (optional)
missing_char
Title : missing_charUsage : $myalign->missing_char("?")Function : Gets/sets the missing_char attribute of the alignmentIt is generally recommended to set it to 'n' or 'N'for nucleotides and to 'X' for protein.Returns : An missing_char string,Argument : An missing_char string (optional)
match_char
Title : match_charUsage : $myalign->match_char('.')Function : Gets/sets the match_char attribute of the alignmentReturns : An match_char string,Argument : An match_char string (optional)
gap_char
Title : gap_charUsage : $myalign->gap_char('-')Function : Gets/sets the gap_char attribute of the alignmentReturns : An gap_char string, defaults to '-'Argument : An gap_char string (optional)
symbol_chars
Title : symbol_charsUsage : my @symbolchars = $aln->symbol_chars;Function: Returns all the seen symbols (other than gaps)Returns : array of characters that are the seen symbolsArgs : boolean to include the gap/missing/match characters
Alignment descriptors
These read only methods describe the MSA in various ways.
score
Title : scoreUsage : $str = $ali->score()Function : get/set a score of the alignmentReturns : a score for the alignmentArgument : an optional score to set
consensus_string
Title : consensus_stringUsage : $str = $ali->consensus_string($threshold_percent)Function : Makes a strict consensusReturns : Consensus stringArgument : 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%)
consensus_conservation
Title : consensus_conservationUsage : @conservation = $ali->consensus_conservation();Function : Conservation (as a percent) of each position of alignmentReturns : Array of percentages [0-100]. Gap columns are 0% conserved.Argument :
consensus_iupac
Title : consensus_iupacUsage : $str = $ali->consensus_iupac()Function : Makes a consensus using IUPAC ambiguity codes from DNAand RNA. The output is in upper case except when gaps ina column force output to be in lower case.Note that if your alignment sequences contain a lot ofIUPAC ambiquity codes you often have to manually setalphabet. Bio::PrimarySeq::_guess_type thinks theyindicate a protein sequence.Returns : consensus stringArgument : noneThrows : on protein sequences
consensus_meta
Title : consensus_metaUsage : $seqmeta = $ali->consensus_meta()Function : Returns a Bio::Seq::Meta object containing the consensusstrings derived from meta data analysis.Returns : Bio::Seq::MetaArgument : Bio::Seq::MetaThrows : non-MetaI object
is_flush
Title : is_flushUsage : if ( $ali->is_flush() )Function : Tells you whether the alignment: is flush, i.e. all of the same lengthReturns : 1 or 0Argument :
length
Title : length()Usage : $len = $ali->length()Function : Returns the maximum length of the alignment.To be sure the alignment is a block, use is_flushReturns : IntegerArgument :
maxdisplayname_length
Title : maxdisplayname_lengthUsage : $ali->maxdisplayname_length()Function : Gets the maximum length of the displayname in thealignment. Used in writing out various MSA formats.Returns : integerArgument :
max_metaname_length
Title : max_metaname_lengthUsage : $ali->max_metaname_length()Function : Gets the maximum length of the meta name tags in thealignment for the sequences and for the alignment.Used in writing out various MSA formats.Returns : integerArgument : None
num_residues
Title : num_residuesUsage : $no = $ali->num_residuesFunction : number of residues in total in the alignmentReturns : integerArgument :Note : replaces no_residues()
num_sequences
Title : num_sequencesUsage : $depth = $ali->num_sequencesFunction : number of sequence in the sequence alignmentReturns : integerArgument : noneNote : replaces no_sequences()
average_percentage_identity
Title : average_percentage_identityUsage : $id = $align->average_percentage_identityFunction: The function uses a fast method to calculate the averagepercentage identity of the alignmentReturns : The average percentage identity of the alignmentArgs : NoneNotes : This method implemented by Kevin Howe calculates a figure that isdesigned to be similar to the average pairwise identity of thealignment (identical in the absence of gaps), without having toexplicitly calculate pairwise identities proposed by Richard Durbin.Validated by Ewan Birney ad Alex Bateman.
percentage_identity
Title : percentage_identityUsage : $id = $align->percentage_identityFunction: The function calculates the average percentage identity(aliased to average_percentage_identity)Returns : The average percentage identityArgs : None
overall_percentage_identity
Title : overall_percentage_identityUsage : $id = $align->overall_percentage_identity$id = $align->overall_percentage_identity('short')Function: The function calculates the percentage identity ofthe conserved columnsReturns : The percentage identity of the conserved columnsArgs : length value to use, optional defaults to alignment lengthpossible values: 'align', 'short', 'long'
The argument values 'short' and 'long' refer to shortest and longest sequence in the alignment. Method modification code by Hongyu Zhang.
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 Bio::LocatableSeq::location_from_column:
# select somehow a sequence from the alignment, e.g.my $seq = $aln->get_seq_by_pos(1);#$loc is undef or Bio::LocationI objectmy $loc = $seq->location_from_column(5);
column_from_residue_number
Title : column_from_residue_numberUsage : $col = $ali->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 thesequence with the given name. For example, for thealignmentSeq1/91-97 AC..DEF.GH.Seq2/24-30 ACGG.RTY...Seq3/43-51 AC.DDEF.GHIcolumn_from_residue_number( "Seq1", 94 ) returns 6.column_from_residue_number( "Seq2", 25 ) returns 2.column_from_residue_number( "Seq3", 50 ) returns 10.An exception is thrown if the residue number would lieoutside the length of the aligment(e.g. column_from_residue_number( "Seq2", 22 )Note: If the the parent sequence is represented by more thanone alignment sequence and the residue number is present inthem, this method finds only the first one.Returns : A column number for the position in the alignment of thegiven 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 thatsegment of it in the alignment)
Sequence names
Methods to manipulate the display name. The default name based on the sequence id and subsequence positions can be overridden in various ways.
displayname
Title : displaynameUsage : $myalign->displayname("Ig", "IgA")Function : Gets/sets the display name of a sequence in the alignmentReturns : A display name stringArgument : name of the sequencedisplayname of the sequence (optional)
set_displayname_count
Title : set_displayname_countUsage : $ali->set_displayname_countFunction : Sets the names to be name_# where # is the number oftimes this name has been used.Returns : 1, on successArgument :
set_displayname_flat
Title : set_displayname_flatUsage : $ali->set_displayname_flat()Function : Makes all the sequences be displayed as just their name,not name/start-end (NSE)Returns : 1Argument :
set_displayname_normal
Title : set_displayname_normalUsage : $ali->set_displayname_normal()Function : Makes all the sequences be displayed as name/start-end (NSE)Returns : 1, on successArgument :
source
Title : sourceUsage : $obj->source($newval)Function: sets the Alignment source programExample :Returns : value of sourceArgs : newvalue (optional)
set_displayname_safe
Title : set_displayname_safeUsage : ($new_aln, $ref_name)=$ali->set_displayname_safe(4)Function : Assign machine-generated serial names to sequences in input order.Designed to protect names during PHYLIP runs. Assign 10-char stringin the form of "S000000001" to "S999999999". Restore the originalnames using "restore_displayname".Returns : 1. a new $aln with system names;2. a hash ref for restoring namesArgument : Number for id length (default 10)
restore_displayname
Title : restore_displaynameUsage : $aln_name_restored=$ali->restore_displayname($hash_ref)Function : Restore original sequence names (after running$ali->set_displayname_safe)Returns : a new $aln with names restored.Argument : a hash reference of names from "set_displayname_safe".
sort_by_start
Title : sort_by_startUsage : $ali->sort_by_startFunction : Changes the order of the alignment to the start position of eachsubalignmentReturns : 1 on successArgument :
bracket_string
Title : bracket_stringUsage : my @params = (-refseq => 'testseq',-allele1 => 'allele1',-allele2 => 'allele2',-delimiters => '{}',-separator => '/');$str = $aln->bracket_string(@params)Function : When supplied with a list of parameters (see below), returns astring in BIC format. This is used for allelic comparisons.Briefly, if either allele contains a base change when compared tothe refseq, the base or gap for each allele is represented inbrackets in the order present in the 'alleles' parameter.For the following data:>testseqGGATCCATTGCTACT>allele1GGATCCATTCCTACT>allele2GGAT--ATTCCTCCTthe returned string with parameters 'refseq => testseq' and'alleles => [qw(allele1 allele2)]' would be:GGAT[C/-][C/-]ATT[C/C]CT[A/C]CTReturns : BIC-formatted stringArgument : Required argsrefseq : string (ID) of the reference sequence usedas basis for comparisonallele1 : string (ID) of the first alleleallele2 : string (ID) of the second alleleOptional argsdelimiters: two symbol string of left and right delimiters.Only the first two symbols are useddefault = '[]'separator : string used as a separator. Only the firstsymbol is useddefault = '/'Throws : On no refseq/alleles, or invalid refseq/alleles.
methods implementing Bio::FeatureHolderI
FeatureHolderI implementation to support labeled character sets like one would get from NEXUS represented data.
get_SeqFeatures
Usage : @features = $aln->get_SeqFeaturesFunction: Get the feature objects held by this feature holder.Example :Returns : an array of Bio::SeqFeatureI implementing objectsArgs : optional filter coderef, taking a Bio::SeqFeatureI: as argument, returning TRUE if wanted, FALSE if: unwanted
add_SeqFeature
Usage : $aln->add_SeqFeature($subfeat);Function: Adds a SeqFeature into the SeqFeature array. The 'EXPAND' qualifier(see L<Bio::FeatureHolderI>) is supported, but has no effect.Example :Returns : 1 on successArgs : a Bio::SeqFeatureI object
remove_SeqFeatures
Usage : $obj->remove_SeqFeaturesFunction: Removes all SeqFeatures. If you want to remove only a subset,remove that subset from the returned array, and add back the rest.Returns : The array of Bio::SeqFeatureI features that wasdeleted from this alignment.Args : none
feature_count
Title : feature_countUsage : $obj->feature_count()Function: Return the number of SeqFeatures attached to the alignmentReturns : integer representing the number of SeqFeaturesArgs : None
get_all_SeqFeatures
Title : get_all_SeqFeaturesUsage :Function: Get all SeqFeatures.Example :Returns : an array of Bio::SeqFeatureI implementing objectsArgs : noneNote : Falls through to Bio::FeatureHolderI implementation.
methods for Bio::AnnotatableI
AnnotatableI implementation to support sequence alignments which contain annotation (NEXUS, Stockholm).
annotation
Title : annotationUsage : $ann = $aln->annotation or$aln->annotation($ann)Function: Gets or sets the annotationReturns : Bio::AnnotationCollectionI objectArgs : None or Bio::AnnotationCollectionI object
See Bio::AnnotationCollectionI and Bio::Annotation::Collection for more information
Deprecated methods
mask_columns
Title : mask_columnsUsage : $aln2 = $aln->mask_columns(20,30)Function : Masks a slice of the alignment inclusive of start andend columns, and the first column in the alignment is denoted 1.Mask beyond the length of the sequence does not do padding.Returns : A Bio::SimpleAlign objectArgs : Positive integer for start column, positive integer for end column,optional string value use for the mask. Example:$aln2 = $aln->mask_columns(20,30,'?')Note : Masking must use a character that is not used for gaps orframeshifts. These can be adjusted using the relevant globalvariables, but be aware these may be (uncontrollably) modifiedelsewhere within BioPerl (see bug 2715)