view release on metacpan or search on metacpan
t/lib/TestsFor/App/SimulateReads/Fastq.pm view on Meta::CPAN
567891011121314151617181920212223242526272829303132333435use
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
1234567891011121314151617181920212223242526272829303132333435363738# 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
123456789101112131415161718192021222324252627282930313233343536# 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
5678910111213141516171819202122232425262728293031323334use
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
1617181920212223242526272829303132333435363738394041424344454647#===============================================================================
package
TestsFor::App::SimulateReads::Read;
# 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
123456789101112131415161718192021222324252627282930# 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
123456789101112131415161718192021222324# 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
252627282930313233343536373839404142434445
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
8384858687888990919293949596979899100101102103CAGGAGAAATGTATTAATGTGCCTTTCTAGTAACAGGTTTTTAGAAAGTCAAATATAAAC};
open
my
$fh
,
">"
=> GENOME;
$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
127128129130131132133134135136137138139140141142143144145146147
);
$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
) {