line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::SimulateReads::Fastq::SingleEnd; |
2
|
|
|
|
|
|
|
# ABSTRACT: App::SimulateReads::Fastq subclass for simulate single-end fastq entries. |
3
|
|
|
|
|
|
|
|
4
|
6
|
|
|
6
|
|
1872
|
use App::SimulateReads::Base 'class'; |
|
6
|
|
|
|
|
12
|
|
|
6
|
|
|
|
|
35
|
|
5
|
6
|
|
|
6
|
|
3293
|
use App::SimulateReads::Read::SingleEnd; |
|
6
|
|
|
|
|
2323
|
|
|
6
|
|
|
|
|
1474
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
extends 'App::SimulateReads::Fastq'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '0.05'; # VERSION |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
12
|
|
|
|
|
|
|
# Moose attributes |
13
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
14
|
|
|
|
|
|
|
has 'sequencing_error' => (is => 'ro', isa => 'My:NumHS', required => 1); |
15
|
|
|
|
|
|
|
has '_read' => ( |
16
|
|
|
|
|
|
|
is => 'ro', |
17
|
|
|
|
|
|
|
isa => 'App::SimulateReads::Read::SingleEnd', |
18
|
|
|
|
|
|
|
builder => '_build_read', |
19
|
|
|
|
|
|
|
lazy_build => 1, |
20
|
|
|
|
|
|
|
handles => [qw{ gen_read }] |
21
|
|
|
|
|
|
|
); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
#=== CLASS METHOD ============================================================ |
24
|
|
|
|
|
|
|
# CLASS: Fastq::SingleEnd |
25
|
|
|
|
|
|
|
# METHOD: _build_read (BUILDER) |
26
|
|
|
|
|
|
|
# PARAMETERS: Void |
27
|
|
|
|
|
|
|
# RETURNS: Read::SingleEnd obj |
28
|
|
|
|
|
|
|
# DESCRIPTION: Build Read::SingleEnd object |
29
|
|
|
|
|
|
|
# THROWS: no exceptions |
30
|
|
|
|
|
|
|
# COMMENTS: none |
31
|
|
|
|
|
|
|
# SEE ALSO: n/a |
32
|
|
|
|
|
|
|
#=============================================================================== |
33
|
|
|
|
|
|
|
sub _build_read { |
34
|
3
|
|
|
3
|
|
16
|
my $self = shift; |
35
|
3
|
|
|
|
|
201
|
App::SimulateReads::Read::SingleEnd->new( |
36
|
|
|
|
|
|
|
sequencing_error => $self->sequencing_error, |
37
|
|
|
|
|
|
|
read_size => $self->read_size |
38
|
|
|
|
|
|
|
); |
39
|
|
|
|
|
|
|
} ## --- end sub _build_read |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
#=== CLASS METHOD ============================================================ |
42
|
|
|
|
|
|
|
# CLASS: Fastq::SingleEnd |
43
|
|
|
|
|
|
|
# METHOD: fastq |
44
|
|
|
|
|
|
|
# PARAMETERS: $id Str, $seq_name Str, $seq_ref Ref Str, $seq_size Int > 0, $is_leader Bool |
45
|
|
|
|
|
|
|
# RETURNS: sprint_fastq Ref Str |
46
|
|
|
|
|
|
|
# DESCRIPTION: Consumes sprint_fastq parent template to generate a single-end fastq entry |
47
|
|
|
|
|
|
|
# THROWS: no exceptions |
48
|
|
|
|
|
|
|
# COMMENTS: none |
49
|
|
|
|
|
|
|
# SEE ALSO: n/a |
50
|
|
|
|
|
|
|
#=============================================================================== |
51
|
|
|
|
|
|
|
sub sprint_fastq { |
52
|
1142
|
|
|
1142
|
0
|
13976
|
my ($self, $id, $seq_name, $seq_ref, $seq_size, $is_leader) = @_; |
53
|
|
|
|
|
|
|
|
54
|
1142
|
|
|
|
|
3541
|
my ($read_ref, $pos) = $self->gen_read($seq_ref, $seq_size, $is_leader); |
55
|
|
|
|
|
|
|
|
56
|
1142
|
100
|
|
|
|
35507
|
my $seq_pos = $is_leader ? |
57
|
|
|
|
|
|
|
"$seq_name:" . ($pos + 1) . "-" . ($pos + $self->read_size) : |
58
|
|
|
|
|
|
|
"$seq_name:" . ($pos + $self->read_size) . "-" . ($pos + 1); |
59
|
|
|
|
|
|
|
|
60
|
1142
|
|
|
|
|
31584
|
my $header = "$id simulation_read length=" . $self->read_size . " position=$seq_pos"; |
61
|
|
|
|
|
|
|
|
62
|
1142
|
|
|
|
|
4137
|
return $self->fastq_template(\$header, $read_ref); |
63
|
|
|
|
|
|
|
} ## --- end sub sprint_fastq |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
__END__ |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=pod |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=encoding UTF-8 |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head1 NAME |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
App::SimulateReads::Fastq::SingleEnd - App::SimulateReads::Fastq subclass for simulate single-end fastq entries. |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=head1 VERSION |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
version 0.05 |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=head1 AUTHOR |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
Thiago L. A. Miller <tmiller@mochsl.org.br> |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
This software is Copyright (c) 2017 by Teaching and Research Institute from SÃrio-Libanês Hospital. |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
This is free software, licensed under: |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
The GNU General Public License, Version 3, June 2007 |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=cut |