LICENSE
Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute Copyright [2016-2024] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
CONTACT
Please email comments or questions to the public Ensembl
developers list at <http://lists.ensembl.org/mailman/listinfo/dev>.
Questions may also be sent to the Ensembl help desk at
<http://www.ensembl.org/Help/Contact>.
AUTHOR
Juguang Xiao <juguang@tll.org.sg>
NAME
Bio::EnsEMBL::Utils::CigarString, a utilites module to generate cigar strings
DESCRIPTION
Sequence alignment hits were previously stored within the core database as ungapped alignments. This imposed 2 major constraints on alignments:
a) alignments for a single hit record would require multiple rows in the database, and b) it was not possible to accurately retrieve the exact original alignment.
Therefore, in the new branch sequence alignments are now stored as ungapped alignments in the cigar line format (where CIGAR stands for Concise Idiosyncratic Gapped Alignment Report).
In the cigar line format alignments are stored as follows:
M: Match
D: Deletion
I: Insertion
An example of an alignment for a hypthetical protein match is shown below:
Query: 42 PGPAGLP----GSVGLQGPRGLRGPLP-GPLGPPL...
PG P G GP R PLGP
Sbjct: 1672 PGTP*TPLVPLGPWVPLGPSSPR--LPSGPLGPTD...
This would be stored in the protein_align_feature table as the following cigar line:
7M4D12M2I2MD7M
split_hsp
Name : split_hsp (this name is derived from the original sub in BlastWorn)
Usage : my $hsp; # a ready Bio::Search::HSP::GenericHSP object.
my $factory = new Bio::EnsEMBL::Utils::CigarString;
my $cigar_string = $factory->split_hsp($hsp);
Function: generate cigar string.
Argument: a HSP object.
Returns : a text string.
generate_cigar_string
Name : generate_cigar_string
Usage: $cigar_string = $self->generate_cigar_string(\@qchars, \@hchars);
Function: generate the cigar string for a piece of alignment.
Args: 2 array references. The lengths of 2 arrays are the same
Return: a cigar string
generate_cigar_string_by_hsp
Name : generate_cigar_string_by_hsp
Usage : my $hsp; # a ready GenericHSP object
my $cigar_string = $self->generate_cigar_string_by_hsp($hsp);
Function: generate a cigar string by given HSP object.
Args : a GenericHSP object
Returns: a text string of cigar string