High-scoring Segment Pair Object¶
The HSP object provides access by name to the fields of a BLAST result. Unlike a standard object, the similarity object is stored as a list reference, not a hash reference. The HSP fields are pulled from the appropriate places in the list.
A blast takes a sequence called the query and matches it against a database. When describing the data in an HSP, we will refer repeatedly to the query sequence and the database sequence. Often, the query and database sequences will be given by peg IDs. In some cases, however, they will be contig IDs. In both cases, the match is represented by an alignment between portions of the sequences. Gap characters may be required to get the alignments to match, and the number of gaps is part of the data in the HSP.
my $hsp = Hsp->new( @data ); my $hsp = Hsp->new( \@data );
Create an HSP object from an array of fields.
An array of data in fields:0 qid query sequence id 1 qdef query sequence comment 2 qlen total query sequence length 3 sid subject sequence id 4 sdef subject sequence comment 5 slen total subject sequence length 6 scr match score 7 e_val match e-value (probability match is a coincidence) 8 p_n the p-number 9 p_val the Poisson value 10 n_mat match length 11 n_id identity count 12 n_pos positive count 13 n_gap gap count 14 dir frame direction or shift 15 q1 start position of match in the query sequence 16 q2 end position of match in the query sequence 17 qseq query alignment sequence 18 s1 start position of match in the subject sequence 19 s2 end position of match in the subject sequence 20 sseq subject alignment sequence
Returns an HSP object that allows the values to be accessed by name.
my $qid = $hsp->qid
Return the query sequence id.
my $qdef = $hsp->qdef
Return the query sequence comment.
my $qlen = $hsp->qlen
Return the total query sequence length.
my $sid = $hsp->sid
Return the subject sequence id.
my $sdef = $hsp->sdef
Return the subject sequence comment.
my $slen = $hsp->slen
Return the total subject sequence length.
my $scr = $hsp->scr
Return the match score.
my $e_val = $hsp->e_val
Return the match e-value (probability match is a coincidence).
my $p_n = $hsp->p_n
Return the the p-number.
my $p_val = $hsp->p_val
Return the the Poisson value.
my $n_mat = $hsp->n_mat
Return the match length.
my $n_id = $hsp->n_id
Return the identity count.
my $pct = $hsp->pct;
Return the percent identity.
my $n_pos = $hsp->n_pos
Return the positive count.
my $n_gap = $hsp->n_gap
Return the gap count.
my $dir = $hsp->dir
Return the frame direction or shift.
my $q1 = $hsp->q1
Return the start position of match in the query sequence.
my $q2 = $hsp->q2
Return the end position of match in the query sequence.
my $qseq = $hsp->qseq
Return the query alignment sequence.
my $s1 = $hsp->s1
Return the start position of match in the subject sequence.
my $s2 = $hsp->s2
Return the end position of match in the subject sequence.
my $sseq = $hsp->sseq
Return the subject alignment sequence.
my $sloc = $hsp->sloc;
Return the match region of the subject sequence as a BasicLocation object.