File Coverage

lib/App/SimulateReads/Read/SingleEnd.pm
Criterion Covered Total %
statement 12 12 100.0
branch 4 4 100.0
condition n/a
subroutine 2 2 100.0
pod 0 1 0.0
total 18 19 94.7


line stmt bran cond sub pod time code
1             package App::SimulateReads::Read::SingleEnd;
2             # ABSTRACT: App::SimulateReads::Read subclass for simulate single-end reads.
3              
4 6     6   1764 use App::SimulateReads::Base 'class';
  6         12  
  6         36  
5              
6             extends 'App::SimulateReads::Read';
7              
8             our $VERSION = '0.06'; # VERSION
9              
10             sub gen_read {
11 1255     1255 0 82789 my ($self, $seq_ref, $seq_size, $is_leader) = @_;
12              
13 1255 100       31406 if ($seq_size < $self->read_size) {
14 5         120 croak sprintf "seq_size (%d) must be greater or equal to read_size (%d)\n"
15             => $seq_size, $self->read_size;
16             }
17              
18 1250         28887 my ($read_ref, $read_pos) = $self->subseq_rand($seq_ref, $seq_size, $self->read_size);
19              
20 1250 100       2741 unless ($is_leader) {
21 626         1574 $self->reverse_complement($read_ref);
22             }
23              
24 1250         29381 $self->update_count_base($self->read_size);
25 1250         3411 $self->insert_sequencing_error($read_ref);
26              
27 1250         3842 return ($read_ref, $read_pos);
28             }
29              
30             __END__
31              
32             =pod
33              
34             =encoding UTF-8
35              
36             =head1 NAME
37              
38             App::SimulateReads::Read::SingleEnd - App::SimulateReads::Read subclass for simulate single-end reads.
39              
40             =head1 VERSION
41              
42             version 0.06
43              
44             =head1 AUTHOR
45              
46             Thiago L. A. Miller <tmiller@mochsl.org.br>
47              
48             =head1 COPYRIGHT AND LICENSE
49              
50             This software is Copyright (c) 2017 by Teaching and Research Institute from Sírio-Libanês Hospital.
51              
52             This is free software, licensed under:
53              
54             The GNU General Public License, Version 3, June 2007
55              
56             =cut