App-SimulateReads

 view release on metacpan or  search on metacpan

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

use constant {
	VERBOSE           => 0,
	COUNT_LOOPS_BY    => 'coverage',
	COVERAGE          => 8,
	STRAND_BIAS       => 'random',
	SEQID_WEIGHT      => 'length',
	SEQUENCING_TYPE   => 'paired-end',
	SEQUENCING_SYSTEM => 'poisson',
	SEED              => time,
	JOBS              => 2,
	OUTPUT_GZIP       => 0,
	SEQ_SYS           => 'poisson',
	QUALITY_SIZE      => 10,
	GENOME            => '.data.fa',
	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');

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

	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',
		seed           => SEED
	);
	
	my %sg_single_end = (

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

	my %default_attr = %{ $test->default_attr };

	while (my ($attr, $value) = each %default_attr) {
		can_ok $sg, $attr;
		is $sg->$attr, $value, "The value for $attr shold be correct";
	}
}

sub run_simulation : Tests(9) {
	my $test = shift;
	my $output_single_end = OUTPUT_SINGLE_END;
	my $output_paired_end = OUTPUT_PAIRED_END;
	my $output_counts = OUTPUT_COUNTS;

	my $fastq_count = sub {
		my $file = shift;
		my $entries = 0;
		my %chr_acm;
		open my $fh, "<" => $file;
		my $mark = 4;
		my $acm = 0;
		while (<$fh>) {
			chomp;



( run in 0.504 second using v1.01-cache-2.11-cpan-c6e0e5ac2a7 )