void GffRecord::printNull(QuickString &outBuf) const { outBuf.append(".\t.\t.\t-1\t-1\t.\t.\t.", 17); if (_numFields > 8) { outBuf.append("\t.", 2); } }
void VcfRecord::print(QuickString &outBuf, const QuickString & start, const QuickString & end) const { outBuf.append(_chrName); outBuf.append('\t'); outBuf.append(_startPosStr); printOtherFields(outBuf); }
void Bed3Interval::print(QuickString &outBuf) const { outBuf.append(_chrName); outBuf.append('\t'); outBuf.append(_startPos); outBuf.append('\t'); outBuf.append(_endPos); }
void Bed3Interval::print(QuickString &outBuf, const QuickString & start, const QuickString & end) const { outBuf.append(_chrName); outBuf.append('\t'); outBuf.append(start); outBuf.append('\t'); outBuf.append(end); }
void BedPlusInterval::print(QuickString &outBuf, const QuickString & start, const QuickString & end) const { Bed6Interval::print(outBuf, start, end); for (int i=0; i < (int)_otherIdxs.size(); i++) { outBuf.append('\t'); outBuf.append(*(_otherIdxs[i])); } }
void ContextBase::setErrorMsg(QuickString &msg, bool onlyWarn, const Record * record, QuickString str1, const QuickString str2, const QuickString str3) { if (onlyWarn) { msg = "\n***** WARNING: "; } else { msg = "\n***** ERROR: "; } msg.append(str1); msg.append(str2); msg.append(str3); msg.append(" Exiting...\n"); if (record != NULL) { record->print(msg); } }
void VcfRecord::printOtherFields(QuickString &outBuf) const { outBuf.append('\t'); outBuf.append(_name); outBuf.append('\t'); outBuf.append(_varAlt); outBuf.append('\t'); outBuf.append(_varRef); outBuf.append('\t'); outBuf.append(_score); for (int i= 0; i < (int)_otherIdxs.size(); i++) { outBuf.append('\t'); outBuf.append(*(_otherIdxs[i])); } }
void GffRecord::print(QuickString &outBuf, const QuickString & start, const QuickString & end) const { outBuf.append(_chrName); outBuf.append('\t'); outBuf.append(_source); outBuf.append('\t'); outBuf.append(_name); outBuf.append('\t'); outBuf.append(start); outBuf.append('\t'); outBuf.append(end); outBuf.append('\t'); printRemainingFields(outBuf); }
void GffRecord::print(QuickString &outBuf) const { outBuf.append(_chrName); outBuf.append('\t'); outBuf.append(_source); outBuf.append('\t'); outBuf.append(_name); outBuf.append('\t'); outBuf.append(_startPosStr); outBuf.append('\t'); outBuf.append(_endPosStr); outBuf.append('\t'); printRemainingFields(outBuf); }
void VcfRecord::printOtherFields(QuickString &outBuf) const { outBuf.append('\t'); outBuf.append(_name); outBuf.append('\t'); outBuf.append(_varRef); outBuf.append('\t'); outBuf.append(_varAlt); outBuf.append('\t'); outBuf.append(_score); outBuf.append('\t'); _plusFields.printFields(outBuf); }
bool BufferedStreamMgr::getLine(QuickString &line) { line.clear(); if (_mainBufCurrStartPos >= _mainBufCurrLen) { if (!readFileChunk()) { _eof = true; return false; } } while (1) { int searchPos = _mainBufCurrStartPos; while (searchPos < _mainBufCurrLen && _mainBuf[searchPos] != '\n') { searchPos++; } line.append((char *)_mainBuf + _mainBufCurrStartPos, searchPos - _mainBufCurrStartPos); _mainBufCurrStartPos = searchPos +1; if (searchPos == _mainBufCurrLen) { //hit end of buffer, but no newline yet if (!readFileChunk()) { //hit eof return true; } } else if (_mainBuf[searchPos] == '\n') { return true; } } }
void BedPlusInterval::print(QuickString &outBuf, const QuickString & start, const QuickString & end) const { Bed3Interval::print(outBuf, start, end); outBuf.append('\t'); printBed6PlusFields(outBuf); _plusFields.printFields(outBuf); }
OneStringBase& QuickString<quickSize>::substr(int pos, int sublen) { // Check sublen flag. If -1, then go to the end of the QuickString if(sublen == -1) { // Calculate the size from the position to the end of the QuickString sublen = size() - pos; } // Check for valid index if((pos >= quickSize) || (pos < 0)) { ioc << cat_error << ta_bold << fg_red << "QuickString Error:" << " Index Out of Bounds" << io_end; return *this; } // If the substring size is too large throw an error else if(sublen + pos > size()) { ioc << cat_error << ta_bold << fg_red << "QuickString Error: " << "Size exceeds limits of QuickString"<<io_end; return *this; } else { // Create a new OneString and append each character that is found // in the substring QuickString<quickSize>* newPaw = new QuickString(); for(int i = 0; i < sublen; i++) { newPaw->append(master[pos]); pos++; } return *newPaw; } }
void BedPlusInterval::printNull(QuickString &outBuf) const { Bed6Interval::printNull(outBuf); for (int i=startOtherIdx; i < _numPrintFields; i++) { outBuf.append("\t."); } }
void ComplementFile::printRecord(int endPos) { _outRecord.setStartPos(_currStartPos); QuickString startStr; startStr.append(_currStartPos); _outRecord.setStartPosStr(startStr); _outRecord.setEndPos(endPos); QuickString endStr; endStr.append(endPos); _outRecord.setEndPosStr(endStr); _outputMgr->printRecord(&_outRecord); _outputMgr->newline(); }
void GffPlusRecord::printNull(QuickString &outBuf) const { GffRecord::printNull(outBuf); for (int i=_numFields; i < _numPrintFields; i++) { outBuf.append("\t."); } }
void BedPlusInterval::printNull(QuickString &outBuf) const { Bed3Interval::printNull(outBuf); printBed6PlusNullFields(outBuf); for (int i=_numFixedFields; i < _numPrintFields; i++) { outBuf.append("\t."); } }
void GroupBy::processHits(RecordOutputMgr *outputMgr, RecordKeyVector &hits) { const Record *rec = hits.getKey(); const QuickString &opVal = _context->getColumnOpsVal(hits); if (upCast(_context)->printFullCols()) { outputMgr->printRecord(rec, opVal); } else { QuickString outBuf; for (int i=0; i < (int)_groupCols.size(); i++) { outBuf.append(rec->getField(_groupCols[i])); outBuf.append('\t'); } outBuf.append(opVal); outputMgr->printRecord(NULL, outBuf); } }
Record *BlockMgr::allocateAndAssignRecord(const Record *keyRecord, int startPos, int endPos) { Record *record = _blockRecordsMgr->allocateRecord(); record->setChrName(keyRecord->getChrName()); record->setChromId(keyRecord->getChromId()); record->setStartPos(startPos); record->setEndPos(endPos); QuickString startPosStr; QuickString endPosStr; startPosStr.append(startPos); endPosStr.append(endPos); record->setStartPosStr(startPosStr); record->setEndPosStr(endPosStr); record->setName(keyRecord->getName()); record->setScore(keyRecord->getScore()); record->setStrand(keyRecord->getStrand()); return record; }
void BamRecord::printUnmapped(QuickString &outBuf) const { outBuf.append(_chrName.empty() ? "." : _chrName); outBuf.append("\t-1\t-1\t"); outBuf.append(_name.empty() ? "." : _name); outBuf.append('\t'); outBuf.append(_score.empty() ? "." : _score); outBuf.append("\t.\t-1\t-1\t-1\t0,0,0\t0\t.\t."); // dot for strand, -1 for blockStarts and blockEnd }
void GffRecord::printRemainingFields(QuickString &outBuf) const { outBuf.append(_score); outBuf.append('\t'); outBuf.append(_strand); outBuf.append('\t'); outBuf.append(_frame); if (_numFields == 9) { outBuf.append('\t'); outBuf.append(_group); } }
void BedPlusInterval::printBed6PlusFields(QuickString &outBuf) const { if (_numFixedFields != defaultNumFixedFields) { outBuf.append(_name); outBuf.append('\t'); outBuf.append(_score); outBuf.append('\t'); outBuf.append(_strand); outBuf.append('\t'); } }
bool BufferedStreamMgr::getLine(QuickString &line) { line.clear(); if (_mainBufCurrStartPos >= _mainBufCurrLen) { if (!readFileChunk()) { _eof = true; return false; } } bool retVal = true; while (1) { int searchPos = _mainBufCurrStartPos; while (searchPos < _mainBufCurrLen && _mainBuf[searchPos] != '\n') { searchPos++; } line.append((char *)_mainBuf + _mainBufCurrStartPos, searchPos - _mainBufCurrStartPos); _mainBufCurrStartPos = searchPos +1; if (searchPos == _mainBufCurrLen) { //hit end of buffer, but no newline yet if (!readFileChunk()) { //hit eof retVal = true; break; } } else if (_mainBuf[searchPos] == '\n') { retVal = true; break; } } //strip any whitespace characters, such as DOS newline characters or extra tabs, //from the end of the line int lastPos = line.size(); while (isspace(line[lastPos-1])) lastPos--; line.resize(lastPos); return retVal; }
void BedGraphInterval::print(QuickString &outBuf) const { Bed3Interval::print(outBuf); outBuf.append('\t'); outBuf.append(_name); }
void BedGraphInterval::print(QuickString &outBuf, const QuickString & start, const QuickString & end) const { Bed3Interval::print(outBuf, start, end); outBuf.append('\t'); outBuf.append(_name); }
void SingleLineDelimTextFileReader::appendField(int fieldNum, QuickString &str) const { int startPos = _delimPositions[fieldNum] +1; int endPos = _delimPositions[fieldNum+1]; str.append(_sLine.c_str() + startPos, endPos - startPos); }
void BedGraphInterval::printNull(QuickString &outBuf) const { Bed3Interval::printNull(outBuf); outBuf.append("\t.", 2); }
void Bed3Interval::printNull(QuickString &outBuf) const { outBuf.append(".\t-1\t-1", 7); }
void VcfRecord::printNull(QuickString &outBuf) const { outBuf.append(".\t-1\t.\t.\t.\t-1"); for (int i= startOtherIdx; i < _numPrintFields; i++) { outBuf.append("\t."); } }
void BedPlusInterval::printBed6PlusNullFields(QuickString &outBuf) const { if (_numFixedFields != defaultNumFixedFields) { outBuf.append("\t.\t.\t."); } }