Ejemplo n.º 1
0
void CHPFileReaderTest::ReadCHPUniversalFileTest()
{
	CHPData data;
	CHPFileReader reader;
	CPPUNIT_ASSERT_NO_THROW(reader.SetFilename("../data/CHP_universal_file"));
	CPPUNIT_ASSERT_NO_THROW(reader.Read(data));

	CPPUNIT_ASSERT(data.GetFilename() == "../data/CHP_universal_file");
	CPPUNIT_ASSERT(data.GetEntryCount() == 2);
	CPPUNIT_ASSERT(data.GetBackgroundZoneCnt() == 2);

	CHPUniversalEntry entry1;
	data.GetEntry(0, entry1);
	CPPUNIT_ASSERT(entry1.GetBackground() == 11.0f);

	CHPUniversalEntry entry2;
	data.GetEntry(1, entry2);
	CPPUNIT_ASSERT(entry2.GetBackground() == 1.0f);

	CHPBackgroundZone zone1;
	data.GetBackgroundZone(0, zone1);
	CPPUNIT_ASSERT(zone1.GetCenterX() == 11.0f);
	CPPUNIT_ASSERT(zone1.GetCenterY() == 17.8f);
	CPPUNIT_ASSERT(zone1.GetBackground() == 56.9f);
	CPPUNIT_ASSERT(zone1.GetSmoothFactor() == 45.89f);

	CHPBackgroundZone zone2;
	data.GetBackgroundZone(1, zone2);
	CPPUNIT_ASSERT(zone2.GetCenterX() == 1.0f);
	CPPUNIT_ASSERT(zone2.GetCenterY() == 7.8f);
	CPPUNIT_ASSERT(zone2.GetBackground() == 6.9f);
	CPPUNIT_ASSERT(zone2.GetSmoothFactor() == 5.89f);
}
Ejemplo n.º 2
0
void CHPFileReaderTest::ReadCHPExpressionFileTest()
{
	CHPData data;
	CHPFileReader reader;
	CPPUNIT_ASSERT_NO_THROW(reader.SetFilename("../data/CHP_expression_file"));
	CPPUNIT_ASSERT_NO_THROW(reader.Read(data));

	CPPUNIT_ASSERT(data.GetFilename() == "../data/CHP_expression_file");
	CPPUNIT_ASSERT(data.GetEntryCount() == 10);
	CPPUNIT_ASSERT(data.GetBackgroundZoneCnt() == 2);

	CHPExpressionEntry entry1;
	data.GetEntry(0, entry1);
	CPPUNIT_ASSERT(entry1.GetProbeSetName() == "probe set 1");
	CPPUNIT_ASSERT(entry1.GetDetection() == 10);
	CPPUNIT_ASSERT(entry1.GetDetectionPValue() == 11.0f);
	float signal = entry1.GetSignal();
	CPPUNIT_ASSERT(signal == 17.8f);
	CPPUNIT_ASSERT(entry1.GetNumPairs() == 6);
	CPPUNIT_ASSERT(entry1.GetNumPairsUsed() == 5);
	CPPUNIT_ASSERT(entry1.GetChange() == 2);
	float chgPVal = entry1.GetChangePValue();
	CPPUNIT_ASSERT(chgPVal == 56.9f);
	CPPUNIT_ASSERT(entry1.GetSigLogRatio() == 45.89f);
	CPPUNIT_ASSERT(entry1.GetSigLogRatioLo() == 42.0f);
	CPPUNIT_ASSERT(entry1.GetSigLogRatioHi() == 47.0f);
	CPPUNIT_ASSERT(entry1.GetCommonPairs() == 2);

	CHPExpressionEntry entry2;
	data.GetEntry(1, entry2);
	CPPUNIT_ASSERT(entry2.GetProbeSetName() == "probe set 2");
	CPPUNIT_ASSERT(entry2.GetDetection() == 10);
	CPPUNIT_ASSERT(entry2.GetDetectionPValue() == 1.0f);
	CPPUNIT_ASSERT(entry2.GetSignal() == 7.8f);
	CPPUNIT_ASSERT(entry2.GetNumPairs() == 6);
	CPPUNIT_ASSERT(entry2.GetNumPairsUsed() == 5);
	CPPUNIT_ASSERT(entry2.GetChange() == 2);
	CPPUNIT_ASSERT(entry2.GetChangePValue() == 5.9f);
	CPPUNIT_ASSERT(entry2.GetSigLogRatio() == 4.89f);
	CPPUNIT_ASSERT(entry2.GetSigLogRatioLo() == 2.0f);
	CPPUNIT_ASSERT(entry2.GetSigLogRatioHi() == 7.0f);
	CPPUNIT_ASSERT(entry2.GetCommonPairs() == 2);

	CHPBackgroundZone zone1;
	data.GetBackgroundZone(0, zone1);
	CPPUNIT_ASSERT(zone1.GetCenterX() == 11.0f);
	CPPUNIT_ASSERT(zone1.GetCenterY() == 17.8f);
	CPPUNIT_ASSERT(zone1.GetBackground() == 56.9f);
	CPPUNIT_ASSERT(zone1.GetSmoothFactor() == 45.89f);

	CHPBackgroundZone zone2;
	data.GetBackgroundZone(1, zone2);
	CPPUNIT_ASSERT(zone2.GetCenterX() == 1.0f);
	CPPUNIT_ASSERT(zone2.GetCenterY() == 7.8f);
	CPPUNIT_ASSERT(zone2.GetBackground() == 6.9f);
	CPPUNIT_ASSERT(zone2.GetSmoothFactor() == 5.89f);
}
Ejemplo n.º 3
0
void CHPFileReaderTest::ReadCHPGenotypingFileTest()
{
	CHPData data;
	CHPFileReader reader;
	CPPUNIT_ASSERT_NO_THROW(reader.SetFilename("../data/CHP_genotype_file"));
	CPPUNIT_ASSERT_NO_THROW(reader.Read(data));

	CPPUNIT_ASSERT(data.GetFilename() == "../data/CHP_genotype_file");
	CPPUNIT_ASSERT(data.GetEntryCount() == 2);
	CPPUNIT_ASSERT(data.GetBackgroundZoneCnt() == 2);

	CHPGenotypeEntry entry1;
	data.GetEntry(0, entry1);
	CPPUNIT_ASSERT(entry1.GetProbeSetName() == "probe set 1");
	CPPUNIT_ASSERT(entry1.GetCall() == 1);
	CPPUNIT_ASSERT(entry1.GetConfidence() == 11.0f);
	float ras1 = entry1.GetRAS1();
	CPPUNIT_ASSERT(ras1 == 17.8f);
	CPPUNIT_ASSERT(entry1.GetRAS2() == 6.0f);
	CPPUNIT_ASSERT(entry1.GetAACall() == 5.0f);
	CPPUNIT_ASSERT(entry1.GetABCall() == 2.0f);
	CPPUNIT_ASSERT(entry1.GetBBCall() == 56.9f);
	CPPUNIT_ASSERT(entry1.GetNoCall() == 45.89f);

	CHPGenotypeEntry entry2;
	data.GetEntry(1, entry2);
	CPPUNIT_ASSERT(entry2.GetProbeSetName() == "probe set 2");
	CPPUNIT_ASSERT(entry2.GetCall() == 2);
	CPPUNIT_ASSERT(entry2.GetConfidence() == 1.0f);
	CPPUNIT_ASSERT(entry2.GetRAS1() == 7.8f);
	CPPUNIT_ASSERT(entry2.GetRAS2() == 6.0f);
	CPPUNIT_ASSERT(entry2.GetAACall() == 5.0f);
	CPPUNIT_ASSERT(entry2.GetABCall() == 2.0f);
	CPPUNIT_ASSERT(entry2.GetBBCall() == 5.9f);
	CPPUNIT_ASSERT(entry2.GetNoCall() == 4.8f);

	CHPBackgroundZone zone1;
	data.GetBackgroundZone(0, zone1);
	CPPUNIT_ASSERT(zone1.GetCenterX() == 11.0f);
	CPPUNIT_ASSERT(zone1.GetCenterY() == 17.8f);
	CPPUNIT_ASSERT(zone1.GetBackground() == 56.9f);
	CPPUNIT_ASSERT(zone1.GetSmoothFactor() == 45.89f);

	CHPBackgroundZone zone2;
	data.GetBackgroundZone(1, zone2);
	CPPUNIT_ASSERT(zone2.GetCenterX() == 1.0f);
	CPPUNIT_ASSERT(zone2.GetCenterY() == 7.8f);
	CPPUNIT_ASSERT(zone2.GetBackground() == 6.9f);
	CPPUNIT_ASSERT(zone2.GetSmoothFactor() == 5.89f);
}