本文整理汇总了C++中ParameterNameValueType::GetParameterType方法的典型用法代码示例。如果您正苦于以下问题:C++ ParameterNameValueType::GetParameterType方法的具体用法?C++ ParameterNameValueType::GetParameterType怎么用?C++ ParameterNameValueType::GetParameterType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParameterNameValueType
的用法示例。
在下文中一共展示了ParameterNameValueType::GetParameterType方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetDatHeader
/*
* Get the DAT header from the DAT file header object.
*/
string CELConversionUtilities::GetDatHeader(CelFileData &inFile)
{
std::wstring datHeader;
GenDataHdrVectorIt begin, end;
inFile.GetFileHeader()->GetGenericDataHdr()->GetParentIterators(begin, end);
// Find the DAT generic header
for (GenDataHdrVectorIt ii = begin; ii != end; ++ii)
{
std::string s = ii->GetFileTypeId();
if (ii->GetFileTypeId() == SCAN_ACQUISITION_DATA_TYPE)
{
// found the right header, now look for the parameter
ParameterNameValueType nvt;
if (ii->FindNameValParam(DAT_HEADER_PARAM_NAME, nvt))
{
if (nvt.GetParameterType() == ParameterNameValueType::TextType)
datHeader = nvt.GetValueText();
}
else if (ii->FindNameValParam(PARTIAL_DAT_HEADER_PARAM_NAME, nvt))
{
if (nvt.GetParameterType() == ParameterNameValueType::TextType)
{
std::wstring partialDatHeader = nvt.GetValueText();
u_int16_t min = 0;
u_int16_t max = 0;
// Find the max and min parameters and append to the string.
if (ii->FindNameValParam(MAX_PIXEL_INTENSITY_PARAM_NAME, nvt))
{
if (nvt.GetParameterType() == ParameterNameValueType::UInt16Type)
max = nvt.GetValueUInt16();
}
if (ii->FindNameValParam(MIN_PIXEL_INTENSITY_PARAM_NAME, nvt))
{
if (nvt.GetParameterType() == ParameterNameValueType::UInt16Type)
min = nvt.GetValueUInt16();
}
wchar_t buf[30];
FormatString2(buf, 30, L"[%d..%d]", min, max);
datHeader = buf;
datHeader += partialDatHeader;
}
}
break;
}
}
return StringUtils::ConvertWCSToMBS(datHeader);
}
示例2: testRead
void CHPMultiDataFileReaderTest::testRead()
{
affymetrix_calvin_data::ProbeSetMultiDataExpressionData ex;
affymetrix_calvin_data::ProbeSetMultiDataGenotypeData gn;
ParameterNameValueType param;
CHPMultiDataData data2;
CHPMultiDataFileReader reader;
reader.SetFilename("../data/CHP_MultiData_file");
reader.Read(data2);
CPPUNIT_ASSERT(data2.GetAlgName() == L"sig");
CPPUNIT_ASSERT(data2.GetAlgVersion() == L"1.0");
CPPUNIT_ASSERT(data2.GetArrayType() == L"test3");
CPPUNIT_ASSERT(data2.GetEntryCount(ExpressionMultiDataType) == 1);
CPPUNIT_ASSERT(data2.GetEntryCount(GenotypeMultiDataType) == 2);
// expression
CPPUNIT_ASSERT(data2.GetNumMetricColumns(ExpressionMultiDataType) == 0);
data2.GetExpressionEntry(ExpressionMultiDataType, 0, ex);
CPPUNIT_ASSERT_DOUBLES_EQUAL(ex.quantification, 10.0f, 0.0001f);
CPPUNIT_ASSERT(ex.name == "ex1");
// genotype
CPPUNIT_ASSERT(data2.GetNumMetricColumns(GenotypeMultiDataType) == 2);
CPPUNIT_ASSERT(data2.GetMetricColumnName(GenotypeMultiDataType, 0) == L"int");
CPPUNIT_ASSERT(data2.GetMetricColumnName(GenotypeMultiDataType, 1) == L"float");
data2.GetGenotypeEntry(GenotypeMultiDataType, 0, gn);
CPPUNIT_ASSERT(gn.call == 1);
CPPUNIT_ASSERT_DOUBLES_EQUAL(gn.confidence, 11.0f, 0.0001f);
CPPUNIT_ASSERT(gn.name == "gn1");
CPPUNIT_ASSERT(gn.metrics.size() == 2);
param = gn.metrics[0];
CPPUNIT_ASSERT(param.GetParameterType() == ParameterNameValueType::Int32Type);
CPPUNIT_ASSERT(param.GetValueInt32() == 1);
param = gn.metrics[1];
CPPUNIT_ASSERT(param.GetParameterType() == ParameterNameValueType::FloatType);
CPPUNIT_ASSERT_DOUBLES_EQUAL(param.GetValueFloat(), 2.0f, 0.00001f);
data2.GetGenotypeEntry(GenotypeMultiDataType, 1, gn);
CPPUNIT_ASSERT(gn.call == 2);
CPPUNIT_ASSERT_DOUBLES_EQUAL(gn.confidence, 22.0f, 0.0001f);
CPPUNIT_ASSERT(gn.name == "gn2");
CPPUNIT_ASSERT(gn.metrics.size() == 2);
param = gn.metrics[0];
CPPUNIT_ASSERT(param.GetParameterType() == ParameterNameValueType::Int32Type);
CPPUNIT_ASSERT(param.GetValueInt32() == 2);
param = gn.metrics[1];
CPPUNIT_ASSERT(param.GetParameterType() == ParameterNameValueType::FloatType);
CPPUNIT_ASSERT_DOUBLES_EQUAL(param.GetValueFloat(), 3.0f, 0.00001f);
}
示例3: GetDatHeader
std::wstring CalvinCELDataAdapter::GetDatHeader()
{
std::wstring datHeader;
//GenDataHdrVectorIt begin, end;
GenericDataHeader* gdh = calvinCel.GetFileHeader()->GetGenericDataHdr()->FindParent(SCAN_ACQUISITION_DATA_TYPE);
if (gdh)
{
// found the right header, now look for the parameter
ParameterNameValueType nvt;
if (gdh->FindNameValParam(DAT_HEADER_PARAM_NAME, nvt))
{
if (nvt.GetParameterType() == ParameterNameValueType::TextType)
datHeader = nvt.GetValueText();
}
else if (gdh->FindNameValParam(PARTIAL_DAT_HEADER_PARAM_NAME, nvt))
{
if (nvt.GetParameterType() == ParameterNameValueType::TextType)
{
std::wstring partialDatHeader = nvt.GetValueText();
u_int16_t min = 0;
u_int16_t max = 0;
// Find the max and min parameters and append to the string.
if (gdh->FindNameValParam(MAX_PIXEL_INTENSITY_PARAM_NAME, nvt))
{
if (nvt.GetParameterType() == ParameterNameValueType::UInt16Type)
max = nvt.GetValueUInt16();
}
if (gdh->FindNameValParam(MIN_PIXEL_INTENSITY_PARAM_NAME, nvt))
{
if (nvt.GetParameterType() == ParameterNameValueType::UInt16Type)
min = nvt.GetValueUInt16();
}
wchar_t buf[30]=L"";
FormatString2(buf, 30, L"[%d..%d]", min, max);
datHeader = buf;
datHeader += partialDatHeader;
}
}
}
return datHeader;
}
示例4: SetCellMargin
void CELConversionUtilities::SetCellMargin(CelFileData &inFile, CCELFileData &outFile, int defaultValue)
{
ParameterNameValueType nvt;
if (inFile.FindAlgorithmParameter(L"CellMargin", nvt))
{
if (nvt.GetParameterType() == ParameterNameValueType::Int32Type)
{
outFile.GetHeader().SetMargin(nvt.GetValueInt32());
}
else if(nvt.GetParameterType() == ParameterNameValueType::AsciiType)
{
outFile.GetHeader().SetMargin(atoi(nvt.GetValueAscii().c_str()));
}
}
else
{
outFile.GetHeader().SetMargin(defaultValue);
}
}
示例5: GetGrid
/*
* Get the grid from the parameters.
*/
GridCoordinatesType CELConversionUtilities::GetGrid(CelFileData &inFile)
{
GridCoordinatesType grid;
ParameterNameValueType nvt;
grid.lowerleft.x = grid.lowerleft.y = 0;
grid.upperleft.x = grid.upperleft.y = 0;
grid.lowerright.x = grid.lowerright.y = 0;
grid.upperright.x = grid.upperright.y = 0;
if (inFile.FindAlgorithmParameter(GRIDULX_PARAM_NAME, nvt) && nvt.GetParameterType() == ParameterNameValueType::FloatType)
grid.upperleft.x = (int) nvt.GetValueFloat();
if (inFile.FindAlgorithmParameter(GRIDULY_PARAM_NAME, nvt) && nvt.GetParameterType() == ParameterNameValueType::FloatType)
grid.upperleft.y = (int) nvt.GetValueFloat();
if (inFile.FindAlgorithmParameter(GRIDURX_PARAM_NAME, nvt) && nvt.GetParameterType() == ParameterNameValueType::FloatType)
grid.upperright.x = (int) nvt.GetValueFloat();
if (inFile.FindAlgorithmParameter(GRIDURY_PARAM_NAME, nvt) && nvt.GetParameterType() == ParameterNameValueType::FloatType)
grid.upperright.y = (int) nvt.GetValueFloat();
if (inFile.FindAlgorithmParameter(GRIDLRX_PARAM_NAME, nvt) && nvt.GetParameterType() == ParameterNameValueType::FloatType)
grid.lowerright.x = (int) nvt.GetValueFloat();
if (inFile.FindAlgorithmParameter(GRIDLRY_PARAM_NAME, nvt) && nvt.GetParameterType() == ParameterNameValueType::FloatType)
grid.lowerright.y = (int) nvt.GetValueFloat();
if (inFile.FindAlgorithmParameter(GRIDLLX_PARAM_NAME, nvt) && nvt.GetParameterType() == ParameterNameValueType::FloatType)
grid.lowerleft.x = (int) nvt.GetValueFloat();
if (inFile.FindAlgorithmParameter(GRIDLLY_PARAM_NAME, nvt) && nvt.GetParameterType() == ParameterNameValueType::FloatType)
grid.lowerleft.y = (int) nvt.GetValueFloat();
return grid;
}
示例6: GetCellMargin
int CalvinCELDataAdapter::GetCellMargin()
{
ParameterNameValueType nvt;
if (calvinCel.FindAlgorithmParameter(CELLMARGIN_PARAM_NAME, nvt))
{
switch(nvt.GetParameterType())
{
case ParameterNameValueType::Int32Type:
return nvt.GetValueInt32();
break;
case ParameterNameValueType::Int16Type:
return (int)nvt.GetValueInt16();
break;
case ParameterNameValueType::Int8Type:
return (int)nvt.GetValueInt8();
break;
case ParameterNameValueType::UInt32Type:
return (int)nvt.GetValueUInt32();
break;
case ParameterNameValueType::UInt16Type:
return (int)nvt.GetValueUInt16();
break;
case ParameterNameValueType::UInt8Type:
return (int)nvt.GetValueUInt8();
break;
case ParameterNameValueType::AsciiType:
return (int)atoi(nvt.GetValueAscii().c_str());
default:
return 0;
break;
}
}
else
{
return 0;
}
}
示例7: finish
/**
* No more probesets will be processed, this is a chance to finish outputting
* results and clean up.
* @param qMethod - Quantification method that was used.
* @return true if success, false otherwise.
*/
bool QuantMethodExprCCCHPReport::finish(QuantMethod &qMethod)
{
// Sanity to check we saw all the probe sets we were expecting.
if (m_CurrentProbeSetCount != m_Info.m_NumProbeSets) {
Err::errAbort("QuantMethodExprCCCHPReport::finish() - Expecting: " + ToStr(m_Info.m_NumProbeSets) +
" but got: " + ToStr(m_CurrentProbeSetCount) + ". Command Console CHP file will be corrupt.");
}
// Flush remaining signal entries in the buffer.
m_ExpressionQuantificationBufferWriter.FlushBuffer();
// Rewrite CHP files to get chip summary entires
Verbose::out(1,"Creating final files for CHP output");
Verbose::progressBegin(1, ToStr("Finalizing Expression CHP Files"),
m_CHPFileNames.size(), 1, m_CHPFileNames.size());
try {
for (unsigned int chip = 0; chip < m_CHPFileNames.size(); chip++) {
// open up tmp chp file to pull results from
GenericData data;
GenericFileReader reader;
std::string filename = m_CHPFileNames[chip]+".tmp";
reader.SetFilename(filename);
reader.ReadHeader(data);
GenericDataHeader* hdr = data.Header().GetGenericDataHdr();
GenericDataHeader updateHdr;
for (int source = 0; source < m_ChipSummaries.size(); source++) {
ChipSummary::metricDefVec_t metricDefs = m_ChipSummaries[source]->getMetricDefs();
for (int i = 0; i < metricDefs.size(); i++) {
ChipSummary::Metric metric;
if (!m_ChipSummaries[source]->getMetric(chip, metricDefs[i].m_name, metric)) {
Err::errAbort("QuantMethodExprCCCHPReport: metric '" + metricDefs[i].m_name +
"' was not found");
}
std::wstring mName(CHIP_SUMMARY_PARAMETER_NAME_PREFIX);
mName += StringUtils::ConvertMBSToWCS(metric.m_Name);
ParameterNameValueType param;
if (hdr->FindNameValParam(mName, param) == false) {
Err::errAbort("QuantMethodExprCCCHPReport: metric name '" + StringUtils::ConvertWCSToMBS(mName) +
"' could not be found in the header of " + filename);
}
switch (param.GetParameterType()) {
case ParameterNameValueType::Int8Type:
param.SetValueInt8((int8_t)metric.m_Integer);
break;
case ParameterNameValueType::UInt8Type:
param.SetValueUInt8((u_int8_t)metric.m_Integer);
break;
case ParameterNameValueType::Int16Type:
param.SetValueInt16((int16_t)metric.m_Integer);
break;
case ParameterNameValueType::UInt16Type:
param.SetValueUInt16((u_int16_t)metric.m_Integer);
break;
case ParameterNameValueType::Int32Type:
param.SetValueInt32((int32_t)metric.m_Integer);
break;
case ParameterNameValueType::UInt32Type:
param.SetValueUInt32((u_int32_t)metric.m_Integer);
break;
case ParameterNameValueType::FloatType:
param.SetValueFloat((float)metric.m_Double);
break;
case ParameterNameValueType::TextType:
param.SetValueText(StringUtils::ConvertMBSToWCS(metric.m_String), (int) metric.m_String.length());
break;
case ParameterNameValueType::AsciiType:
if (metric.m_String.size() > 256) {
Err::errAbort("QuantMethodExprCCCHPReport: string header parameter too long, name = '" +
metric.m_Name + "', value = '" + metric.m_String + "'");
}
param.SetValueAscii(metric.m_String, (int) metric.m_String.length());
break;
default:
Err::errAbort("QuantMethodExprCCCHPReport: unknown header parameter type found in file " +
filename);
}
updateHdr.AddNameValParam(param);
}
}
std::ofstream os;
Fs::aptOpen(os, filename, std::ios::out|std::ios::binary|std::ios::in);
if (!os) {
Err::errAbort("QuantMethodExprCCCHPReport: file " + filename +
//.........这里部分代码省略.........
示例8: GetGridCorners
/*
* Get the grid coordinates.
*/
affymetrix_fusion_io::FGridCoords CalvinCELDataAdapter::GetGridCorners()
{
affymetrix_fusion_io::FGridCoords zeroGrid;
affymetrix_fusion_io::FGridCoords grid;
ParameterNameValueType nvt;
if (calvinCel.FindAlgorithmParameter(GRIDULX_PARAM_NAME, nvt) && nvt.GetParameterType() == ParameterNameValueType::FloatType)
{
grid.upperleft.x = nvt.GetValueFloat();
}
else
{
return zeroGrid;
}
if (calvinCel.FindAlgorithmParameter(GRIDULY_PARAM_NAME, nvt) && nvt.GetParameterType() == ParameterNameValueType::FloatType)
{
grid.upperleft.y = nvt.GetValueFloat();
}
else
{
return zeroGrid;
}
if (calvinCel.FindAlgorithmParameter(GRIDURX_PARAM_NAME, nvt) && nvt.GetParameterType() == ParameterNameValueType::FloatType)
{
grid.upperright.x = nvt.GetValueFloat();
}
else
{
return zeroGrid;
}
if (calvinCel.FindAlgorithmParameter(GRIDURY_PARAM_NAME, nvt) && nvt.GetParameterType() == ParameterNameValueType::FloatType)
{
grid.upperright.y = nvt.GetValueFloat();
}
else
{
return zeroGrid;
}
if (calvinCel.FindAlgorithmParameter(GRIDLRX_PARAM_NAME, nvt) && nvt.GetParameterType() == ParameterNameValueType::FloatType)
{
grid.lowerright.x = nvt.GetValueFloat();
}
else
{
return zeroGrid;
}
if (calvinCel.FindAlgorithmParameter(GRIDLRY_PARAM_NAME, nvt) && nvt.GetParameterType() == ParameterNameValueType::FloatType)
{
grid.lowerright.y = nvt.GetValueFloat();
}
else
{
return zeroGrid;
}
if (calvinCel.FindAlgorithmParameter(GRIDLLX_PARAM_NAME, nvt) && nvt.GetParameterType() == ParameterNameValueType::FloatType)
{
grid.lowerleft.x = nvt.GetValueFloat();
}
else
{
return zeroGrid;
}
if (calvinCel.FindAlgorithmParameter(GRIDLLY_PARAM_NAME, nvt) && nvt.GetParameterType() == ParameterNameValueType::FloatType)
{
grid.lowerleft.y = nvt.GetValueFloat();
}
else
{
return zeroGrid;
}
return grid;
}