本文整理汇总了C++中GenericDataHeader::AddNameValParam方法的典型用法代码示例。如果您正苦于以下问题:C++ GenericDataHeader::AddNameValParam方法的具体用法?C++ GenericDataHeader::AddNameValParam怎么用?C++ GenericDataHeader::AddNameValParam使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GenericDataHeader
的用法示例。
在下文中一共展示了GenericDataHeader::AddNameValParam方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WriteSmallCelFileWithAPartialDatHeaderTest
void TestFileGenerator::WriteSmallCelFileWithAPartialDatHeaderTest()
{
CelFileData data("small_cel_file_partial_datheader");
// Write
ParameterNameValueType nvt;
GenericDataHeader datHdr;
datHdr.SetFileId(AffymetrixGuid::GenerateNewGuid());
datHdr.SetFileTypeId("affymetrix-calvin-scan-acquisition");
datHdr.SetFileCreationTime(L"2004-07-01T13:14:15Z");
nvt.SetName(L"affymetrix-partial-dat-header");
std::wstring datHeaderString = L" small_cel_file_partial_datheader:CLS=25 RWS=25 XIN=1 YIN=1 VE=0 0 05/19/05 02:45:59 ScannerID: ScannerTyp \x14 \x14 Hg-Small.1sq \x14 \x14 \x14 \x14 \x14 570 \x14 45.200001 \x14 0.340000 \x14 1.0900 \x14 3";
nvt.SetValueText(datHeaderString);
datHdr.AddNameValParam(nvt);
nvt.SetName(L"affymetrix-max-pixel-intensity");
nvt.SetValueUInt16(46001);
datHdr.AddNameValParam(nvt);
nvt.SetName(L"affymetrix-min-pixel-intensity");
nvt.SetValueUInt16(1);
datHdr.AddNameValParam(nvt);
// Add DAT GenericDataHeader as parent.
data.GetFileHeader()->GetGenericDataHdr()->AddParent(datHdr);
WriteRemaingSmallCelFileWithGridParameters(data);
}
示例2: AddStandardGenericDataHeader
void TestFileGenerator::AddStandardGenericDataHeader(GenericDataHeader& gdh)
{
// Fill the GenericDataHeader.
gdh.SetFileTypeId(SCAN_ACQUISITION_DATA_TYPE);
gdh.SetFileId("test-dat-guid");
gdh.SetFileCreationTime(L"2004-07-04T11:12:13Z");
gdh.SetLocale(L"en-US");
ParameterNameValueType nvt;
nvt.SetName(ARRAY_TYPE_PARAM_NAME);
nvt.SetValueText(L"Hg-U133A");
gdh.AddNameValParam(nvt);
nvt.SetName(ARRAY_BARCODE_PARAM_NAME);
nvt.SetValueText(L"Barcode");
gdh.AddNameValParam(nvt);
nvt.SetName(L"Parameter1");
nvt.SetValueText(L"Value1");
gdh.AddNameValParam(nvt);
GenericDataHeader gdhParent;
gdhParent.SetFileTypeId(ARRAY_TYPE_IDENTIFIER);
gdhParent.SetFileId("test-array-guid");
gdhParent.SetFileCreationTime(L"2004-07-01T13:14:15Z");
gdhParent.SetLocale(L"en-US");
nvt.SetName(ARRAY_TYPE_PARAM_NAME);
nvt.SetValueText(L"Hg-U133A");
gdhParent.AddNameValParam(nvt);
nvt.SetName(ARRAY_LOT_PARAM_NAME);
nvt.SetValueText(L"Thanks alot");
gdhParent.AddNameValParam(nvt);
gdh.AddParent(gdhParent);
}
示例3: SetWStringToGenericHdr
void CHPQuantificationData::SetWStringToGenericHdr(const std::wstring& name, const std::wstring value, int32_t reserve)
{
ParameterNameValueType paramType;
paramType.SetName(name);
paramType.SetValueText(value, reserve);
GenericDataHeader* hdr = genericData.Header().GetGenericDataHdr();
hdr->AddNameValParam(paramType);
}
示例4: SetFloatToGenericHdr
void CHPData::SetFloatToGenericHdr(const std::wstring& name, float value)
{
ParameterNameValueType paramType;
paramType.SetName(name);
paramType.SetValueFloat(value);
GenericDataHeader* hdr = genericData.Header().GetGenericDataHdr();
hdr->AddNameValParam(paramType);
}
示例5: SetRefSequence
void CDFData::SetRefSequence(const std::string &seq)
{
GenericDataHeader* gPtr = genericData.Header().GetGenericDataHdr();
ParameterNameValueType paramType;
paramType.SetName(CDF_REFSEQ_PARAM);
paramType.SetValueAscii(seq);
gPtr->AddNameValParam(paramType);
}
示例6:
void CDFData::SetUInt32ToGenericHdr(const std::wstring& name, u_int32_t value)
{
ParameterNameValueType paramType;
paramType.SetName(name);
paramType.SetValueUInt32(value);
GenericDataHeader* hdr = genericData.Header().GetGenericDataHdr();
hdr->AddNameValParam(paramType);
}
示例7: AddSummaryParams
void CHPQuantificationData::AddSummaryParams(const ParameterNameValueTypeList& params)
{
ParameterNameValueType param;
GenericDataHeader* hdr = genericData.Header().GetGenericDataHdr();
for (ParameterNameValueTypeList::const_iterator it=params.begin(); it != params.end(); it++)
{
param = *it;
param.SetName(CHIP_SUMMARY_PARAMETER_NAME_PREFIX_S + param.GetName());
hdr->AddNameValParam(param);
}
}
示例8: AddAppMetaInfo
void CHPMultiDataData::AddAppMetaInfo(const ParameterNameValueTypeList& params)
{
ParameterNameValueType param;
GenericDataHeader* hdr = genericData.Header().GetGenericDataHdr();
for (ParameterNameValueTypeList::const_iterator it=params.begin(); it != params.end(); ++it)
{
param = *it;
param.SetName(APPLICATION_META_INFO_PREFIX_S + param.GetName());
hdr->AddNameValParam(param);
}
}
示例9: AddAlgParams
void CHPMultiDataData::AddAlgParams(const ParameterNameValueTypeList& params)
{
ParameterNameValueType param;
GenericDataHeader* hdr = genericData.Header().GetGenericDataHdr();
for (ParameterNameValueTypeList::const_iterator it=params.begin(); it != params.end(); it++)
{
param = *it;
param.SetName(ALGORITHM_PARAM_NAME_PREFIX_S + param.GetName());
hdr->AddNameValParam(param);
}
}
示例10: WriteSmallCelFileWithAFullDatHeaderTest
void TestFileGenerator::WriteSmallCelFileWithAFullDatHeaderTest() // Files converted from GCOS will have a full DatHeader
{
CelFileData data("small_cel_file_full_datheader");
// Write
ParameterNameValueType nvt;
GenericDataHeader datHdr;
datHdr.SetFileId(AffymetrixGuid::GenerateNewGuid());
datHdr.SetFileTypeId("affymetrix-calvin-scan-acquisition");
datHdr.SetFileCreationTime(L"2004-07-01T13:14:15Z");
nvt.SetName(L"affymetrix-dat-header");
std::wstring datHeaderString = L"[45..56789] small_cel_file_full_datheader:CLS=25 RWS=25 XIN=1 YIN=1 VE=0 0 05/19/05 02:45:59 ScannerID: ScannerTyp \x14 \x14 Hg-Small.1sq \x14 \x14 \x14 \x14 \x14 570 \x14 45.200001 \x14 0.340000 \x14 1.0900 \x14 3";
nvt.SetValueText(datHeaderString);
datHdr.AddNameValParam(nvt);
// Add DAT GenericDataHeader as parent.
data.GetFileHeader()->GetGenericDataHdr()->AddParent(datHdr);
WriteRemaingSmallCelFileWithGridParameters(data);
}
示例11: 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 +
//.........这里部分代码省略.........
示例12: CreateResultFile
/*
* Create a results file with the CEL file header and other parameters.
*/
void CopyNumberResultWriter::CreateResultFile(affymetrix_fusion_io::FusionCELData& cel, const std::string& fileName)
{
try
{
// Create the results file with the header.
CHPMultiDataData *data = new CHPMultiDataData(fileName);
data->SetEntryCount(CopyNumberMultiDataType, numberProbeSets, maxProbeSetNameLength[CopyNumberMultiDataType], columns);
if (numberCytoRegions > 0)
data->SetEntryCount(CytoMultiDataType, numberCytoRegions, maxProbeSetNameLength[CytoMultiDataType],cytoRegionColumns);
if (numberGenotypeProbeSets > 0)
data->SetEntryCount(GenotypeMultiDataType, numberGenotypeProbeSets, maxProbeSetNameLength[GenotypeMultiDataType], genotypeColumns);
data->SetAlgName(StringUtils::ConvertMBSToWCS(algName));
data->SetAlgVersion(StringUtils::ConvertMBSToWCS(algVersion));
data->SetArrayType(cel.GetChipType());
GenericDataHeader *gdh = data->GetFileHeader()->GetGenericDataHdr();
ParameterNameValueType param;
param.SetName(PROGRAM_NAME);
param.SetValueText(StringUtils::ConvertMBSToWCS(programName));
gdh->AddNameValParam(param);
param.SetName(L"program-version");
param.SetValueText(StringUtils::ConvertMBSToWCS(programVersion));
gdh->AddNameValParam(param);
param.SetName(PROGRAM_COMPANY);
param.SetValueText(StringUtils::ConvertMBSToWCS(programCompany));
gdh->AddNameValParam(param);
ParameterNameValueTypeList params = algParams;
param.SetName(L"ArraySet");
param.SetValueText(cel.GetChipType());
params.push_back(param);
data->AddAlgParams(params);
data->AddSummaryParams(summaryParams);
DataSetHeader *dsh = data->GetDataSetHeader(CopyNumberMultiDataType);
for (ParameterNameValueTypeList::iterator it=chrStartStop.begin(); it!=chrStartStop.end(); it++)
dsh->AddNameValParam(*it);
GenericData *gdata = cel.GetGenericData();
if (gdata != NULL)
gdh->AddParent(*gdata->Header().GetGenericDataHdr());
CHPMultiDataFileWriter *writer = new CHPMultiDataFileWriter(*data);
delete writer;
delete data;
// Create a buffer writer object
outputFiles.clear();
outputFiles.push_back(fileName);
vector<MultiDataType> dataTypes;
dataTypes.push_back(CopyNumberMultiDataType);
if (numberCytoRegions > 0)
dataTypes.push_back(CytoMultiDataType);
if (numberGenotypeProbeSets > 0)
dataTypes.push_back(GenotypeMultiDataType);
bufferWriter = new CHPMultiDataFileBufferWriter();
bufferWriter->Initialize(&outputFiles, dataTypes, maxProbeSetNameLength);
}
catch (CalvinException &ex)
{
string err = "Error creating the output file: " + fileName;
wstring msg = ex.ToString();
if (msg.empty() == false)
err += " " + StringUtils::ConvertWCSToMBS(msg);
throw err;
}
catch (...)
{
string err = "Error creating the output file: " + fileName;
throw err;
}
}