本文整理汇总了C++中GenericDataHeader::FindNameValParam方法的典型用法代码示例。如果您正苦于以下问题:C++ GenericDataHeader::FindNameValParam方法的具体用法?C++ GenericDataHeader::FindNameValParam怎么用?C++ GenericDataHeader::FindNameValParam使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GenericDataHeader
的用法示例。
在下文中一共展示了GenericDataHeader::FindNameValParam方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
示例2: GetChipSum
ParameterNameValueType CHPData::GetChipSum(const std::wstring& tag)
{
std::wstring name = CHIP_SUMMARY_PARAMETER_NAME_PREFIX_S + tag;
ParameterNameValueType paramType;
GenericDataHeader* hdr = genericData.Header().GetGenericDataHdr();
hdr->FindNameValParam(name, paramType);
ParameterNameValueType type = paramType;
type.SetName(tag);
return type;
}
示例3: GetAlgParam
ParameterNameValueType CHPData::GetAlgParam(const std::wstring& tag)
{
std::wstring name = ALGORITHM_PARAM_NAME_PREFIX_S + tag;
ParameterNameValueType paramType;
GenericDataHeader* hdr = genericData.Header().GetGenericDataHdr();
hdr->FindNameValParam(name, paramType);
ParameterNameValueType type = paramType;
type.SetName(tag);
return type;
}
示例4: GetWStringFromGenericHdr
std::wstring CHPQuantificationData::GetWStringFromGenericHdr(const std::wstring& name)
{
std::wstring result;
ParameterNameValueType paramType;
GenericDataHeader* hdr = genericData.Header().GetGenericDataHdr();
if (hdr->FindNameValParam(name, paramType))
{
result = paramType.GetValueText();
}
return result;
}
示例5:
int32_t CHPData::GetInt32FromGenericHdr(const std::wstring& name)
{
int32_t result = 0;
ParameterNameValueType paramType;
GenericDataHeader* hdr = genericData.Header().GetGenericDataHdr();
if (hdr->FindNameValParam(name, paramType))
{
result = paramType.GetValueInt32();
}
return result;
}
示例6: GetRefSequence
std::string CDFData::GetRefSequence()
{
std::string result;
ParameterNameValueType paramType;
GenericDataHeader* hdr = genericData.Header().GetGenericDataHdr();
if (hdr->FindNameValParam(CDF_REFSEQ_PARAM, paramType))
{
result = paramType.GetValueAscii();
}
return result;
}
示例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: strlen
static int Fusion_GetDataSetOffsetAndSize
(
const char *file_name,
const char *wavelength,
int &offset,
int &size,
char *err_msg,
int err_msg_alloc_sz
)
{
GenericFileReader reader;
string fname = file_name;
reader.SetFilename (fname);
GenericData hdr_data;
reader.ReadHeader (hdr_data);
GenericDataHeader *hdr = hdr_data.Header ().GetGenericDataHdr ();
ParameterNameValueType cel_cols,cel_rows;
if (hdr->FindNameValParam(L"affymetrix-cel-cols",cel_cols) == false ||
hdr->FindNameValParam(L"affymetrix-cel-cols",cel_rows) == false)
{
strncpy (err_msg,"Invalid cel file",sizeof(err_msg_alloc_sz)-1);
return FALSE;
}
string err_s;
while (1)
{
size_t len = strlen (wavelength)+1;
wchar_t *_wavelength = new wchar_t[len];
for (UINT i=0; i<len; i++)
{
_wavelength[i] = (WORD)wavelength[i];
}
wstring group_name = _wavelength;
delete [] _wavelength;
DataGroupHeader *data_group_header = hdr_data.Header ().FindDataGroupHeader (group_name);
if (data_group_header == 0)
{
err_s = "Missing data group ";
err_s += wavelength;
break;
}
DataSet *data_set = GetDataSet (L"Intensity", group_name, hdr_data);
if (data_set == 0)
{
err_s = "Missing data set \"Intensity\"";
break;
}
offset = data_set->Header ().GetDataStartFilePos ();
size = data_set->Header ().GetDataSize ();
break;
}
if (strlen (err_s.c_str ()))
{
strncpy (err_msg,err_s.c_str (),sizeof(err_msg_alloc_sz)-1);
return FALSE;
}
return TRUE;
}