Browse Source

Getting rid of unittest noise

bio2
Pjotr Prins 5 years ago
parent
commit
bfeef2bfa8
  1. 2
      bio/bam/md/reconstruct.d
  2. 2
      bio/bam/pileup.d
  3. 2
      bio/bam/read.d
  4. 2
      bio/bam/utils/samheadermerger.d
  5. 2
      bio/core/fastq.d
  6. 8
      bio/sam/header.d
  7. 25
      test/unittests.d

2
bio/bam/md/reconstruct.d

@ -216,7 +216,7 @@ auto dna(T)(T read)
unittest {
import std.stdio;
stderr.writeln("Testing reconstruction of reference from MD tags and CIGAR");
// stderr.writeln("Testing reconstruction of reference from MD tags and CIGAR");
// Test reference reconstruction from MD and CIGAR.
// (Tests are taken from http://davetang.org/muse/2011/01/28/perl-and-sam/)

2
bio/bam/pileup.d

@ -761,7 +761,7 @@ unittest {
auto reference = to!string(dna(reads));
import std.stdio;
stderr.writeln("Testing pileup (low-level aspects)...");
// stderr.writeln("Testing pileup (low-level aspects)...");
auto pileup = makePileup(reads, true, 796, 849, false);
auto pileup2 = makePileup(reads, true, 0, ulong.max, false);

2
bio/bam/read.d

@ -1282,7 +1282,7 @@ unittest {
import std.stdio;
import std.math;
stderr.writeln("Testing BamRead behaviour...");
// stderr.writeln("Testing BamRead behaviour...");
auto read = BamRead("readname",
"AGCTGACTACGTAATAGCCCTA",
[CigarOperation(22, 'M')]);

2
bio/bam/utils/samheadermerger.d

@ -304,7 +304,7 @@ unittest {
import std.stdio;
import std.algorithm;
stderr.writeln("Testing SAM header merging...");
// stderr.writeln("Testing SAM header merging...");
auto h1 = new SamHeader();
auto h2 = new SamHeader();
auto h3 = new SamHeader();

2
bio/core/fastq.d

@ -146,6 +146,6 @@ unittest {
foreach(record; FastqRecord.read(input)) {
import std.stdio;
stderr.writeln(record);
// stderr.writeln(record); -> should be an assert statement
}
}

8
bio/sam/header.d

@ -251,12 +251,12 @@ unittest {
import std.algorithm;
import std.stdio;
stderr.writeln("Testing @HD line parsing...");
// stderr.writeln("Testing @HD line parsing...");
auto hd_line = HdLine.parse("@HD\tVN:1.0\tSO:coordinate");
assert(hd_line.format_version == "1.0");
assert(hd_line.sorting_order == "coordinate");
stderr.writeln("Testing @SQ line parsing...");
// stderr.writeln("Testing @SQ line parsing...");
auto sq_line = SqLine.parse("@SQ\tSN:NC_007605\tLN:171823\tM5:6743bd63b3ff2b5b8985d8933c53290a\tUR:ftp://.uk/vol1/ftp/technical/reference/phase2_reference_assembly_sequence/hs37d5.fa.gz\tAS:NCBI37\tSP:HUMAN");
assert(sq_line.name == "NC_007605");
assert(sq_line.length == 171823);
@ -265,7 +265,7 @@ unittest {
assert(sq_line.assembly == "NCBI37");
assert(sq_line.species == "HUMAN");
stderr.writeln("Testing @RG line parsing...");
// stderr.writeln("Testing @RG line parsing...");
auto rg_line = RgLine.parse("@RG\tID:ERR016155\tLB:HUMgdtRAGDIAAPE\tSM:HG00125\tPI:488\tCN:BGI\tPL:ILLUMINA\tDS:SRP001294");
assert(rg_line.identifier == "ERR016155");
assert(rg_line.library == "HUMgdtRAGDIAAPE");
@ -275,7 +275,7 @@ unittest {
assert(rg_line.platform == "ILLUMINA");
assert(rg_line.description == "SRP001294");
stderr.writeln("Testing @PG line parsing...");
// stderr.writeln("Testing @PG line parsing...");
auto pg_line = PgLine.parse("@PG\tID:bam_calculate_bq\tPN:samtools\tPP:bam_recalibrate_quality_scores\tVN:0.1.17 (r973:277)\tCL:samtools calmd -Erb $bam_file $reference_fasta > $bq_bam_file");
assert(pg_line.identifier == "bam_calculate_bq");
assert(pg_line.name == "samtools");

25
test/unittests.d

@ -64,7 +64,8 @@ CigarOperation[] cigarFromString(string cigar) {
unittest {
stderr.writeln("Testing extracting SAM header...");
stderr.writeln("Running unittests...");
// stderr.writeln("Testing extracting SAM header...");
auto fn = buildPath(dirName(__FILE__), "data", "ex1_header.bam");
auto bf = new BamReader(fn);
assert(bf.header.format_version == "1.3");
@ -82,7 +83,7 @@ unittest {
assert(bf.header.sequences["small"].length == 65536);
{
stderr.writeln("Testing alignment parsing...");
// stderr.writeln("Testing alignment parsing...");
fn = buildPath(dirName(__FILE__), "data", "ex1_header.bam");
bf = new BamReader(fn);
auto reads = bf.reads;
@ -104,7 +105,7 @@ unittest {
assert(bf.reads.front.name == "EAS56_57:6:190:289:82");
stderr.writeln("Testing tag parsing...");
// stderr.writeln("Testing tag parsing...");
fn = buildPath(dirName(__FILE__), "data", "tags.bam");
bf = new BamReader(fn);
foreach (alignment; bf.reads) {
@ -126,7 +127,7 @@ unittest {
assert(name == value);
}
stderr.writeln("Testing exception handling...");
// stderr.writeln("Testing exception handling...");
fn = buildPath(dirName(__FILE__), "data", "duplicated_block_size.bam");
assertThrown!BgzfException(new BamReader(fn));
fn = buildPath(dirName(__FILE__), "data", "no_block_size.bam");
@ -139,7 +140,7 @@ unittest {
import bio.core.utils.zlib;
assertThrown!ZlibException(walkLength((new BamReader(fn)).reads));
stderr.writeln("Testing random access...");
// stderr.writeln("Testing random access...");
fn = buildPath(dirName(__FILE__), "data", "bins.bam");
bf = new BamReader(fn);
@ -196,7 +197,7 @@ unittest {
assert(fst_read_large.name == "large:r1:0..1:len1:bin4681:hexbin0x1249");
}
stderr.writeln("Testing Value code...");
// stderr.writeln("Testing Value code...");
Value v = 5;
assert(v.is_integer);
assert(v.toSam() == "i:5");
@ -247,7 +248,7 @@ unittest {
assert(v.is_hexadecimal_string);
assert(v == "0eabcf123");
stderr.writeln("Testing parseAlignmentLine/toSam functions...");
// stderr.writeln("Testing parseAlignmentLine/toSam functions...");
fn = buildPath(dirName(__FILE__), "data", "ex1_header.bam");
bf = new BamReader(fn);
foreach (read; bf.reads) {
@ -274,7 +275,7 @@ unittest {
assert(read == read2 || !isValid(read));
}
stderr.writeln("Testing BAM writing...");
// stderr.writeln("Testing BAM writing...");
fn = buildPath(dirName(__FILE__), "data", "ex1_header.bam");
bf = new BamReader(fn);
{
@ -296,14 +297,14 @@ unittest {
stream.close();
}
stderr.writeln("Testing SAM reading...");
// stderr.writeln("Testing SAM reading...");
{
auto sf = new SamReader(buildPath(dirName(__FILE__), "data", "ex1_header.sam"));
assert(sf.reads.front.ref_id == 0);
assert(equal(sf.reads, bf.reads!withoutOffsets));
}
stderr.writeln("Testing pileup (high-level aspects)...");
// stderr.writeln("Testing pileup (high-level aspects)...");
{
// All of pileup functions should automatically filter out unmapped reads.
@ -359,7 +360,7 @@ unittest {
}
}
stderr.writeln("Testing basesWith functionality...");
// stderr.writeln("Testing basesWith functionality...");
{
fn = buildPath(dirName(__FILE__), "data", "mg1655_chunk.bam");
bf = new BamReader(fn);
@ -430,7 +431,7 @@ unittest {
}
}
stderr.writeln("Testing extended CIGAR conversion...");
// stderr.writeln("Testing extended CIGAR conversion...");
auto cigars = ["2M1D7M1D6M1D13M1D5M1D12M2D7M1D10M1D17M1D12M3D23M",
"12M2D9M1D14M1D16M2D7M1D4M1D12M1D9M1D15M1D6M1D14M1S",

Loading…
Cancel
Save