.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Bio::Align::AlignI 3pm" .TH Bio::Align::AlignI 3pm "2021-08-15" "perl v5.32.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Bio::Align::AlignI \- An interface for describing sequence alignments. .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 8 \& # get a Bio::Align::AlignI somehow \- typically using Bio::AlignIO system \& # some descriptors \& print $aln\->length, "\en"; \& print $aln\->num_residues, "\en"; \& print $aln\->is_flush, "\en"; \& print $aln\->num_sequences, "\en"; \& print $aln\->percentage_identity, "\en"; \& print $aln\->consensus_string(50), "\en"; \& \& # find the position in the alignment for a sequence location \& $pos = $aln\->column_from_residue_number(\*(Aq1433_LYCES\*(Aq, 14); # = 6; \& \& # extract sequences and check values for the alignment column $pos \& foreach $seq ($aln\->each_seq) { \& $res = $seq\->subseq($pos, $pos); \& $count{$res}++; \& } \& foreach $res (keys %count) { \& printf "Res: %s Count: %2d\en", $res, $count{$res}; \& } .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This interface describes the basis for alignment objects. .SH "FEEDBACK" .IX Header "FEEDBACK" .SS "Mailing Lists" .IX Subsection "Mailing Lists" User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated. .PP .Vb 2 \& bioperl\-l@bioperl.org \- General discussion \& http://bioperl.org/wiki/Mailing_lists \- About the mailing lists .Ve .SS "Support" .IX Subsection "Support" Please direct usage questions or support issues to the mailing list: .PP \&\fIbioperl\-l@bioperl.org\fR .PP 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. .SS "Reporting Bugs" .IX Subsection "Reporting Bugs" Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web: .PP .Vb 1 \& https://github.com/bioperl/bioperl\-live/issues .Ve .SH "AUTHOR \- Jason Stajich" .IX Header "AUTHOR - Jason Stajich" Email jason@bioperl.org .SH "CONTRIBUTORS" .IX Header "CONTRIBUTORS" Ewan Birney, birney@ebi.ac.uk Heikki Lehvaslaiho, heikki-at-bioperl-dot-org .SH "APPENDIX" .IX Header "APPENDIX" The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ .SH "Modifier methods" .IX Header "Modifier methods" These methods modify the \s-1MSE\s0 by adding, removing or shuffling complete sequences. .SS "add_seq" .IX Subsection "add_seq" .Vb 7 \& Title : add_seq \& Usage : $myalign\->add_seq($newseq); \& Function : Adds another sequence to the alignment. *Does not* align \& it \- just adds it to the hashes. \& Returns : None \& Argument : a Bio::LocatableSeq object \& order (optional) .Ve .PP See Bio::LocatableSeq for more information. .SS "remove_seq" .IX Subsection "remove_seq" .Vb 5 \& Title : remove_seq \& Usage : $aln\->remove_seq($seq); \& Function : Removes a single sequence from an alignment \& Returns : \& Argument : a Bio::LocatableSeq object .Ve .SS "purge" .IX Subsection "purge" .Vb 3 \& Title : purge \& Usage : $aln\->purge(0.7); \& Function: \& \& Removes sequences above whatever %id. \& \& This function will grind on large alignments. Beware! \& (perhaps not ideally implemented) \& \& Example : \& Returns : An array of the removed sequences \& Argument: .Ve .SS "sort_alphabetically" .IX Subsection "sort_alphabetically" .Vb 3 \& Title : sort_alphabetically \& Usage : $ali\->sort_alphabetically \& Function : \& \& Changes the order of the alignment to alphabetical on name \& followed by numerical by number. \& \& Returns : an array \& Argument : .Ve .SH "Sequence selection methods" .IX Header "Sequence selection methods" Methods returning one or more sequences objects. .SS "each_seq" .IX Subsection "each_seq" .Vb 5 \& Title : each_seq \& Usage : foreach $seq ( $align\->each_seq() ) \& Function : Gets an array of Seq objects from the alignment \& Returns : an array \& Argument : .Ve .SS "each_alphabetically" .IX Subsection "each_alphabetically" .Vb 3 \& Title : each_alphabetically \& Usage : foreach $seq ( $ali\->each_alphabetically() ) \& Function : \& \& Returns an array of sequence object sorted alphabetically \& by name and then by start point. \& Does not change the order of the alignment \& \& Returns : \& Argument : .Ve .SS "each_seq_with_id" .IX Subsection "each_seq_with_id" .Vb 3 \& Title : each_seq_with_id \& Usage : foreach $seq ( $align\->each_seq_with_id() ) \& Function : \& \& Gets an array of Seq objects from the \& alignment, the contents being those sequences \& with the given name (there may be more than one) \& \& Returns : an array \& Argument : a seq name .Ve .SS "get_seq_by_pos" .IX Subsection "get_seq_by_pos" .Vb 3 \& Title : get_seq_by_pos \& Usage : $seq = $aln\->get_seq_by_pos(3) # third sequence from the alignment \& Function : \& \& Gets a sequence based on its position in the alignment. \& Numbering starts from 1. Sequence positions larger than \& num_sequences() will throw an error. \& \& Returns : a Bio::LocatableSeq object \& Argument : positive integer for the sequence position .Ve .SH "Create new alignments" .IX Header "Create new alignments" The result of these methods are horizontal or vertical subsets of the current \s-1MSE.\s0 .SS "select" .IX Subsection "select" .Vb 3 \& Title : select \& Usage : $aln2 = $aln\->select(1, 3) # three first sequences \& Function : \& \& Creates a new alignment from a continuous subset of \& sequences. Numbering starts from 1. Sequence positions \& larger than num_sequences() will throw an error. \& \& Returns : a Bio::SimpleAlign object \& Argument : positive integer for the first sequence \& positive integer for the last sequence to include (optional) .Ve .SS "select_noncont" .IX Subsection "select_noncont" .Vb 3 \& Title : select_noncont \& Usage : $aln2 = $aln\->select_noncont(1, 3) # first and 3rd sequences \& Function : \& \& Creates a new alignment from a subset of \& sequences. Numbering starts from 1. Sequence positions \& larger than num_sequences() will throw an error. \& \& Returns : a Bio::SimpleAlign object \& Args : array of integers for the sequences .Ve .SS "slice" .IX Subsection "slice" .Vb 3 \& Title : slice \& Usage : $aln2 = $aln\->slice(20, 30) \& Function : \& \& Creates a slice from the alignment inclusive of start and \& end columns. Sequences with no residues in the slice are \& excluded from the new alignment and a warning is printed. \& Slice beyond the length of the sequence does not do \& padding. \& \& Returns : a Bio::SimpleAlign object \& Argument : positive integer for start column \& positive integer for end column .Ve .SH "Change sequences within the MSE" .IX Header "Change sequences within the MSE" These methods affect characters in all sequences without changing the alignment. .SS "map_chars" .IX Subsection "map_chars" .Vb 3 \& Title : map_chars \& Usage : $ali\->map_chars(\*(Aq\e.\*(Aq,\*(Aq\-\*(Aq) \& Function : \& \& Does a s/$arg1/$arg2/ on the sequences. Useful for gap \& characters \& \& Notice that the "from" (arg1) is interpreted as a regex, \& so be careful about quoting meta characters (e.g. \& $ali\->map_chars(\*(Aq.\*(Aq, \*(Aq\-\*(Aq) won\*(Aqt do what you want) \& \& Returns : None \& Argument : \*(Aqfrom\*(Aq rexexp \& \*(Aqto\*(Aq string .Ve .SS "uppercase" .IX Subsection "uppercase" .Vb 5 \& Title : uppercase() \& Usage : $ali\->uppercase() \& Function : Sets all the sequences to uppercase \& Returns : \& Argument : .Ve .SS "match_line" .IX Subsection "match_line" .Vb 7 \& Title : match_line() \& Usage : $align\->match_line() \& Function : Generates a match line \- much like consensus string \& except that a line indicating the \*(Aq*\*(Aq for a match. \& Argument : (optional) Match line characters (\*(Aq*\*(Aq by default) \& (optional) Strong match char (\*(Aq:\*(Aq by default) \& (optional) Weak match char (\*(Aq.\*(Aq by default) .Ve .SS "match" .IX Subsection "match" .Vb 3 \& Title : match() \& Usage : $ali\->match() \& Function : \& \& Goes through all columns and changes residues that are \& identical to residue in first sequence to match \*(Aq.\*(Aq \& character. Sets match_char. \& \& USE WITH CARE: Most MSE formats do not support match \& characters in sequences, so this is mostly for output \& only. NEXUS format (Bio::AlignIO::nexus) can handle \& it. \& \& Returns : 1 \& Argument : a match character, optional, defaults to \*(Aq.\*(Aq .Ve .SS "unmatch" .IX Subsection "unmatch" .Vb 3 \& Title : unmatch() \& Usage : $ali\->unmatch() \& Function : \& \& Undoes the effect of method match. Unsets match_char. \& \& Returns : 1 \& Argument : a match character, optional, defaults to \*(Aq.\*(Aq .Ve .SH "MSE attibutes" .IX Header "MSE attibutes" Methods for setting and reading the \s-1MSE\s0 attributes. .PP 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 (''). .SS "id" .IX Subsection "id" .Vb 5 \& Title : id \& Usage : $myalign\->id("Ig") \& Function : Gets/sets the id field of the alignment \& Returns : An id string \& Argument : An id string (optional) .Ve .SS "missing_char" .IX Subsection "missing_char" .Vb 7 \& Title : missing_char \& Usage : $myalign\->missing_char("?") \& Function : Gets/sets the missing_char attribute of the alignment \& It is generally recommended to set it to \*(Aqn\*(Aq or \*(AqN\*(Aq \& for nucleotides and to \*(AqX\*(Aq for protein. \& Returns : An missing_char string, \& Argument : An missing_char string (optional) .Ve .SS "match_char" .IX Subsection "match_char" .Vb 5 \& Title : match_char \& Usage : $myalign\->match_char(\*(Aq.\*(Aq) \& Function : Gets/sets the match_char attribute of the alignment \& Returns : An match_char string, \& Argument : An match_char string (optional) .Ve .SS "gap_char" .IX Subsection "gap_char" .Vb 5 \& Title : gap_char \& Usage : $myalign\->gap_char(\*(Aq\-\*(Aq) \& Function : Gets/sets the gap_char attribute of the alignment \& Returns : An gap_char string, defaults to \*(Aq\-\*(Aq \& Argument : An gap_char string (optional) .Ve .SS "symbol_chars" .IX Subsection "symbol_chars" .Vb 5 \& Title : symbol_chars \& Usage : my @symbolchars = $aln\->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 .Ve .SH "Alignment descriptors" .IX Header "Alignment descriptors" These read only methods describe the \s-1MSE\s0 in various ways. .SS "consensus_string" .IX Subsection "consensus_string" .Vb 9 \& Title : consensus_string \& Usage : $str = $ali\->consensus_string($threshold_percent) \& Function : Makes a strict consensus \& Returns : consensus string \& 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 \*(Aq?\*(Aq \& character will be placed at that location. \& (Default value = 0%) .Ve .SS "consensus_iupac" .IX Subsection "consensus_iupac" .Vb 3 \& Title : consensus_iupac \& Usage : $str = $ali\->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 .Ve .SS "is_flush" .IX Subsection "is_flush" .Vb 10 \& Title : is_flush \& Usage : if( $ali\->is_flush() ) \& : \& : \& Function : Tells you whether the alignment \& : is flush, ie all of the same length \& : \& : \& Returns : 1 or 0 \& Argument : .Ve .SS "length" .IX Subsection "length" .Vb 6 \& Title : length() \& Usage : $len = $ali\->length() \& Function : Returns the maximum length of the alignment. \& To be sure the alignment is a block, use is_flush \& Returns : integer \& Argument : .Ve .SS "maxname_length" .IX Subsection "maxname_length" .Vb 3 \& Title : maxname_length \& Usage : $ali\->maxname_length() \& Function : \& \& Gets the maximum length of the displayname in the \& alignment. Used in writing out various MSE formats. \& \& Returns : integer \& Argument : .Ve .SS "num_residues" .IX Subsection "num_residues" .Vb 6 \& Title : num_residues \& Usage : $no = $ali\->num_residues \& Function : number of residues in total in the alignment \& Returns : integer \& Argument : \& Note : replaces no_residues .Ve .SS "num_sequences" .IX Subsection "num_sequences" .Vb 6 \& Title : num_sequences \& Usage : $depth = $ali\->num_sequences \& Function : number of sequence in the sequence alignment \& Returns : integer \& Argument : None \& Note : replaces no_sequences .Ve .SS "percentage_identity" .IX Subsection "percentage_identity" .Vb 6 \& Title : percentage_identity \& Usage : $id = $align\->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 .Ve .SS "overall_percentage_identity" .IX Subsection "overall_percentage_identity" .Vb 6 \& Title : overall_percentage_identity \& Usage : $id = $align\->overall_percentage_identity \& Function: The function calculates the percentage identity of \& the conserved columns \& Returns : The percentage identity of the conserved columns \& Args : None .Ve .SS "average_percentage_identity" .IX Subsection "average_percentage_identity" .Vb 6 \& Title : average_percentage_identity \& Usage : $id = $align\->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 .Ve .SH "Alignment positions" .IX Header "Alignment positions" Methods to map a sequence position into an alignment column and back. \&\fBcolumn_from_residue_number()\fR does the former. The latter is really a property of the sequence object and can done using Bio::LocatableSeq::location_from_column: .PP .Vb 4 \& # select somehow a sequence from the alignment, e.g. \& my $seq = $aln\->get_seq_by_pos(1); \& #$loc is undef or Bio::LocationI object \& my $loc = $seq\->location_from_column(5); .Ve .SS "column_from_residue_number" .IX Subsection "column_from_residue_number" .Vb 3 \& Title : column_from_residue_number \& Usage : $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 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 6. \& 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 alignment \& (e.g. column_from_residue_number( "Seq2", 22 ) \& \& Note: If 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) .Ve .SH "Sequence names" .IX Header "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. .SS "displayname" .IX Subsection "displayname" .Vb 7 \& Title : displayname \& Usage : $myalign\->displayname("Ig", "IgA") \& Function : Gets/sets the display name of a sequence in the alignment \& : \& Returns : A display name string \& Argument : name of the sequence \& displayname of the sequence (optional) .Ve .SS "set_displayname_count" .IX Subsection "set_displayname_count" .Vb 3 \& Title : set_displayname_count \& Usage : $ali\->set_displayname_count \& Function : \& \& Sets the names to be name_# where # is the number of \& times this name has been used. \& \& Returns : None \& Argument : None .Ve .SS "set_displayname_flat" .IX Subsection "set_displayname_flat" .Vb 6 \& Title : set_displayname_flat \& Usage : $ali\->set_displayname_flat() \& Function : Makes all the sequences be displayed as just their name, \& not name/start\-end \& Returns : 1 \& Argument : None .Ve .SS "set_displayname_normal" .IX Subsection "set_displayname_normal" .Vb 5 \& Title : set_displayname_normal \& Usage : $ali\->set_displayname_normal() \& Function : Makes all the sequences be displayed as name/start\-end \& Returns : None \& Argument : None .Ve