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 199 def initialize(query_len, target_len, strand, 200 blksize, qstart, tstart, qseq, tseq, 201 protein_flag) 202 @blocksize = blksize 203 @qseq = qseq 204 @hseq = hseq 205 @hit_strand = 'plus' 206 w = (protein_flag ? 3 : 1) # 3 means query=protein target=dna 207 case strand 208 when '-' 209 # query is minus strand 210 @query_strand = 'minus' 211 # convert positions 212 @query_from = query_len - qstart 213 @query_to = query_len - qstart - blksize + 1 214 # To keep compatibility, with other homology search programs, 215 # we add 1 to each position number. 216 @hit_from = tstart + 1 217 @hit_to = tstart + blksize * w # - 1 + 1 218 when '+-' 219 # hit is minus strand 220 @query_strand = 'plus' 221 @hit_strand = 'minus' 222 # To keep compatibility, with other homology search programs, 223 # we add 1 to each position number. 224 @query_from = qstart + 1 225 @query_to = qstart + blksize # - 1 + 1 226 # convert positions 227 @hit_from = target_len - tstart 228 @hit_to = target_len - tstart - blksize * w + 1 229 else #when '+', '++' 230 @query_strand = 'plus' 231 # To keep compatibility with other homology search programs, 232 # we add 1 to each position number. 233 @query_from = qstart + 1 234 @query_to = qstart + blksize # - 1 + 1 235 @hit_from = tstart + 1 236 @hit_to = tstart + blksize * w # - 1 + 1 237 end 238 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 281 def align_len 282 @qseq ? @qseq.size : nil 283 end