view release on metacpan or search on metacpan
Makefile.PL view on Meta::CPAN
WriteMakefile(%WriteMakefileArgs);
package MY;
use File::ShareDir::Install;
# These two are necessary to keep bmake happy
sub xs_c {
my $self = shift;
my $ret = $self->SUPER::xs_c(@_);
$ret =~ s/\$\*\.xs/\$</g;
$ret =~ s/\$\*\.c\b/\$@/g;
return $ret;
}
sub c_o {
my $self = shift;
my $ret = $self->SUPER::c_o(@_);
$ret =~ s/\$\*\.c\b/\$</g;
$ret =~ s/\$\*\$\(OBJ_EXT\)/\$@/g;
return $ret;
}
sub const_cccmd {
my $ret = shift->SUPER::const_cccmd(@_);
return q{} unless $ret;
$ret .= ' -o $@';
return $ret;
}
# Fix shared object path
sub constants {
my $self = shift;
my $ret = $self->SUPER::constants(@_);
$ret =~ s|(?<=\nFULLEXT).*\n| = App/Sandy/RNG\n|;
$ret =~ s|(?<=\nBASEEXT).*\n| = RNG\n|;
return $ret;
}
sub postamble {
my $self = shift;
my @ret = File::ShareDir::Install::postamble($self);
my $cmd = q{
inc/SandyMakeMaker.pm view on Meta::CPAN
my $template = super();
$template .= << 'TEMPLATE';
package MY;
use File::ShareDir::Install;
# These two are necessary to keep bmake happy
sub xs_c {
my $self = shift;
my $ret = $self->SUPER::xs_c(@_);
$ret =~ s/\$\*\.xs/\$</g;
$ret =~ s/\$\*\.c\b/\$@/g;
return $ret;
}
sub c_o {
my $self = shift;
my $ret = $self->SUPER::c_o(@_);
$ret =~ s/\$\*\.c\b/\$</g;
$ret =~ s/\$\*\$\(OBJ_EXT\)/\$@/g;
return $ret;
}
sub const_cccmd {
my $ret = shift->SUPER::const_cccmd(@_);
return q{} unless $ret;
$ret .= ' -o $@';
return $ret;
}
# Fix shared object path
sub constants {
my $self = shift;
my $ret = $self->SUPER::constants(@_);
$ret =~ s|(?<=\nFULLEXT).*\n| = App/Sandy/RNG\n|;
$ret =~ s|(?<=\nBASEEXT).*\n| = RNG\n|;
return $ret;
}
sub postamble {
my $self = shift;
my @ret = File::ShareDir::Install::postamble($self);
my $cmd = q{
t/lib/TestsFor/App/Sandy/PieceTable.pm view on Meta::CPAN
package TestsFor::App::Sandy::PieceTable;
# ABSTRACT: Tests for 'App::Sandy::PieceTable' class
use App::Sandy::Base 'test';
#use Data::Dumper;
use base 'TestsFor';
sub startup : Tests(startup) {
my $test = shift;
$test->SUPER::startup;
my $class = ref $test;
$class->mk_classdata('default_attr');
$class->mk_classdata('default_seq');
$class->mk_classdata('default_table');
}
sub setup : Tests(setup) {
my $test = shift;
$test->SUPER::setup;
my $seq = "A large span of text";
my %default_attr = (orig => \$seq);
$test->default_seq(\$seq);
$test->default_attr(\%default_attr);
$test->default_table($test->class_to_test->new(%default_attr));
}
sub constructor : Tests(2) {
t/lib/TestsFor/App/Sandy/Quality.pm view on Meta::CPAN
use base 'TestsFor';
use constant {
SEQ_SYS => "poisson",
QUALITY_SIZE => 10,
SEED => 17
};
sub startup : Tests(startup) {
my $test = shift;
$test->SUPER::startup;
my $class = ref $test;
$class->mk_classdata('default_quality');
$class->mk_classdata('default_attr');
$class->mk_classdata('rng');
}
sub setup : Tests(setup) {
my $test = shift;
my %child_arg = @_;
$test->SUPER::setup;
my %default_attr = (
quality_profile => SEQ_SYS,
%child_arg
);
$test->default_attr(\%default_attr);
$test->default_quality($test->class_to_test->new(%default_attr));
$test->rng(App::Sandy::RNG->new(SEED));
}
t/lib/TestsFor/App/Sandy/RNG.pm view on Meta::CPAN
package TestsFor::App::Sandy::RNG;
# ABSTRACT: Tests for 'App::Sandy::RNG' class
use App::Sandy::Base 'test';
use base 'TestsFor';
sub startup : Tests(startup) {
my $test = shift;
$test->SUPER::startup;
my $class = ref $test;
$class->mk_classdata('default_rand');
$class->mk_classdata('default_seed');
}
sub setup : Tests(setup) {
my $test = shift;
$test->SUPER::setup;
$test->default_seed(27);
$test->default_rand($test->class_to_test->new(27));
}
sub constructor : Tests(1) {
my $test = shift;
my $class = $test->class_to_test;
my $rand = $test->default_rand;
t/lib/TestsFor/App/Sandy/Read.pm view on Meta::CPAN
use App::Sandy::RNG;
#use Data::Dumper;
use base 'TestsFor';
use constant {
SEED => 17
};
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');
$class->mk_classdata('table');
$class->mk_classdata('table_seq');
$class->mk_classdata('slice_len');
$class->mk_classdata('rng');
}
sub setup : Tests(setup) {
my $test = shift;
my %child_arg = @_;
$test->SUPER::setup;
my %default_attr = (
sequencing_error => 0.1,
%child_arg
);
my $seq = 'TGACCCGCTAACCTCAGTTCTGCAGCAGTAACAACTGCCGTATCTGGACTTTCCTAATACCTCGCATAGTCCGTCCCCTCGCGCGGCAAGAGGTGCGGCG';
my $table_seq = "A large span of text";
$test->default_attr(\%default_attr);
t/lib/TestsFor/App/Sandy/Read/PairedEnd.pm view on Meta::CPAN
package TestsFor::App::Sandy::Read::PairedEnd;
# ABSTRACT: Tests for 'App::Sandy::Read::PairedEnd' class
use App::Sandy::Base 'test';
use base 'TestsFor::App::Sandy::Read';
sub startup : Tests(startup) {
my $test = shift;
my $class = ref $test;
$test->SUPER::startup;
$class->mk_classdata('table_read');
}
sub setup : Tests(setup) {
my $test = shift;
my %default_attr = (
fragment_mean => 50,
fragment_stdd => 10
);
$test->SUPER::setup(%default_attr);
my $seq = $test->seq;
$test->table_read(App::Sandy::PieceTable->new(orig => \$seq));
$test->table_read->calculate_logical_offset;
}
sub constructor : Tests(8) {
my $test = shift;
my $class = $test->class_to_test;
t/lib/TestsFor/App/Sandy/Read/SingleEnd.pm view on Meta::CPAN
package TestsFor::App::Sandy::Read::SingleEnd;
# ABSTRACT: Tests for 'App::Sandy::Read::SingleEnd' class
use App::Sandy::Base 'test';
use base 'TestsFor::App::Sandy::Read';
sub startup : Tests(startup) {
my $test = shift;
my $class = ref $test;
$test->SUPER::startup;
$class->mk_classdata('table_read');
}
sub setup : Tests(setup) {
my $test = shift;
$test->SUPER::setup;
my $seq = $test->seq;
$test->table_read(App::Sandy::PieceTable->new(orig => \$seq));
$test->table_read->calculate_logical_offset;
}
sub gen_read : Tests(50) {
my $test = shift;
my $read = $test->default_read;
my $seq = $test->seq;
t/lib/TestsFor/App/Sandy/Seq.pm view on Meta::CPAN
use autodie;
use constant {
SEQ_SYS => 'poisson',
QUALITY_SIZE => 10,
SEED => 17
};
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');
$class->mk_classdata('rng');
}
sub setup : Tests(setup) {
my $test = shift;
my %child_arg = @_;
$test->SUPER::setup;
my %default_attr = (
quality_profile => SEQ_SYS,
read_mean => QUALITY_SIZE,
read_stdd => 0,
sequencing_error => 0.1,
template_id => 'ponga_header',
format => 'fastq',
%child_arg
);
t/lib/TestsFor/App/Sandy/Seq/PairedEnd.pm view on Meta::CPAN
package TestsFor::App::Sandy::Seq::PairedEnd;
# ABSTRACT: Tests for 'App::Sandy::Seq::PairedEnd' class
use App::Sandy::Base 'test';
use App::Sandy::PieceTable;
use base 'TestsFor::App::Sandy::Seq';
sub startup : Tests(startup) {
my $test = shift;
my $class = ref $test;
$test->SUPER::startup;
$class->mk_classdata('table_read');
}
sub setup : Tests(setup) {
my $test = shift;
my %default_attr = (
fragment_mean => 50,
fragment_stdd => 10,
template_id => 'sr0001 simulation_read length=%r position=%c:%t-%n'
);
$test->SUPER::setup(%default_attr);
my $seq = $test->seq;
$test->table_read(App::Sandy::PieceTable->new(orig => \$seq));
$test->table_read->calculate_logical_offset;
}
sub cleanup : Tests(shutdown) {
my $test = shift;
$test->SUPER::shutdown;
}
sub constructor : Tests(16) {
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/Sandy/Seq/SingleEnd.pm view on Meta::CPAN
package TestsFor::App::Sandy::Seq::SingleEnd;
# ABSTRACT: Tests for 'App::Sandy::Seq::SingleEnd' class
use App::Sandy::Base 'test';
use App::Sandy::PieceTable;
use base 'TestsFor::App::Sandy::Seq';
sub startup : Tests(startup) {
my $test = shift;
my $class = ref $test;
$test->SUPER::startup;
$class->mk_classdata('table_read');
}
sub setup : Tests(setup) {
my $test = shift;
my %default_attr = (
template_id => 'sr0001 simulation_read length=%r position=%c:%a-%b'
);
$test->SUPER::setup(%default_attr);
my $seq = $test->seq;
$test->table_read(App::Sandy::PieceTable->new(orig => \$seq));
$test->table_read->calculate_logical_offset;
}
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/Sandy/Simulator.pm view on Meta::CPAN
GENOME => '.data.fa',
GENOME_SIZE => 2280,
PREFIX => 'ponga',
OUTPUT_SINGLE_END => 'ponga_R1_001.fastq',
OUTPUT_PAIRED_END => ['ponga_R1_001.fastq', 'ponga_R2_001.fastq'],
OUTPUT_COUNTS => 'ponga_coverage.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/Sandy/Simulator.pm view on Meta::CPAN
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 = (
argv => [qw/ponga 1 2 3 4 5/],
truncate => 0,
join_paired_ends => 0,
prefix => PREFIX,
fasta_file => GENOME,
coverage => COVERAGE,
jobs => JOBS,
output_format => FORMAT,
t/lib/TestsFor/App/Sandy/Simulator.pm view on Meta::CPAN
);
$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(26) {
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) {