| 1 | package App::Sandy::Read::SingleEnd; | ||
| 2 | # ABSTRACT: App::Sandy::Read subclass for simulate single-end reads. | ||
| 3 | |||
| 4 | 1 | ▶ | use App::Sandy::Base 'class'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | extends 'App::Sandy::Read'; | ||
| 7 | |||
| 8 | our $VERSION = '0.25'; # VERSION | ||
| 9 | |||
| 10 | sub gen_read { | ||
| 11 | my ($self, $ptable, $ptable_size, $read_size, $is_leader, $rng, $blacklist) = @_; | ||
| 12 | |||
| 13 | if ($ptable_size < $read_size) { | ||
| 14 | croak sprintf "ptable_size (%d) must be greater or equal to read_size (%d)" | ||
| 15 | => $ptable_size, $read_size; | ||
| 16 | } | ||
| 17 | |||
| 18 | my ($read_ref, $attr) = $self->subseq_rand_ptable($ptable, | ||
| 19 | $ptable_size, $read_size, $read_size, $rng, $blacklist); | ||
| 20 | |||
| 21 | unless ($is_leader) { | ||
| 22 | $self->reverse_complement($read_ref); | ||
| 23 | } | ||
| 24 | |||
| 25 | $attr->{error} = $self->insert_sequencing_error($read_ref, $read_size, $rng); | ||
| 26 | |||
| 27 | return ($read_ref, $attr); | ||
| 28 | } | ||
| 29 | |||
| 30 | __END__ | ||