本文整理汇总了C++中ParameterNameValueType::SetValueAscii方法的典型用法代码示例。如果您正苦于以下问题:C++ ParameterNameValueType::SetValueAscii方法的具体用法?C++ ParameterNameValueType::SetValueAscii怎么用?C++ ParameterNameValueType::SetValueAscii使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParameterNameValueType
的用法示例。
在下文中一共展示了ParameterNameValueType::SetValueAscii方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}
示例2: SetChromosomeProbeSetIndexInformation
/*
* Store the start index and count of probe sets for the given chromosome.
*/
void CopyNumberResultWriter::SetChromosomeProbeSetIndexInformation(u_int8_t chr, int startIndex, int count)
{
ostringstream str;
str << (int) chr;
wstring schr = StringUtils::ConvertMBSToWCS(str.str());
ParameterNameValueType param;
param.SetName(schr + L":start");
param.SetValueInt32(startIndex);
chrStartStop.push_back(param);
param.SetName(schr + L":count");
param.SetValueInt32(count);
chrStartStop.push_back(param);
param.SetName(schr + L":display");
param.SetValueAscii(ChromosomeToString(chr));
chrStartStop.push_back(param);
}
示例3: 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 +
//.........这里部分代码省略.........
示例4: prepare
//.........这里部分代码省略.........
Err::errAbort("Unable to read CEL file: "+FS_QUOTE_PATH(tmp_unc_name));
}
GenericData *gdata = cel.GetGenericData();
if (gdata != NULL) {
data->GetFileHeader()->GetGenericDataHdr()->AddParent(*gdata->Header().GetGenericDataHdr());
}
cel.Close();
}
catch (...) {
Err::errAbort("Unable to read CEL file: "+FS_QUOTE_PATH(tmp_unc_name));
}
data->SetEntryCount(m_Info.m_NumProbeSets, maxProbeSetNameLength);
data->SetAlgName(algName);
data->SetAlgVersion(algVersion);
data->SetArrayType(chipType);
param.SetName(L"program-name");
param.SetValueText(StringUtils::ConvertMBSToWCS(m_Info.m_ProgramName));
data->GetGenericData().Header().GetGenericDataHdr()->AddNameValParam(param);
param.SetName(L"program-version");
param.SetValueText(StringUtils::ConvertMBSToWCS(m_Info.m_ProgramVersion));
data->GetGenericData().Header().GetGenericDataHdr()->AddNameValParam(param);
param.SetName(L"program-company");
param.SetValueText(StringUtils::ConvertMBSToWCS(m_Info.m_ProgramCompany));
data->GetGenericData().Header().GetGenericDataHdr()->AddNameValParam(param);
// Add algorithm parameters to list.
ParameterNameValueTypeList paramList;
assert(m_Info.m_ParamNames.size() == m_Info.m_ParamValues.size());
for (int i=0; i<m_Info.m_ParamNames.size(); i++) {
if (m_Info.m_ParamValues[i].length() > 0) {
param.SetName(StringUtils::ConvertMBSToWCS(m_Info.m_ParamNames[i]));
param.SetValueText(StringUtils::ConvertMBSToWCS(m_Info.m_ParamValues[i]));
paramList.push_back(param);
}
}
// Add list of all CEL GUIDs in batch
///@todo should this be computed by the engine and passed in via AnalysisInfo?
string prefix = "apt-opt-";
for (int chip=0; chip<m_CHPFileNames.size(); chip++) {
if (m_celGuids[chip].empty() == false) {
string paramName = prefix + "cel-guid-" + ToStr(chip+1);
param.SetName(StringUtils::ConvertMBSToWCS(paramName));
param.SetValueText(StringUtils::ConvertMBSToWCS(m_celGuids[chip]));
paramList.push_back(param);
}
}
data->AddAlgParams(paramList);
// Add the run report parameters to the list
ParameterNameValueTypeList summaryParamList;
std::string blankStr(256, ' ');
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++) {
param.SetName(StringUtils::ConvertMBSToWCS(metricDefs[i].m_name));
if (metricDefs[i].m_type == ChipSummary::Metric::Double) {
param.SetValueFloat(-1.0);
}
else if (metricDefs[i].m_type == ChipSummary::Metric::Integer) {
param.SetValueInt32(-1);
}
else if (metricDefs[i].m_type == ChipSummary::Metric::String) {
param.SetValueAscii(blankStr);
}
else {
Err::errAbort("QuantMethodExprCCCHPReport: Unable to handle unknown type: " +
ToStr(metricDefs[i].m_type) );
}
summaryParamList.push_back(param);
}
}
data->AddSummaryParams(summaryParamList);
ProbeSetQuantificationData entry;
CHPQuantificationFileWriter writer(*data);
writer.SeekToDataSet(); // seek to data table location
for (int index=0; index<m_Info.m_ProbesetNames.size(); index++) {
if (m_Info.m_ProbesetDisplayNames.size() > 0 && m_Info.m_ProbesetDisplayNames[index] != NULL)
entry.name = m_Info.m_ProbesetDisplayNames[index];
else
entry.name = m_Info.m_ProbesetNames[index];
entry.quantification = 0.0f;
writer.WriteEntry(entry);
}
delete data;
}
catch (...) {
Err::errAbort("QuantMethodExprCHPReport::prepare() - Unable to write header and/or precreate signal entries to file: " + m_CHPFileNames[chip] + ".tmp");
}
}
// initialize expression signal buffer writer
m_ExpressionQuantificationBufferWriter.Initialize(&m_TmpChpFiles);
return true;
}
示例5: data
void CalvinCHPMultiDataFileUpdaterTest::CreateReferenceFile2()
{
CHPMultiDataData data(TEST2_FILE);
vector<ColumnInfo> cols;
ParameterNameValueType nv;
ByteColumn bcol(L"byte");
cols.push_back(bcol);
UByteColumn ubcol(L"ubyte");
cols.push_back(ubcol);
ShortColumn scol(L"short");
cols.push_back(scol);
UShortColumn uscol(L"ushort");
cols.push_back(uscol);
IntColumn icol(L"int");
cols.push_back(icol);
UIntColumn uicol(L"uint");
cols.push_back(uicol);
FloatColumn fcol(L"float");
cols.push_back(fcol);
ASCIIColumn acol(L"ascii", 7);
cols.push_back(acol);
UnicodeColumn tcol(L"text", 10);
cols.push_back(tcol);
ProbeSetMultiDataGenotypeData e;
data.SetEntryCount(GenotypeMultiDataType, 4, 10, cols);
CHPMultiDataFileWriter *writer = new CHPMultiDataFileWriter(data);
nv.SetName(L"byte");
nv.SetValueInt8(8);
e.metrics.push_back(nv);
nv.SetName(L"ubyte");
nv.SetValueUInt8(8);
e.metrics.push_back(nv);
nv.SetName(L"short");
nv.SetValueInt16(16);
e.metrics.push_back(nv);
nv.SetName(L"ushort");
nv.SetValueUInt16(16);
e.metrics.push_back(nv);
nv.SetName(L"int");
nv.SetValueInt32(32);
e.metrics.push_back(nv);
nv.SetName(L"uint");
nv.SetValueUInt32(32);
e.metrics.push_back(nv);
nv.SetName(L"float");
nv.SetValueFloat(44.0f);
e.metrics.push_back(nv);
nv.SetName(L"ascii");
nv.SetValueAscii("ascii");
e.metrics.push_back(nv);
nv.SetName(L"text");
nv.SetValueText(L"text");
e.metrics.push_back(nv);
writer->SeekToDataSet(GenotypeMultiDataType);
e.name = "1";
e.call = 1;
e.confidence = 10.0f;
writer->WriteEntry(e);
e.name = "2";
e.call = 2;
e.confidence = 20.0f;
writer->WriteEntry(e);
e.name = "3";
e.call = 3;
e.confidence = 30.0f;
writer->WriteEntry(e);
e.name = "4";
e.call = 4;
e.confidence = 40.0f;
writer->WriteEntry(e);
delete writer;
}
示例6: writer
/*! Create a "quantification" CHP file with just the header information. The remainder of the file
* will be created at a later time using the buffer writer technique.
* The CHP file will contain only "quantification" results from an expression analysis.
* @param execId The execution identifier. This identifier is used to identify the batch run that created the CHP files.
* @param celFile The full path to the parent CEL file. The header of the CEL file is copied to the CHP file.
* @param outFile The name of the output CHP file.
* @param probeSetNames The probe set names.
* @param algName The name of the algorithm used to create the results.
* @param algVersion The algorithm version.
* @param chipType the chip type, also known as the probe array type.
* @param programName The name of the program used to create the CHP file.
* @param programVersion The version of the program.
* @param programCompany The company or institution who developed the CHP creating software.
* @param paramNames A list of parameter names to store in the CHP file header.
* @param paramValues A list of parameter values to store in the CHP file header.
* @param sumNames A list of summary statistic names to store in the CHP file header.
* @param sumValues A list of summary statistic values to store in the CHP file header.
*/
static void CreateFileWithHeader
(
const string &execId,
const string &celFile,
const string &outFile,
const list<string> &probeSetNames,
const string &algName,
const string &algVersion,
const string &chipType,
const string &programName,
const string &programVersion,
const string &programCompany,
const vector<string>& paramNames,
const vector<string>& paramValues,
const vector<string>& sumNames,
const vector<string>& sumValues
)
{
// Determine the max probe set name.
int numEntries = (int) probeSetNames.size();
int maxProbeSetNameLength = 0;
for (list<string>::const_iterator it=probeSetNames.begin(); it!=probeSetNames.end(); it++)
{
maxProbeSetNameLength = max(maxProbeSetNameLength, (int) it->length());
}
// Create the data object
CHPQuantificationData *data = new CHPQuantificationData(outFile);
data->SetEntryCount(numEntries, maxProbeSetNameLength);
data->SetAlgName(StringUtils::ConvertMBSToWCS(algName));
data->SetAlgVersion(StringUtils::ConvertMBSToWCS(algVersion));
data->SetArrayType(StringUtils::ConvertMBSToWCS(chipType));
// Store the CEL header
if (celFile.length() > 0 && FileUtils::Exists(celFile.c_str()) == true)
{
FusionCELData cel;
cel.SetFileName(celFile.c_str());
cel.ReadHeader();
GenericData *gdata = cel.GetGenericData();
if (gdata != NULL)
data->GetFileHeader()->GetGenericDataHdr()->AddParent(*gdata->Header().GetGenericDataHdr());
cel.Close();
}
// Add algorithm parameters to list.
ParameterNameValueTypeList params;
ParameterNameValueType param;
if (programName.empty() == false)
{
param.SetName(L"program-name");
param.SetValueText(StringUtils::ConvertMBSToWCS(programName));
data->GetGenericData().Header().GetGenericDataHdr()->AddNameValParam(param);
}
if (programVersion.empty() == false)
{
param.SetName(L"program-version");
param.SetValueText(StringUtils::ConvertMBSToWCS(programVersion));
data->GetGenericData().Header().GetGenericDataHdr()->AddNameValParam(param);
}
if (programCompany.empty() == false)
{
param.SetName(L"program-company");
param.SetValueText(StringUtils::ConvertMBSToWCS(programCompany));
data->GetGenericData().Header().GetGenericDataHdr()->AddNameValParam(param);
}
int nparams = (int) paramNames.size();
param.SetName(L"exec-guid");
param.SetValueAscii(execId);
params.push_back(param);
for(int iparam=0; iparam<nparams; iparam++)
{
param.SetName(StringUtils::ConvertMBSToWCS(paramNames[iparam]));
param.SetValueAscii(paramValues[iparam]);
params.push_back(param);
}
if (params.empty() == false)
data->AddAlgParams(params);
//.........这里部分代码省略.........
示例7: setUp
void GenericDataTest_FileIndependent::setUp()
{
// Create generic data header
data = new GenericData;
data->Header().SetFilename("../data/test.file.data_dat");
header = new GenericDataHeader;
header->SetFileCreationTime(L"20040823T17:06:00Z");
// header->SetFileCreationTime(DateTime::GetCurrentDateTime().ToString().c_str()); // change time to wstring?
header->SetFileTypeId(INTENSITY_DATA_TYPE);
// header->SetFileId(AffymetrixGuid::GenerateNewGuid());
header->SetFileId("someuniquedatfileid");
header->SetLocale(L"en-US");
// Create parent array file header
parent = new GenericDataHeader;
parent->SetFileTypeId(ARRAY_TYPE_IDENTIFIER);
parent->SetLocale(L"en-US");
// parent->SetFileId(AffymetrixGuid::GenerateNewGuid());
parent->SetFileId("someuniquearrayfileid");
parent->SetFileCreationTime(L"20031225T18:23:00Z");
ParameterNameValueType nvt;
nvt.SetName(ARRAY_ID_PARAM_NAME);
nvt.SetValueAscii("arrayidis17");
parent->AddNameValParam(nvt);
header->AddParent(*parent);
// Add GenericDataHeader to the FileHeader
data->Header().SetGenericDataHdr(*header);
// Create DataGroupHeaders
dch = new DataGroupHeader;
dch->SetName(L"Default");
// Create DataSetHeaders
dphPI = new DataSetHeader;
dphPI->SetName(L"pixel intensity");
ParameterNameValueType param;
param.SetName(L"Scanner");
param.SetValueText(L"M10");
dphPI->AddNameValParam(param);
dphPI->AddUShortColumn(L"Intensity");
dphPI->SetRowCnt(1);
dphGrid = new DataSetHeader;
dphGrid->SetName(L"grid coordinates");
param.SetName(L"Corner Pattern");
param.SetValueText(L"Checkerboard");
dphGrid->AddNameValParam(param);
dphGrid->AddUShortColumn(L"GridULX");
dphGrid->AddUShortColumn(L"GridULY");
dphGrid->AddUShortColumn(L"GridURX");
dphGrid->AddUShortColumn(L"GridURY");
dphGrid->AddUShortColumn(L"GridLRX");
dphGrid->AddUShortColumn(L"GridLRY");
dphGrid->AddUShortColumn(L"GridLLX");
dphGrid->AddUShortColumn(L"GridLLY");
dphGrid->SetRowCnt(1);
// Add DataGroupHeaders
dch->AddDataSetHdr(*dphPI);
dch->AddDataSetHdr(*dphGrid);
data->Header().AddDataGroupHdr(*dch);
}
示例8: fcol
//.........这里部分代码省略.........
if (extraColTypes[icol] == "float")
{
FloatColumn fcol(StringUtils::ConvertMBSToWCS(extraColNames[icol]));
extraColumns.push_back(fcol);
}
else if (extraColTypes[icol] == "int")
{
IntColumn intcol(StringUtils::ConvertMBSToWCS(extraColNames[icol]));
extraColumns.push_back(intcol);
}
else if (extraColTypes[icol] == "ubyte")
{
UByteColumn ubcol(StringUtils::ConvertMBSToWCS(extraColNames[icol]));
extraColumns.push_back(ubcol);
}
else
{
throw string("Unsupported column type: ") + extraColTypes[icol];
}
}
// Create the data object
CHPMultiDataData *data = new CHPMultiDataData(outFile);
data->SetEntryCount(GenotypeMultiDataType, numEntries, maxProbeSetNameLength, extraColumns);
data->SetAlgName(StringUtils::ConvertMBSToWCS(algName));
data->SetAlgVersion(StringUtils::ConvertMBSToWCS(algVersion));
data->SetArrayType(StringUtils::ConvertMBSToWCS(chipType));
// Store the CEL header
if (celFile.length() > 0 && FileUtils::Exists(celFile.c_str()) == true)
{
FusionCELData cel;
cel.SetFileName(celFile.c_str());
cel.ReadHeader();
GenericData *gdata = cel.GetGenericData();
if (gdata != NULL)
data->GetFileHeader()->GetGenericDataHdr()->AddParent(*gdata->Header().GetGenericDataHdr());
cel.Close();
}
// Add algorithm parameters to list.
ParameterNameValueTypeList params;
ParameterNameValueType param;
if (programName.empty() == false)
{
param.SetName(L"program-name");
param.SetValueText(StringUtils::ConvertMBSToWCS(programName));
data->GetGenericData().Header().GetGenericDataHdr()->AddNameValParam(param);
}
if (programVersion.empty() == false)
{
param.SetName(L"program-version");
param.SetValueText(StringUtils::ConvertMBSToWCS(programVersion));
data->GetGenericData().Header().GetGenericDataHdr()->AddNameValParam(param);
}
if (programCompany.empty() == false)
{
param.SetName(L"program-company");
param.SetValueText(StringUtils::ConvertMBSToWCS(programCompany));
data->GetGenericData().Header().GetGenericDataHdr()->AddNameValParam(param);
}
int nparams = (int) extraNames.size();
for(int iparam=0; iparam<nparams; iparam++)
{
param.SetName(StringUtils::ConvertMBSToWCS(extraNames[iparam]));
param.SetValueAscii(extraValues[iparam]);
data->GetGenericData().Header().GetGenericDataHdr()->AddNameValParam(param);
}
nparams = (int) paramNames.size();
param.SetName(L"exec-guid");
param.SetValueAscii(execId);
params.push_back(param);
for(int iparam=0; iparam<nparams; iparam++)
{
param.SetName(StringUtils::ConvertMBSToWCS(paramNames[iparam]));
param.SetValueAscii(paramValues[iparam]);
params.push_back(param);
}
if (params.empty() == false)
data->AddAlgParams(params);
params.clear();
nparams = (int) sumNames.size();
for(int iparam=0; iparam<nparams; iparam++)
{
param.SetName(StringUtils::ConvertMBSToWCS(sumNames[iparam]));
param.SetValueAscii(sumValues[iparam]);
params.push_back(param);
}
if (params.empty() == false)
data->AddSummaryParams(params);
// Creating the writer object will create the file with the header information.
CHPMultiDataFileWriter writer(*data);
}