PrimerLibraryModel::PrimerLibraryModel(QObject *parent) : QAbstractItemModel(parent) { U2OpStatus2Log os; PrimerLibrary *primerLibrary = PrimerLibrary::getInstance(os); SAFE_POINT_OP(os, ); primers = primerLibrary->getPrimers(os); }
void ImportPrimerFromObjectTask::run() { primer.name = sequenceObject->getGObjectName(); primer.sequence = sequenceObject->getWholeSequenceData(stateInfo); CHECK_OP(stateInfo, ); int pos = 0; if (validator.validate(primer.sequence, pos) == QValidator::Invalid) { setError(tr("The primer sequence contains non-ACGT symbols")); return; } PrimerLibrary *library = PrimerLibrary::getInstance(stateInfo); CHECK_OP(stateInfo, ); library->addRawPrimer(primer, stateInfo); }
void ImportPrimerFromObjectTask::run() { primer.name = sequenceObject->getGObjectName(); primer.sequence = sequenceObject->getWholeSequenceData(stateInfo); CHECK_OP(stateInfo, ); QRegExp regExp("[^ACGT]"); if (primer.sequence.contains(regExp)) { setError(tr("The primer sequence contains non-ACGT symbols")); return; } PrimerLibrary *library = PrimerLibrary::getInstance(stateInfo); CHECK_OP(stateInfo, ); library->addRawPrimer(primer, stateInfo); }