bool AbstractTwoLevelAgreement::readAnnotations() { annotatedGraph=newGraph(true); if (!readAnnotation(fileName+".tags",tags,annotatedGraph)){ _error << "Annotation File does not exist\n"; QFile file(QString("%1.tags").arg(fileName).toStdString().data()); if (file.open(QIODevice::WriteOnly)) { QDataStream out(&file); // we will serialize the data into the file out << outputList; generatedGraph->writeToStream(out);; file.close(); _error << "Annotation File has been written from current detected expressions, Correct it before use.\n"; } return false; } return true; }
unique_ptr<SpanTree> AnnotationDeserializer::readSpanTree() { VespaDocumentDeserializer deserializer(_repo, _stream, _version); StringFieldValue tree_name; deserializer.read(tree_name); _nodes.clear(); SpanNode::UP root = readSpanNode(); unique_ptr<SpanTree> span_tree(new SpanTree(tree_name.getValue(), std::move(root))); uint32_t annotation_count = getInt1_2_4Bytes(_stream); span_tree->reserveAnnotations(annotation_count); for (uint32_t i = 0; i < annotation_count; ++i) { readAnnotation(span_tree->annotation(i)); } return span_tree; }
void SwissProtPlainTextFormat::readAnnotations(ParserState *st, int offset){ st->si.setDescription(tr("Reading annotations %1").arg(st->entry->name)); st->entry->hasAnnotationObjectFlag = true; do { int fplen = fPrefix.length(); if (st->len >= 6 && TextUtils::equals(fPrefix.data(), st->buff, fplen)) { while (fplen < 5) { if (st->buff[fplen++] != ' ') { st->si.setError(tr("Invalid format of feature table")); break; } } } else { // end of feature table break; } //parsing feature; SharedAnnotationData f = readAnnotation(st->io, st->buff, st->len, READ_BUFF_SIZE, st->si, offset); st->entry->features.push_back(f); } while (st->readNextLine()); }