Ejemplo n.º 1
0
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);
	}
}
Ejemplo n.º 2
0
void VcfRecord::print(QuickString &outBuf, const QuickString & start, const QuickString & end) const {
	outBuf.append(_chrName);
	outBuf.append('\t');
	outBuf.append(_startPosStr);
	printOtherFields(outBuf);

}
Ejemplo n.º 3
0
void Bed3Interval::print(QuickString &outBuf) const
{
	outBuf.append(_chrName);
	outBuf.append('\t');
	outBuf.append(_startPos);
	outBuf.append('\t');
	outBuf.append(_endPos);
}
Ejemplo n.º 4
0
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);
}
Ejemplo n.º 5
0
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]));
	}
}
Ejemplo n.º 6
0
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);
	}
}
Ejemplo n.º 7
0
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]));
	}

}
Ejemplo n.º 8
0
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);
}
Ejemplo n.º 9
0
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);
}
Ejemplo n.º 10
0
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);
}
Ejemplo n.º 11
0
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;
        }
    }
}
Ejemplo n.º 12
0
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);
}
Ejemplo n.º 13
0
 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;
     }
 }
Ejemplo n.º 14
0
void BedPlusInterval::printNull(QuickString &outBuf) const
{
	Bed6Interval::printNull(outBuf);
	for (int i=startOtherIdx; i < _numPrintFields; i++) {
		outBuf.append("\t.");
	}
}
Ejemplo n.º 15
0
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();

}
Ejemplo n.º 16
0
void GffPlusRecord::printNull(QuickString &outBuf) const
{
	GffRecord::printNull(outBuf);
	for (int i=_numFields; i < _numPrintFields; i++) {
		outBuf.append("\t.");
	}
}
Ejemplo n.º 17
0
void BedPlusInterval::printNull(QuickString &outBuf) const
{
	Bed3Interval::printNull(outBuf);
	printBed6PlusNullFields(outBuf);
	for (int i=_numFixedFields; i < _numPrintFields; i++) {
		outBuf.append("\t.");
	}
}
Ejemplo n.º 18
0
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);
	}
}
Ejemplo n.º 19
0
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;
}
Ejemplo n.º 20
0
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
}
Ejemplo n.º 21
0
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);
	}
}
Ejemplo n.º 22
0
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');
	}
}
Ejemplo n.º 23
0
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;
}
Ejemplo n.º 24
0
void BedGraphInterval::print(QuickString &outBuf) const
{
	Bed3Interval::print(outBuf);
	outBuf.append('\t');
	outBuf.append(_name);
}
Ejemplo n.º 25
0
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);
}
Ejemplo n.º 27
0
void BedGraphInterval::printNull(QuickString &outBuf) const
{
	Bed3Interval::printNull(outBuf);
	outBuf.append("\t.", 2);
}
Ejemplo n.º 28
0
void Bed3Interval::printNull(QuickString &outBuf) const {
	outBuf.append(".\t-1\t-1", 7);
}
Ejemplo n.º 29
0
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.");
	}
}
Ejemplo n.º 30
0
void BedPlusInterval::printBed6PlusNullFields(QuickString &outBuf) const {
	if (_numFixedFields != defaultNumFixedFields) {
		outBuf.append("\t.\t.\t.");
	}

}