本文整理汇总了C++中U2OpStatus::setDescription方法的典型用法代码示例。如果您正苦于以下问题:C++ U2OpStatus::setDescription方法的具体用法?C++ U2OpStatus::setDescription怎么用?C++ U2OpStatus::setDescription使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类U2OpStatus
的用法示例。
在下文中一共展示了U2OpStatus::setDescription方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: load
void EMBLGenbankAbstractDocument::load(const U2DbiRef& dbiRef, IOAdapter* io, QList<GObject*>& objects, QVariantMap& fs, U2OpStatus& os, QString& writeLockReason) {
DbiOperationsBlock opBlock(dbiRef, os);
CHECK_OP(os, );
Q_UNUSED(opBlock);
writeLockReason.clear();
//get settings
int gapSize = qBound(-1, DocumentFormatUtils::getMergeGap(fs), 1000*1000);
bool merge = gapSize!=-1;
QScopedPointer<AnnotationTableObject> mergedAnnotations(NULL);
QStringList contigs;
QVector<U2Region> mergedMapping;
// Sequence loading is 'lazy', so, if there is no sequence, it won't be created and there is no need to remove it.
U2SequenceImporter seqImporter(fs, true);
const QString folder = fs.value(DBI_FOLDER_HINT, U2ObjectDbi::ROOT_FOLDER).toString();
QSet<QString> usedNames;
GObjectReference sequenceRef(GObjectReference(io->getURL().getURLString(), "", GObjectTypes::SEQUENCE));
QByteArray readBuffer(ParserState::LOCAL_READ_BUFFER_SIZE, '\0');
ParserState st(isNcbiLikeFormat() ? 12 : 5, io, NULL, os);
st.buff = readBuffer.data();
TmpDbiObjects dbiObjects(dbiRef, os);
int num_sequence = 0;
qint64 sequenceStart = 0;
int sequenceSize = 0;
int fullSequenceSize = 0;
const int objectsCountLimit = fs.contains(DocumentReadingMode_MaxObjectsInDoc) ? fs[DocumentReadingMode_MaxObjectsInDoc].toInt() : -1;
for (int i=0; !os.isCoR(); i++, ++num_sequence) {
if (objectsCountLimit > 0 && objects.size() >= objectsCountLimit) {
os.setError(EMBLGenbankAbstractDocument::tr("File \"%1\" contains too many sequences to be displayed. "
"However, you can process these data using instruments from the menu <i>Tools -> NGS data analysis</i> "
"or pipelines built with Workflow Designer.")
.arg(io->getURL().getURLString()));
break;
}
//TODO: reference to a local variable??? Such a pointer will become invalid
EMBLGenbankDataEntry data;
st.entry = &data;
if (num_sequence == 0 || merge == false){
seqImporter.startSequence(dbiRef, folder, "default sequence name", false, os); //change name and circularity after finalize method
CHECK_OP(os, );
}
sequenceSize = 0;
os.setDescription(tr("Reading entry header"));
int offset = 0;
if (merge && num_sequence > 0) {
offset = gapSize;
}
if (!readEntry(&st,seqImporter,sequenceSize,fullSequenceSize,merge,offset, os)) {
break;
}
if (merge && sequenceSize > 0 && num_sequence > 0) {
sequenceStart = fullSequenceSize - sequenceSize;
sequenceStart += gapSize;
fullSequenceSize += gapSize;
}
// tolerate blank lines between records
char ch;
bool b;
while ((b = st.io->getChar(&ch)) && (ch == '\n' || ch == '\r')){}
if (b) {
st.io->skip(-1);
}
AnnotationTableObject *annotationsObject = NULL;
if (data.hasAnnotationObjectFlag) {
QString annotationName = genObjectName(usedNames, data.name, data.tags, i+1, GObjectTypes::ANNOTATION_TABLE);
QVariantMap hints;
hints.insert(DBI_FOLDER_HINT, fs.value(DBI_FOLDER_HINT, U2ObjectDbi::ROOT_FOLDER));
if (Q_UNLIKELY(merge && NULL == mergedAnnotations)) {
mergedAnnotations.reset(new AnnotationTableObject(annotationName, dbiRef, hints));
}
annotationsObject = merge ? mergedAnnotations.data() : new AnnotationTableObject(annotationName, dbiRef, hints);
QStringList groupNames;
QMap<QString, QList<SharedAnnotationData> > groupName2Annotations;
for (int i = 0, n = data.features.size(); i < n; ++i) {
SharedAnnotationData &d = data.features[i];
if (!d->location->regions.isEmpty()) {
for (int i = 0, n = d->location->regions.size(); i < n; ++i) {
// for some reason larger numbers cannot be stored within rtree SQLite tables
if (d->location->regions[i].endPos() > 9223371036854775807LL) {
d->location->regions[i].length = 9223371036854775807LL - d->location->regions[i].startPos;
}
}
}
//.........这里部分代码省略.........