コード例 #1
0
void CCHPFileWriter::InitializeForWriting(affxcdf::CCDFFileData &cdf, bool allocateMemory)
{
	InitializeForWriting(
		cdf.GetHeader().GetRows(),
		cdf.GetHeader().GetCols(),
		cdf.GetHeader().GetNumProbeSets(),
		cdf.GetChipType().c_str(),
		cdf.GetProbeSetType(0),
		allocateMemory);
}
コード例 #2
0
void FusionCdfFileTest::testQCObjects(affxcdf::CCDFFileData &gcosCdf, affymetrix_fusion_io::FusionCDFData &fusionCdf)
{
	affxcdf::CCDFQCProbeSetInformation gcosSet;
	affxcdf::CCDFQCProbeInformation gcosCel;

	affymetrix_fusion_io::FusionCDFQCProbeSetInformation fusionSet;
	affymetrix_fusion_io::FusionCDFQCProbeInformation fusionCel;

	CPPUNIT_ASSERT(gcosCdf.GetHeader().GetCols() == fusionCdf.GetHeader().GetCols());
	CPPUNIT_ASSERT(gcosCdf.GetHeader().GetRows() == fusionCdf.GetHeader().GetRows());
	CPPUNIT_ASSERT(gcosCdf.GetHeader().GetNumQCProbeSets() == fusionCdf.GetHeader().GetNumQCProbeSets());
	CPPUNIT_ASSERT(gcosCdf.GetChipType() == fusionCdf.GetChipType());
	CPPUNIT_ASSERT(gcosCdf.GetFileName() == fusionCdf.GetFileName());

	int nps = gcosCdf.GetHeader().GetNumQCProbeSets();
	for (int ips=0; ips<nps; ips++)
	{
		gcosCdf.GetQCProbeSetInformation(ips, gcosSet);
		fusionCdf.GetQCProbeSetInformation(ips, fusionSet);

		CPPUNIT_ASSERT(gcosSet.GetQCProbeSetType() == fusionSet.GetQCProbeSetType());
		CPPUNIT_ASSERT(gcosSet.GetNumCells() == fusionSet.GetNumCells());

		int nc = gcosSet.GetNumCells();
		for (int ic=0; ic<nc; ic++)
		{
			gcosSet.GetProbeInformation(ic, gcosCel);
			fusionSet.GetProbeInformation(ic, fusionCel);

			CPPUNIT_ASSERT(gcosCel.GetX() == fusionCel.GetX());
			CPPUNIT_ASSERT(gcosCel.GetY() == fusionCel.GetY());
			CPPUNIT_ASSERT(gcosCel.GetPLen() == fusionCel.GetPLen());
			CPPUNIT_ASSERT(gcosCel.IsPerfectMatchProbe() == fusionCel.IsPerfectMatchProbe());
			CPPUNIT_ASSERT(gcosCel.IsBackgroundProbe() == fusionCel.IsBackgroundProbe());
		}
	}
}
コード例 #3
0
void FusionCdfFileTest::testRegObjects(affxcdf::CCDFFileData &gcosCdf, affymetrix_fusion_io::FusionCDFData &fusionCdf)
{
	affxcdf::CCDFFileHeader &gcosHeader = gcosCdf.GetHeader();
	affxcdf::CCDFProbeSetInformation gcosSet;
	affxcdf::CCDFProbeGroupInformation gcosGroup;
	affxcdf::CCDFProbeInformation gcosCel;

	affymetrix_fusion_io::FusionCDFFileHeader &fusionHeader = fusionCdf.GetHeader();
	affymetrix_fusion_io::FusionCDFProbeSetInformation fusionSet;
	affymetrix_fusion_io::FusionCDFProbeGroupInformation fusionGroup;
	affymetrix_fusion_io::FusionCDFProbeInformation fusionCel;

	CPPUNIT_ASSERT(gcosHeader.GetCols() == fusionHeader.GetCols());
	CPPUNIT_ASSERT(gcosHeader.GetRows() == fusionHeader.GetRows());
	CPPUNIT_ASSERT(gcosHeader.GetNumProbeSets() == fusionHeader.GetNumProbeSets());
	CPPUNIT_ASSERT(gcosHeader.GetNumQCProbeSets() == fusionHeader.GetNumQCProbeSets());
	CPPUNIT_ASSERT(gcosHeader.GetReference() == fusionHeader.GetReference());
	CPPUNIT_ASSERT(gcosCdf.GetChipType() == fusionCdf.GetChipType());
	CPPUNIT_ASSERT(gcosCdf.GetFileName() == fusionCdf.GetFileName());

	int nps = gcosHeader.GetNumProbeSets();
	for (int ips=0; ips<nps; ips++)
	{
		CPPUNIT_ASSERT(gcosCdf.GetProbeSetName(ips) == fusionCdf.GetProbeSetName(ips));
		CPPUNIT_ASSERT(gcosCdf.GetProbeSetType(ips) == fusionCdf.GetProbeSetType(ips));
	}

	for (int ips=0; ips<nps; ips++)
	{
		gcosCdf.GetProbeSetInformation(ips, gcosSet);
		fusionCdf.GetProbeSetInformation(ips, fusionSet);

		CPPUNIT_ASSERT(gcosSet.GetNumLists() == fusionSet.GetNumLists());
		CPPUNIT_ASSERT(gcosSet.GetNumGroups() == fusionSet.GetNumGroups());
		CPPUNIT_ASSERT(gcosSet.GetNumCells() == fusionSet.GetNumCells());
		CPPUNIT_ASSERT(gcosSet.GetNumCellsPerList() == fusionSet.GetNumCellsPerList());
		CPPUNIT_ASSERT(gcosSet.GetProbeSetNumber() == fusionSet.GetProbeSetNumber());
		CPPUNIT_ASSERT(gcosSet.GetProbeSetType() == fusionSet.GetProbeSetType());
		CPPUNIT_ASSERT(gcosSet.GetDirection() == fusionSet.GetDirection());

		int ng = gcosSet.GetNumGroups();
		for (int ig=0; ig<ng; ig++)
		{
			gcosSet.GetGroupInformation(ig, gcosGroup);
			fusionSet.GetGroupInformation(ig, fusionGroup);

			CPPUNIT_ASSERT(gcosGroup.GetDirection() == fusionGroup.GetDirection());
			CPPUNIT_ASSERT(gcosGroup.GetNumLists() == fusionGroup.GetNumLists());
			CPPUNIT_ASSERT(gcosGroup.GetNumCells() == fusionGroup.GetNumCells());
			CPPUNIT_ASSERT(gcosGroup.GetNumCellsPerList() == fusionGroup.GetNumCellsPerList());
			CPPUNIT_ASSERT(gcosGroup.GetStart() == fusionGroup.GetStart());
			CPPUNIT_ASSERT(gcosGroup.GetStop() == fusionGroup.GetStop());
			CPPUNIT_ASSERT(gcosGroup.GetName() == fusionGroup.GetName());
			CPPUNIT_ASSERT(gcosGroup.GetAlleleCode() == fusionGroup.GetAlleleCode());
			CPPUNIT_ASSERT(gcosGroup.GetWobbleSituation() == fusionGroup.GetWobbleSituation());
			CPPUNIT_ASSERT(gcosGroup.GetChannel() == fusionGroup.GetChannel());
			CPPUNIT_ASSERT(gcosGroup.GetRepType() == fusionGroup.GetRepType());
			
			int nc=gcosGroup.GetNumCells();
			for (int ic=0; ic<nc; ic++)
			{
				gcosGroup.GetCell(ic, gcosCel);
				fusionGroup.GetCell(ic, fusionCel);

				CPPUNIT_ASSERT(gcosCel.GetX() == fusionCel.GetX());
				CPPUNIT_ASSERT(gcosCel.GetY() == fusionCel.GetY());
				CPPUNIT_ASSERT(gcosCel.GetListIndex() == fusionCel.GetListIndex());
				CPPUNIT_ASSERT(gcosCel.GetExpos() == fusionCel.GetExpos());
				CPPUNIT_ASSERT(gcosCel.GetPBase() == fusionCel.GetPBase());
				CPPUNIT_ASSERT(gcosCel.GetTBase() == fusionCel.GetTBase());
				CPPUNIT_ASSERT(gcosCel.GetProbeLength() == fusionCel.GetProbeLength());
				CPPUNIT_ASSERT(gcosCel.GetProbeGrouping() == fusionCel.GetProbeGrouping());
			}
		}
	}
}