class Bio::Blat::Report::SegmentPair
Sequence segment pair of BLAT result. Similar to Bio::Blast::Report::Hsp but lacks many methods.
Attributes
Returns block size (length) of the segment pair. This would be a Bio::Blat specific method.
Returns target (subject, hit) start position. CAUTION: In Blat's raw result(psl format), first position is 0. To keep compatibility, the parser add 1 to the position.
Returns strand information of the target (subject, hit). Returns 'plus' or 'minus'.
Returns target (subject, hit) end position. CAUTION: In Blat's raw result(psl format), first position is 0. To keep compatibility, the parser add 1 to the position.
Returns the target (subject, hit) sequence. If sequence data is not available, returns nil.
Returns query sequence. If sequence data is not available, returns nil.
Returns query start position. CAUTION: In Blat's raw result(psl format), first position is 0. To keep compatibility, the parser add 1 to the position.
Returns strand information of the query. Returns 'plus' or 'minus'.
Returns query end position. CAUTION: In Blat's raw result(psl format), first position is 0. To keep compatibility, the parser add 1 to the position.
Public Class Methods
Creates a new SegmentPair object. It is designed to be called internally from Bio::Blat::Report class. Users shall not use it directly.
# File lib/bio/appl/blat/report.rb, line 199 def initialize(query_len, target_len, strand, blksize, qstart, tstart, qseq, tseq, protein_flag) @blocksize = blksize @qseq = qseq @hseq = hseq @hit_strand = 'plus' w = (protein_flag ? 3 : 1) # 3 means query=protein target=dna case strand when '-' # query is minus strand @query_strand = 'minus' # convert positions @query_from = query_len - qstart @query_to = query_len - qstart - blksize + 1 # To keep compatibility, with other homology search programs, # we add 1 to each position number. @hit_from = tstart + 1 @hit_to = tstart + blksize * w # - 1 + 1 when '+-' # hit is minus strand @query_strand = 'plus' @hit_strand = 'minus' # To keep compatibility, with other homology search programs, # we add 1 to each position number. @query_from = qstart + 1 @query_to = qstart + blksize # - 1 + 1 # convert positions @hit_from = target_len - tstart @hit_to = target_len - tstart - blksize * w + 1 else #when '+', '++' @query_strand = 'plus' # To keep compatibility with other homology search programs, # we add 1 to each position number. @query_from = qstart + 1 @query_to = qstart + blksize # - 1 + 1 @hit_from = tstart + 1 @hit_to = tstart + blksize * w # - 1 + 1 end end
Public Instance Methods
Returns alignment length of the segment pair. Returns nil if no alignment data are available.
# File lib/bio/appl/blat/report.rb, line 281 def align_len @qseq ? @qseq.size : nil end