- while (sum / self.seq.length) < max_cov
- if self.seq.size - size == 0
- start = 0
- else
- start = rand(self.seq.size - size)
- end
-
- stop = start + size - 1
- seq_name = self.seq_name + "[#{start + 1}-#{stop + 1}:#{strand}]"
- seq = self.seq[start .. stop]
- entry = Seq.new(seq_name, seq, 'dna')
-
- entry.revcomp if strand == '-'
+ while coverage(sum) < max_cov
+ entry = self.subseq_rand(size)
+ entry.reverse!.complement! if strand == '-'