void SequenceInfo::updateCommonStatisticsLayout() { ADVSequenceWidget *wgt = annotatedDnaView->getSequenceWidgetInFocus(); CHECK(wgt != NULL, ); ADVSequenceObjectContext *ctx = wgt->getActiveSequenceContext(); SAFE_POINT(ctx != NULL, tr("Sequence context is NULL"), ); SAFE_POINT(ctx->getAlphabet() != NULL, tr("Sequence alphbet is NULL"), ); int availableSpace = getAvailableSpace(ctx->getAlphabet()->getType()); QString statsInfo = QString("<table cellspacing=%1>").arg(COMMON_STATISTICS_TABLE_CELLSPACING); statsInfo += formTableRow(CAPTION_SEQ_REGION_LENGTH, getFormattedLongNumber(currentCommonStatistics.length), availableSpace); if (ctx->getAlphabet()->isNucleic()) { statsInfo += formTableRow(CAPTION_SEQ_GC_CONTENT, QString::number(currentCommonStatistics.gcContent, 'f', 2) + "%", availableSpace); statsInfo += formTableRow(CAPTION_SEQ_MOLAR_WEIGHT, QString::number(currentCommonStatistics.molarWeight, 'f', 2) + " Da", availableSpace); statsInfo += formTableRow(CAPTION_SEQ_MOLAR_EXT_COEF, QString::number(currentCommonStatistics.molarExtCoef) + " I/mol", availableSpace); statsInfo += formTableRow(CAPTION_SEQ_MELTING_TM, QString::number(currentCommonStatistics.meltingTm, 'f', 2) + " C", availableSpace); statsInfo += formTableRow(CAPTION_SEQ_NMOLE_OD, QString::number(currentCommonStatistics.nmoleOD260, 'f', 2), availableSpace); statsInfo += formTableRow(CAPTION_SEQ_MG_OD, QString::number(currentCommonStatistics.mgOD260, 'f', 2), availableSpace); } else if (ctx->getAlphabet()->isAmino()) { statsInfo += formTableRow(CAPTION_SEQ_MOLECULAR_WEIGHT, QString::number(currentCommonStatistics.molecularWeight, 'f', 2), availableSpace); statsInfo += formTableRow(CAPTION_SEQ_ISOELECTIC_POINT, QString::number(currentCommonStatistics.isoelectricPoint, 'f', 2), availableSpace); } statsInfo += "</table>"; statisticLabel->setText(statsInfo); }
void SecStructPredictViewAction::sl_execute() { QAction *a = dynamic_cast<QAction*>(sender()); GObjectViewAction *viewAction = dynamic_cast<GObjectViewAction*>(a); SAFE_POINT(NULL != viewAction, "NULL action",); AnnotatedDNAView *av = qobject_cast<AnnotatedDNAView*>(viewAction->getObjectView()); SAFE_POINT(NULL != av, "NULL dna view",); SecStructPredictAlgRegistry *sspar = AppContext::getSecStructPredictAlgRegistry(); SAFE_POINT(NULL != sspar, "NULL SecStructPredictAlgRegistry",); if (sspar->getAlgNameList().isEmpty()) { QMessageBox::information(av->getWidget(), tr("Secondary Structure Prediction"), tr("No algorithms for secondary structure prediction are available.\nPlease, load the corresponding plugins.")); return; } ADVSequenceObjectContext *seqCtx = av->getSequenceInFocus(); SAFE_POINT(NULL != seqCtx, "NULL sequence context",); SAFE_POINT(NULL != seqCtx->getAlphabet(), "NULL alphabet",); SAFE_POINT(seqCtx->getAlphabet()->isAmino(), "Wrong alphabet",); QObjectScopedPointer<SecStructDialog> secStructDialog = new SecStructDialog(seqCtx, av->getWidget()); secStructDialog->exec(); }
void EnzymesADVContext::sl_search() { GObjectViewAction* action = qobject_cast<GObjectViewAction*>(sender()); assert(action!=NULL); AnnotatedDNAView* av = qobject_cast<AnnotatedDNAView*>(action->getObjectView()); assert(av!=NULL); ADVSequenceObjectContext* seqCtx = av->getSequenceInFocus(); assert(seqCtx->getAlphabet()->isNucleic()); QObjectScopedPointer<FindEnzymesDialog> d = new FindEnzymesDialog(seqCtx); d->exec(); }
void SequenceInfo::updateDinuclLayout() { ADVSequenceObjectContext* activeSequenceContext = annotatedDnaView->getSequenceInFocus(); SAFE_POINT(0 != activeSequenceContext, "A sequence context is NULL!",); const DNAAlphabet* activeSequenceAlphabet = activeSequenceContext->getAlphabet(); SAFE_POINT(0 != activeSequenceAlphabet, "An active sequence alphabet is NULL!",); QString alphabetId = activeSequenceAlphabet->getId(); if ((alphabetId == BaseDNAAlphabetIds::NUCL_DNA_DEFAULT()) || (alphabetId == BaseDNAAlphabetIds::NUCL_RNA_DEFAULT())) { dinuclWidget->show(); } else { dinuclWidget->hide(); } }
void SequenceInfo::updateCharOccurLayout() { ADVSequenceObjectContext* activeSequenceContext = annotatedDnaView->getSequenceInFocus(); if (0 != activeSequenceContext) { const DNAAlphabet* activeSequenceAlphabet = activeSequenceContext->getAlphabet(); SAFE_POINT(0 != activeSequenceAlphabet, "An active sequence alphabet is NULL!",); if ((activeSequenceAlphabet->isNucleic()) || (activeSequenceAlphabet->isAmino())) { charOccurWidget->show(); } else { // Do not show the characters occurrence for raw alphabet charOccurWidget->hide(); } } }