M
Martin Hansen
Hello all,
This snip of code needs more speed. Ideas? What is the state of Ruby and
Inline C?
Cheers,
Martin
class Hash
BASE_SOLEXA = 64
# Soft masks sequence residues where the corresponding quality score
# is below a given cutoff.
def mask!(cutoff)
if self.has_key? :SEQ and self.has_key? :SCORES
seq = self[:SEQ]
scores = self[:SCORES]
i = 0
scores.each_char do |score|
seq = seq.downcase if score.ord - BASE_SOLEXA <= cutoff
i += 1
end
self[:SEQ] = seq
end
self
end
end
This snip of code needs more speed. Ideas? What is the state of Ruby and
Inline C?
Cheers,
Martin
class Hash
BASE_SOLEXA = 64
# Soft masks sequence residues where the corresponding quality score
# is below a given cutoff.
def mask!(cutoff)
if self.has_key? :SEQ and self.has_key? :SCORES
seq = self[:SEQ]
scores = self[:SCORES]
i = 0
scores.each_char do |score|
seq = seq.downcase if score.ord - BASE_SOLEXA <= cutoff
i += 1
end
self[:SEQ] = seq
end
self
end
end