A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/bed__line__reader_8cpp_source.html below:

NCBI C++ ToolKit: src/objtools/import/ftable/bed_line_reader.cpp Source File

61

mColumnDelimiter(

" \t"

),

62

mSplitFlags(

NStr

::fSplit_MergeDelimiters),

65

mColorByStrand(

false

)

88  string

nextLine =

""

;

89  while

(!lineReader.

AtEOF

()) {

90

nextLine = *(++lineReader);

120  const string

& line)

const 143  string

track, values;

145  if

(track !=

"track"

) {

149  throw

errorTrackLineOutOfOrder;

153  if

(values.empty()) {

157

vector<string> trackPieces;

161  for

(

int i

= 1;

i

< trackPieces.size() - 1; ++

i

) {

162

vector<string> words;

164  auto

pendingKey = words.back();

174  mUseScore

= (!useScore.empty() && useScore !=

"0"

&& useScore !=

"false"

);

177  mItemRgb

= (itemRgb ==

"on"

|| itemRgb ==

"On"

);

178  if

(!itemRgb.empty() && !

mItemRgb

) {

179

errorInvalidTrackValue.

AmendMessage

(

"Bad itemRgb value --- ignored"

);

184  if

(!colorByStrand.empty()) {

186  string

colorStrandPlus, colorStrandMinus;

188

colorByStrand,

" "

, colorStrandPlus, colorStrandMinus);

189

vector<string> rgbComponents;

190  NStr::Split

(colorStrandPlus,

","

, rgbComponents);

191  if

(rgbComponents.size() != 3) {

192  throw

std::exception();

197

rgbComponents.clear();

198  NStr::Split

(colorStrandMinus,

","

, rgbComponents);

199  if

(rgbComponents.size() != 3) {

200  throw

std::exception();

206  catch

(std::exception&) {

208  "Bad colorByStrand value --- ignored"

);

233  throw

errorInvalidColumnCount;

239  throw

errorInvalidColumnCount;

246  const

vector<string>&

columns

,

269  throw

errorInvalidChromStartValue;

276  throw

errorInvalidChromEndValue;

281  const auto

& strand =

columns

[5];

282  if

(strand !=

"+"

&& strand !=

"-"

&& strand !=

"."

) {

283  throw

errorInvalidStrandValue;

285  if

(strand ==

"-"

) {

294  const

vector<string>&

columns

,

319  const

vector<string>&

columns

,

335

rgbValue.

R

= rgbValue.

B

= rgbValue.

G

= -1;

341  const

vector<string>&

columns

,

347  "Invalid strand value- setting color to BLACK."

,

353

rgbValue.

R

= rgbValue.

G

= rgbValue.

B

= 0;

371  const

vector<string>&

columns

,

387

rgbValue.

R

= rgbValue.

G

= rgbValue.

B

= 0;

396

rgbValue.

R

= rgbValue.

G

= rgbValue.

B

= 0;

400  if

(scoreValue < 0) {

404  else if

(scoreValue > 1000) {

408  if

(scoreValue == 0) {

409

rgbValue.

R

= rgbValue.

G

= rgbValue.

B

= 0;

412  if

(scoreValue > 998) {

413

rgbValue.

R

= rgbValue.

G

= rgbValue.

B

= 255;

417

scoreValue =

static_cast<int>

(scoreValue / 111);

418

rgbValue.

R

= rgbValue.

G

= rgbValue.

B

= (13 + 29*scoreValue);

425  const

vector<string>&

columns

,

433

rgbValue.

R

= rgbValue.

G

= rgbValue.

B

= 0;

440

vector<string > rgbSplits;

442  switch

(rgbSplits.size()) {

444  throw

errorInvalidRgbValue;

446  unsigned long

rgbInt = 0;

448  auto

hexDigits = rgb.substr(2, string::npos);

452  auto

hexDigits = rgb.substr(1, string::npos);

459

rgbValue.

R

= (rgbInt & 0xff0000) >> 16;

460

rgbValue.

G

= (rgbInt & 0x00ff00) >> 8;

461

rgbValue.

B

= (rgbInt & 0x0000ff);

473

rgbValue.

R

= rgbValue.

G

= rgbValue.

B

= 0;

477  if

(rgbValue.

R

< 0 || 255 < rgbValue.

R

) {

478

rgbValue.

R

= rgbValue.

G

= rgbValue.

B

= 0;

482  if

(rgbValue.

G

< 0 || 255 < rgbValue.

G

) {

483

rgbValue.

R

= rgbValue.

G

= rgbValue.

B

= 0;

487  if

(rgbValue.

B

< 0 || 255 < rgbValue.

B

) {

488

rgbValue.

R

= rgbValue.

G

= rgbValue.

B

= 0;

497  const

vector<string>&

columns

,

516  throw

errorInvalidThickStartValue;

523  throw

errorInvalidThickEndValue;

530  const

vector<string>&

columns

,

544  const

vector<string>&

columns

,

545  unsigned int

& blockCount,

546

vector<int>& blockStarts,

547

vector<int>& blockSizes)

570  catch

(std::exception&) {

571  throw

errorInvalidBlockCountValue;

577

vector<string> blockSizesSplits;

579  if

(blockSizesSplits.back().empty()) {

580

blockSizesSplits.pop_back();

582  for

(

auto

blockSize: blockSizesSplits) {

586  catch

(std::exception&) {

587  throw

errorInvalidBlockSizesValue;

589  if

(blockCount != blockSizes.size()) {

590  throw

errorInconsistentBlocksInformation;

594

vector<string> blockStartsSplits;

596  if

(blockStartsSplits.back().empty()) {

597

blockStartsSplits.pop_back();

599  for

(

auto

blockStart: blockStartsSplits) {

603  catch

(std::exception&) {

604  throw

errorInvalidBlockStartsValue;

606  if

(blockCount != blockStarts.size()) {

607  throw

errorInconsistentBlocksInformation;

614  const

vector<string>&

columns

,

638  TSeqPos

thickStart = chromStart, thickEnd = chromStart;

640  if

(thickStart < chromStart || thickEnd > chromEnd) {

641  throw

errorInvalidThickInterval;

647  unsigned int

blockCount;

648

vector<int> blockStarts, blockSizes;

651

record.

Initialize

(chromId, chromStart, chromEnd, name, score, chromStrand,

652

thickStart, thickEnd, rgbValue, blockCount, blockStarts, blockSizes);

std::string ValueOf(const std::string &) const

void SetValue(const std::string &, const std::string &)

void Initialize(const std::string &, TSeqPos, TSeqPos, const std::string &, double, ENa_strand, TSeqPos, TSeqPos, const RgbValue &, unsigned int, const std::vector< int > &, const std::vector< int > &)

void xInitializeRgb(const std::vector< string > &, CBedImportData::RgbValue &)

void xInitializeThickInterval(const std::vector< std::string > &, TSeqPos &, TSeqPos &)

void xInitializeRgbFromScoreColumn(const std::vector< string > &, CBedImportData::RgbValue &)

void xInitializeRgbFromRgbColumn(const std::vector< string > &, CBedImportData::RgbValue &)

CBedImportData::RgbValue mRgbStrandMinus

void xInitializeRgbFromStrandColumn(const std::vector< string > &, CBedImportData::RgbValue &)

void SetInputStream(CNcbiIstream &, bool=false) override

void xInitializeScore(const std::vector< string > &, double &)

bool xProcessTrackLine(const string &)

std::string mColumnDelimiter

CBedLineReader(CImportMessageHandler &)

void xInitializeBlocks(const std::vector< string > &, unsigned int &blockCount, std::vector< int > &blockStarts, std::vector< int > &blockSizes)

void xSplitLine(const std::string &, std::vector< std::string > &)

void xInitializeChromInterval(const std::vector< std::string > &, std::string &, TSeqPos &, TSeqPos &, ENa_strand &)

CBedImportData::RgbValue mRgbStrandPlus

void xInitializeRecord(const std::vector< std::string > &, CFeatImportData &) override

void xInitializeChromName(const std::vector< std::string > &, std::string &)

bool GetNextRecord(CStreamLineReader &, CFeatImportData &) override

bool xIgnoreLine(const string &) const override

virtual void xReportProgress()

virtual bool xIgnoreLine(const string &) const

CAnnotImportData mAnnotInfo

CImportMessageHandler & mErrorReporter

unsigned int LineCount() const

virtual void SetInputStream(CNcbiIstream &, bool=false)

unsigned int mRecordCount

void AmendMessage(const std::string &amend)

virtual void ReportError(const CImportError &)

Simple implementation of ILineReader for i(o)streams.

static const column_t columns[]

unsigned int TSeqPos

Type for sequence locations and lengths.

bool AtEOF(void) const

Indicates (negatively) whether there is any more input.

IO_PREFIX::istream CNcbiIstream

Portable alias for istream.

static CTempString TruncateSpaces_Unsafe(const CTempString str, ETrunc where=eTrunc_Both)

Truncate whitespace in a string.

static int StringToInt(const CTempString str, TStringToNumFlags flags=0, int base=10)

Convert string to int.

static list< string > & Split(const CTempString str, const CTempString delim, list< string > &arr, TSplitFlags flags=0, vector< SIZE_TYPE > *token_pos=NULL)

Split a string using specified delimiters.

static double StringToDouble(const CTempStringEx str, TStringToNumFlags flags=0)

Convert string to double.

static unsigned long StringToULong(const CTempString str, TStringToNumFlags flags=0, int base=10)

Convert string to unsigned long.

static string Join(const TContainer &arr, const CTempString &delim)

Join strings using the specified delimiter.

static string & Replace(const string &src, const string &search, const string &replace, string &dst, SIZE_TYPE start_pos=0, SIZE_TYPE max_replace=0, SIZE_TYPE *num_replace=0)

Replace occurrences of a substring within a string.

static bool StartsWith(const CTempString str, const CTempString start, ECase use_case=eCase)

Check if a string starts with a specified prefix value.

static bool SplitInTwo(const CTempString str, const CTempString delim, string &str1, string &str2, TSplitFlags flags=0)

Split a string into two pieces using the specified delimiters.

ENa_strand

strand of nucleic acid

const struct ncbi::grid::netcache::search::fields::KEY key

const GenericPointer< typename T::ValueType > T2 value

Defines classes: CDirEntry, CFile, CDir, CSymLink, CMemoryFile, CFileUtil, CFileLock,...


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4