49 : m_ImportedTableData(ds)
104 for (row=0; row<check_count; ++row) {
118 type_matches[
ct] += 1;
121 property_matches[dt] += 1;
125 size_t max_matches = 0;
131 bool has_real =
false;
135 for (
size_t j=0; j<type_matches.size(); ++j) {
136 if (type_matches[j] > max_matches) {
137 max_matches = type_matches[j];
152 for (
size_t j=0; j<property_matches.size(); ++j) {
153 if (property_matches[j] > max_matches) {
154 max_matches = property_matches[j];
168 if (colname ==
"chromosome" &&
187 if (field.length() == 0)
190 if ( (field[0] ==
'\'' && field[field.length()-1] ==
'\'') ||
191 (field[0] ==
'\"' && field[field.length()-1] ==
'\"') ) {
201 string test_field = field;
202 if (test_field.length() > 1 && test_field[0] ==
'-') {
218 size_t first_chr = field.find_first_of(
"01234567890xymXYM", 0);
221 if (first_chr != string::npos && first_chr >=2) {
222 string prefix = field.substr(0, first_chr);
223 string suffix = field.substr(first_chr, field.length()-first_chr);
244 if ((cnum > 0 && cnum < 1261) &&
255 string field_upper = field;
257 if (field_upper ==
"X" || field_upper ==
"Y" || field_upper ==
"MT") {
270 size_t gi_separator = field.find_first_of(
"|:", 0);
271 if (gi_separator != string::npos &&
272 gi_separator != field.length()-1) {
273 string prefix = field.substr(0, gi_separator);
276 string ginum = field.substr(gi_separator+1, field.length()-gi_separator);
309 if (field.length() > 2) {
310 string rsstr = field.substr(0,2);
314 string rsint = field.substr(2, field.length()-2);
373 if (field ==
"+" || field ==
"-" ||
386 if (field_upper.find_first_not_of(
"ACTG")) {
CRef< CTableImportDataSource > m_ImportedTableData
Data table to be rendered in the list.
CTableImportColumn::eColumnType x_GuessType(const string &field, CTableImportColumn::eDataType &dt)
Guess the type for a specific field (string)
CRef< objects::CScope > m_Scope
Scope is used in guessing what kind of ids we have.
void GuessColumns()
Update columns in data source with type info based on best-guesses.
CTableColumnTypeGuesser(CRef< CTableImportDataSource > ds)
ctor
void GuessColumn(size_t col_num)
Iterate over the data in a specific column (but not necessarily all rows) to guess type information.
eColumnType GetType() const
const CTableImportRow & GetRow(size_t row) const
Return a specific row.
vector< CTableImportColumn > & GetColumns()
return the array of column data
const CTableImportColumn & GetColumn(size_t col) const
Return the specified column.
size_t GetNumRows() const
return total number of rows read
int GetColumnHeaderRow() const
string GetColumnName(size_t col) const
Return name of specified column.
string GetField(int column_idx) const
Get a specific field or "" if column_idx > m_Fields.size()
static EAccessionInfo IdentifyAccession(const CTempString &accession, TParseFlags flags=fParse_AnyRaw)
Deduces information from a bare accession a la WHICH_db_accession; may report false negatives on prop...
static CRef< CObjectManager > GetInstance(void)
Return the existing object manager or create one.
void Reset(void)
Reset reference object.
bool IsNull(void) const THROWS_NONE
Check if pointer is null – same effect as Empty().
uint32_t Uint4
4-byte (32-bit) unsigned integer
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static int CompareNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive compare of a substring with another string.
static int StringToInt(const CTempString str, TStringToNumFlags flags=0, int base=10)
Convert string to int.
static double StringToDouble(const CTempStringEx str, TStringToNumFlags flags=0)
Convert string to double.
static Uint8 StringToUInt8_DataSize(const CTempString str, TStringToNumFlags flags=0)
Convert string that can contain "software" qualifiers to Uint8.
static void TruncateSpacesInPlace(string &str, ETrunc where=eTrunc_Both)
Truncate spaces in a string (in-place)
static string & ToUpper(string &str)
Convert string to upper case – string& version.
static string & ToLower(string &str)
Convert string to lower case – string& version.
@ fDS_ProhibitFractions
StringToUInt8_DataSize(): Ignore any fraction part of a value, "1.2K" ~ "1K".
E_Choice Which(void) const
Which variant is currently selected.
bool IsLocal(void) const
Check if variant Local is selected.
@ e_Gi
GenInfo Integrated Database.
const struct ncbi::grid::netcache::search::fields::SIZE size
static const char * suffix[]
static const char * prefix[]
Uint4 GetSequenceType(const CBioseq_Handle &bsh)
Return a (corrected) set of flags identifying the sequence type.