App-SimulateReads

 view release on metacpan or  search on metacpan

t/lib/TestsFor/App/SimulateReads/Fastq.pm  view on Meta::CPAN

5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
use autodie;
 
use constant {
        SEQ_SYS       => 'poisson',
        QUALITY_SIZE  => 10,
};
 
sub startup : Tests(startup) {
        my $test = shift;
        $test->SUPER::startup;
        my $class = ref $test;
        $class->mk_classdata('default_fastq');
        $class->mk_classdata('default_attr');
        $class->mk_classdata('seq');
        $class->mk_classdata('seq_len');
}
 
sub setup : Tests(setup) {
        my $test = shift;
        my %child_arg = @_;
        $test->SUPER::setup;
 
        my %default_attr = (
                quality_profile => SEQ_SYS,
                read_size       => QUALITY_SIZE,
                %child_arg
        );
 
        $test->default_attr(\%default_attr);
        $test->default_fastq($test->class_to_test->new(%default_attr));

t/lib/TestsFor/App/SimulateReads/Fastq/PairedEnd.pm  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# ABSTRACT: Tests for 'App::SimulateReads::Fastq::PairedEnd' class
 
use base 'https://metacpan.org/pod/TestsFor::App::SimulateReads::Fastq">TestsFor::App::SimulateReads::Fastq';
use autodie;
 
sub startup : Tests(startup) {
        my $test = shift;
        $test->SUPER::startup;
}
 
sub setup : Tests(setup) {
        my $test = shift;
 
        my %default_attr = (
                sequencing_error => 0.1,
                fragment_mean    => 50,
                fragment_stdd    => 10,
                template_id      => 'sr0001 simulation_read length=%r position=%c:%t-%n'
        );
 
        $test->SUPER::setup(%default_attr);
}
 
sub cleanup : Tests(shutdown) {
        my $test = shift;
        $test->SUPER::shutdown;
}
 
sub constructor : Tests(12) {
        my $test = shift;
 
        my $class = $test->class_to_test;
        my $fastq = $test->default_fastq;
        my %default_attr = %{ $test->default_attr };
 
        while (my ($attr, $value) = each %default_attr) {

t/lib/TestsFor/App/SimulateReads/Fastq/SingleEnd.pm  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# ABSTRACT: Tests for 'App::SimulateReads::Fastq::SingleEnd' class
 
use base 'https://metacpan.org/pod/TestsFor::App::SimulateReads::Fastq">TestsFor::App::SimulateReads::Fastq';
use autodie;
 
sub startup : Tests(startup) {
        my $test = shift;
        $test->SUPER::startup;
}
 
sub setup : Tests(setup) {
        my $test = shift;
 
        my %default_attr = (
                sequencing_error => 0.1,
                template_id      => 'sr0001 simulation_read length=%r position=%c:%t-%n'
        );
 
        $test->SUPER::setup(%default_attr);
}
 
sub cleanup : Tests(shutdown) {
        my $test = shift;
        $test->SUPER::shutdown;
}
 
sub constructor : Tests(8) {
        my $test = shift;
 
        my $class = $test->class_to_test;
        my $fastq = $test->default_fastq;
        my %default_attr = %{ $test->default_attr };
 
        while (my ($attr, $value) = each %default_attr) {

t/lib/TestsFor/App/SimulateReads/Quality.pm  view on Meta::CPAN

5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
use autodie;
 
use constant {
        SEQ_SYS       => "poisson",
        QUALITY_SIZE  => 10
};
 
sub startup : Tests(startup) {
        my $test = shift;
        $test->SUPER::startup;
        my $class = ref $test;
        $class->mk_classdata('default_quality');
        $class->mk_classdata('default_attr');
}
 
sub setup : Tests(setup) {
        my $test = shift;
        my %child_arg = @_;
        $test->SUPER::setup;
 
        my %default_attr = (
                quality_profile => SEQ_SYS,
                read_size       => QUALITY_SIZE,
                %child_arg
        );
 
        $test->default_attr(\%default_attr);
        $test->default_quality($test->class_to_test->new(%default_attr));
}

t/lib/TestsFor/App/SimulateReads/Read.pm  view on Meta::CPAN

16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#===============================================================================
 
# ABSTRACT: Tests for 'App::SimulateReads::Read' class
 
 
sub startup : Tests(startup) {
        my $test = shift;
        $test->SUPER::startup;
        my $class = ref $test;
        $class->mk_classdata('default_read');
        $class->mk_classdata('default_attr');
        $class->mk_classdata('seq');
        $class->mk_classdata('seq_len');
}
 
sub setup : Tests(setup) {
        my $test = shift;
        my %child_arg = @_;
        $test->SUPER::setup;
 
        my %default_attr = (
                sequencing_error => 0.1,
                read_size        => 10,
                %child_arg
        );
 
        my $seq = 'TGACCCGCTAACCTCAGTTCTGCAGCAGTAACAACTGCCGTATCTGGACTTTCCTAATACCTCGCATAGTCCGTCCCCTCGCGCGGCAAGAGGTGCGGCG';
 
        $test->default_attr(\%default_attr);

t/lib/TestsFor/App/SimulateReads/Read/PairedEnd.pm  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# ABSTRACT: Tests for 'App::SimulateReads::Read::PairedEnd' class
 
use base 'https://metacpan.org/pod/TestsFor::App::SimulateReads::Read">TestsFor::App::SimulateReads::Read';
 
sub startup : Tests(startup) {
        my $test = shift;
        $test->SUPER::startup;
}
 
sub setup : Tests(setup) {
        my $test = shift;
 
        my %default_attr = (
                fragment_mean    => 50,
                fragment_stdd    => 10
        );
 
        $test->SUPER::setup(%default_attr);
}
 
sub constructor : Tests(9) {
        my $test = shift;
 
        my $class = $test->class_to_test;
        my $read = $test->default_read;
        my %default_attr = %{ $test->default_attr };
 
        while (my ($attr, $value) = each %default_attr) {

t/lib/TestsFor/App/SimulateReads/Read/SingleEnd.pm  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# ABSTRACT: Tests for 'App::SimulateReads::Read::SingleEnd' class
 
use base 'https://metacpan.org/pod/TestsFor::App::SimulateReads::Read">TestsFor::App::SimulateReads::Read';
 
sub startup : Tests(startup) {
        my $test = shift;
        $test->SUPER::startup;
}
 
sub setup : Tests(setup) {
        my $test = shift;
        $test->SUPER::setup;
}
 
sub gen_read : Tests(51) {
        my $test = shift;
 
        my $read = $test->default_read;
        my $seq = $test->seq;
        my $seq_len = $test->seq_len;
 
        throws_ok { ${ $read->gen_read(\$seq, $read->read_size - 1, 1) } }

t/lib/TestsFor/App/SimulateReads/Simulator.pm  view on Meta::CPAN

25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
        GENOME_SIZE       => 2280,
        COVERAGE          => 5,
        PREFIX            => 'ponga',
        OUTPUT_SINGLE_END => 'ponga_R1_001.fastq',
        OUTPUT_PAIRED_END => ['ponga_R1_001.fastq', 'ponga_R2_001.fastq'],
        OUTPUT_COUNTS     => 'ponga_counts.tsv'
};
 
sub startup : Tests(startup) {
        my $test = shift;
        $test->SUPER::startup;
        my $class = ref $test;
        $class->mk_classdata('default_attr');
        $class->mk_classdata('default_sg_single_end');
        $class->mk_classdata('default_sg_paired_end');
 
        my $fasta = q{>Chr1
TTACTGCTTTTAACATTACAGTAACTGTTACAGGTTCCAGCAGGCTAACTGGGTGGAAAT
GAGTTTGGTTTCACTTAGTCTCTCTAAAGAGAAAGCAAGTCGGTAGACTAATACCTAATA
AAAGCAAAGCTGCCAACAATTGAAATTGCCTAGGCTGCTCTGTGTGTCCCACATGCATGG
GTGTGGGTGCCAGTGTGTGTGCGTGTGTGCATGCATGTGCATGTGTGTTGGGATAGAGTG

t/lib/TestsFor/App/SimulateReads/Simulator.pm  view on Meta::CPAN

83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
CAGGAGAAATGTATTAATGTGCCTTTCTAGTAACAGGTTTTTAGAAAGTCAAATATAAAC};
 
        open my $fh, ">" => GENOME;
        print $fh "$fasta\n";
        close $fh;
}
 
sub setup : Tests(setup) {
        my $test = shift;
        $LOG_VERBOSE = VERBOSE;
        $test->SUPER::setup;
 
        my %default_attr = (
                prefix         => PREFIX,
                output_gzip    => OUTPUT_GZIP,
                fasta_file     => GENOME,
                coverage       => COVERAGE,
                jobs           => JOBS,
                seqid_weight   => 'length',
                count_loops_by => 'coverage',
                strand_bias    => 'random',

t/lib/TestsFor/App/SimulateReads/Simulator.pm  view on Meta::CPAN

127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
        );
 
        $test->default_attr(\%default_attr);
        $test->default_sg_single_end($test->class_to_test->new(%sg_single_end));
        $test->default_sg_paired_end($test->class_to_test->new(%sg_paired_end));
}
 
sub cleanup : Tests(shutdown) {
        my $test = shift;
        unlink GENOME;
        $test->SUPER::shutdown;
}
 
sub constructor : Tests(18) {
        my $test = shift;
 
        my $class = $test->class_to_test;
        my $sg = $test->default_sg_single_end;
        my %default_attr = %{ $test->default_attr };
 
        while (my ($attr, $value) = each %default_attr) {



( run in 0.399 second using v1.01-cache-2.11-cpan-4e96b696675 )