当前位置: 首页>>代码示例>>C++>>正文


C++ DataSetHeader::GetNameValParamCnt方法代码示例

本文整理汇总了C++中DataSetHeader::GetNameValParamCnt方法的典型用法代码示例。如果您正苦于以下问题:C++ DataSetHeader::GetNameValParamCnt方法的具体用法?C++ DataSetHeader::GetNameValParamCnt怎么用?C++ DataSetHeader::GetNameValParamCnt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DataSetHeader的用法示例。


在下文中一共展示了DataSetHeader::GetNameValParamCnt方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: AssignmentTest

void DataSetHeaderTest::AssignmentTest()
{
	header->SetName(L"pixel data");
	header->AddUShortColumn(L"Intensity");
	header->SetRowCnt(101);
	ParameterNameValueType t1;
	t1.SetName(L"Scanner");
	t1.SetValueText(L"M10");
	header->AddNameValParam(t1);
	ParameterNameValueType t2;
	t2.SetName(L"Pixel Size");
	t2.SetValueText(L"0.051");
	header->AddNameValParam(t2);

	DataSetHeader assignee;
	assignee = *header;

	// Check that the assignment worked
	CPPUNIT_ASSERT(assignee.GetName() == header->GetName());
	CPPUNIT_ASSERT(assignee.GetColumnCnt() == header->GetColumnCnt());
	CPPUNIT_ASSERT(assignee.GetNameValParamCnt() == header->GetNameValParamCnt());
	CPPUNIT_ASSERT(assignee.GetRowCnt() == header->GetRowCnt());
	CPPUNIT_ASSERT(assignee.GetColumnInfo(0) == header->GetColumnInfo(0));

	ParameterNameValueTypeConstIt nvpAssigneeBegin, nvpAssigneeEnd;
	assignee.GetNameValIterators(nvpAssigneeBegin, nvpAssigneeEnd);
	ParameterNameValueTypeConstIt nvpHeaderBegin, nvpHeaderEnd;
	assignee.GetNameValIterators(nvpHeaderBegin, nvpHeaderEnd);
	CPPUNIT_ASSERT(*nvpAssigneeBegin == *nvpHeaderBegin);
	++nvpAssigneeBegin;
	++nvpHeaderBegin;
	CPPUNIT_ASSERT(*nvpAssigneeBegin == *nvpHeaderBegin);
	++nvpAssigneeBegin;
	++nvpHeaderBegin;
	CPPUNIT_ASSERT(nvpAssigneeBegin == nvpAssigneeEnd);
	CPPUNIT_ASSERT(nvpHeaderBegin == nvpHeaderEnd);

	// TBD: no test of row offset array.
}
开发者ID:einon,项目名称:affymetrix-power-tools,代码行数:39,代码来源:DataSetHeaderTest.cpp

示例2: WriteNameValCnt

void DataSetHeaderWriter::WriteNameValCnt(std::ofstream &os, const DataSetHeader &dc) const
{
	FileOutput::WriteInt32(os, dc.GetNameValParamCnt());
}
开发者ID:HenrikBengtsson,项目名称:Affx-Fusion-SDK,代码行数:4,代码来源:DataSetHeaderWriter.cpp

示例3: testWrite

void CopyNumberResultWriterTest::testWrite()
{
	CopyNumberResultWriter writer;
    const char *fileNames[] = {"test1.cn", "test2.cn"};

    list<ParameterNameValueType> algParams;
    list<ParameterNameValueType> sumParams;
    vector<ColumnInfo> cols;

    writer.MaximumProbeSetNameLength(12);
    writer.MaximumCytoRegionNameLength(12);
	writer.MaximumGenotypeProbeSetNameLength(12);
    writer.AlgName() = "MYALG";
    writer.AlgVersion() = "1.0";
    writer.NumberProbeSets() = 10;
    writer.NumberCytoRegions() = 10;
	writer.NumberGenotypeProbeSets() = 10;
    writer.Columns() = cols;
    writer.AlgParams() = algParams;
    writer.SetChromosomeProbeSetIndexInformation(X_CHR, 0, writer.NumberProbeSets());
    for (int i=0; i<2; i++)
    {
        FusionCELData cel;
        cel.SetFileName("../data/small_cel_file");
        cel.Read(false);

        writer.SummaryParams() = sumParams;
        writer.CreateResultFile(cel, fileNames[i]);
        cel.Close();

        ProbeSetMultiDataCopyNumberData entry;
        char buf[64];
        for (int j=0; j<writer.NumberProbeSets(); j++)
        {
            entry.chr = X_CHR;
            entry.position = j+i;
            snprintf(buf, 64, "%d", j+i);
            entry.name = buf;
            writer.WriteProbeSetResult(entry);
        }
        ProbeSetMultiDataCytoRegionData cy;
        for (int j=0; j<writer.NumberCytoRegions(); j++)
        {
            cy.call = 1;
            cy.confidenceScore = (float)(j+i);
            snprintf(buf, 64, "%d", j+i);
            cy.name = buf;
            writer.WriteCytoRegionResult(cy);
        }
        ProbeSetMultiDataGenotypeData gt;
        for (int j=0; j<writer.NumberGenotypeProbeSets(); j++)
        {
            gt.call = 1;
			gt.confidence = (float)(j+i);
            snprintf(buf, 64, "%d", j+i);
            gt.name = buf;
			writer.WriteGenotypeProbeSetResult(gt);
        }
        writer.CloseResultsFile();
    }

    for (int i=0; i<2; i++)
    {
        FusionCHPData *chp = FusionCHPDataReg::Read(fileNames[i]);
	    CPPUNIT_ASSERT(chp != NULL);
	    FusionCHPMultiDataData *genoChp = FusionCHPMultiDataData::FromBase(chp); 
	    CPPUNIT_ASSERT(genoChp != NULL);

	    CPPUNIT_ASSERT(genoChp->GetAlgName() == L"MYALG");
	    CPPUNIT_ASSERT(genoChp->GetAlgVersion() == L"1.0");
	    CPPUNIT_ASSERT(genoChp->GetArrayType() == L"Hg-small");
	    CPPUNIT_ASSERT(genoChp->GetEntryCount(ExpressionMultiDataType) == 0);
	    CPPUNIT_ASSERT(genoChp->GetEntryCount(GenotypeMultiDataType) == 10);
	    CPPUNIT_ASSERT(genoChp->GetEntryCount(CopyNumberMultiDataType) == 10);
	    CPPUNIT_ASSERT(genoChp->GetEntryCount(CytoMultiDataType) == 10);

        DataSetHeader *dsh = genoChp->GetDataSetHeader(CopyNumberMultiDataType);
        CPPUNIT_ASSERT(dsh->GetNameValParamCnt() == 3);
        ParameterNameValueTypeConstIt begin;
        ParameterNameValueTypeConstIt end;
        ParameterNameValueTypeConstIt it;
        dsh->GetNameValIterators(begin, end);
        it = begin;
        CPPUNIT_ASSERT(it->GetValueInt32() == 0);
        ++it;
        CPPUNIT_ASSERT(it->GetValueInt32() == 10);
        ++it;
        CPPUNIT_ASSERT(it->GetValueAscii() == "X");
        
        ProbeSetMultiDataCopyNumberData entry;
        char buf[64];
        for (int j=0; j<10; j++)
        {
            genoChp->GetCopyNumberEntry(CopyNumberMultiDataType, j, entry);
            CPPUNIT_ASSERT(entry.chr == X_CHR);
            CPPUNIT_ASSERT(entry.position == j+i);
            snprintf(buf, 64, "%d", j+i);
            CPPUNIT_ASSERT(entry.name.compare(buf) == 0);
        }

//.........这里部分代码省略.........
开发者ID:,项目名称:,代码行数:101,代码来源:


注:本文中的DataSetHeader::GetNameValParamCnt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。