void cal2::todayOnClicked() { QDate temp = cur_date; newCal(); if(temp.year()!=QDate::currentDate().year()) emit calyearchange(cur_date); else if(temp.month()!=QDate::currentDate().month()) emit calmonthchange(cur_date); else emit caldaychange(cur_date); }
void writeClump(struct blockPos *first, struct blockPos *last, char *cdnaName, char strand, char dir, DNA *cdna, int cdnaSize, struct cdnaAliList **pList) /* Write hitOut one clump. */ { struct dnaSeq *seq = first->seq; char *bacName = seq->name; int seqIx = first->seqIx; int start = first->offset; int end = last->offset+last->size; struct ffAli *ff, *left, *right; int extraAtEnds = minMatch*patSize; struct cdnaAliList *cal; start -= extraAtEnds; if (start < 0) start = 0; end += extraAtEnds; if (end >seq->size) end = seq->size; ++ffSubmitted; if (dumpMe) fprintf(dumpOut, "%s %d %s %d-%d\n", cdnaName, cdnaSize, bacName, start, end); ff = ffFind(cdna, cdna+cdnaSize, seq->dna+start, seq->dna+end, ffCdna); if (dumpMe) { fprintf(dumpOut, "ffFind = %x\n", ff); } if (ff != NULL) { int ffScore = ffScoreCdna(ff); ++ffAccepted; if (dumpMe) fprintf(dumpOut, "ffScore = %d\n", ffScore); if (ffScore >= 22) { int hiStart, hiEnd; int oldStart, oldEnd; ffFindEnds(ff, &left, &right); hiStart = oldStart = left->nStart - cdna; hiEnd = oldEnd = right->nEnd - cdna; ++ffOkScore; if (solidMatch(&left, &right, cdna, &hiStart, &hiEnd)) { int solidSize = hiEnd - hiStart; int solidScore; int seqStart, seqEnd; double cookedScore; solidScore = scoreCdna(left, right); cookedScore = (double)solidScore/solidSize; if (cookedScore > 0.25) { ++ffSolidMatch; seqStart = left->hStart - seq->dna; seqEnd = right->hEnd - seq->dna; fprintf(hitOut, "%3.1f%% %c %s:%d-%d (old %d-%d) of %d at %s.%d:%d-%d\n", 100.0 * cookedScore, strand, cdnaName, hiStart, hiEnd, oldStart, oldEnd, cdnaSize, bacName, seqIx, seqStart, seqEnd); if (dumpMe) { fprintf(bigHtmlFile, "<A NAME=i%d>", htmlIx); fprintf(bigHtmlFile, "<H2>%4.1f%% %4d %4d %c %s:%d-%d of %d at %s.%d:%d-%d</H2><BR>", 100.0 * cookedScore, solidScore, ffScore, strand, cdnaName, hiStart, hiEnd, cdnaSize, bacName, seqIx, seqStart, seqEnd); fprintf(bigHtmlFile, "</A>"); ffShAli(bigHtmlFile, ff, cdnaName, cdna, cdnaSize, 0, bacName, seq->dna+start, end-start, start, FALSE); fprintf(bigHtmlFile, "<BR><BR>\n"); fprintf(littleHtmlFile, "<A HREF=\"patAli.html#i%d\">", htmlIx); fprintf(littleHtmlFile, "%4.1f%% %4d %4d %c %s:%d-%d of %d at %s.%d:%d-%d\n", 100.0 * cookedScore, solidScore, ffScore, strand, cdnaName, hiStart, hiEnd, cdnaSize, bacName, seqIx, seqStart, seqEnd); fprintf(littleHtmlFile, "</A><BR>"); ++htmlIx; } cal = newCal(first->bacIx, seqIx, hiStart, hiEnd, cdnaSize, strand, dir, cookedScore); slAddHead(pList, cal); } } } ffFreeAli(&ff); } }
void glueFindOne(struct patSpace *ps, DNA *cdna, int cdnaSize, char strand, char dir, char *cdnaName, struct cdnaAliList **pList) /* Find occurrences of DNA in patSpace and print to hitOut. */ { struct patClump *clumpList, *clump; clumpList = patSpaceFindOne(ps, cdna, cdnaSize); for (clump = clumpList; clump != NULL; clump = clump->next) { struct ffAli *ff; struct dnaSeq *seq = clump->seq; DNA *tStart = seq->dna + clump->start; char *contigName = seq->name; int seqIx = clump->seqIx; int bacIx = clump->bacIx; ++ffSubmitted; ff = ffFind(cdna, cdna+cdnaSize, tStart, tStart + clump->size, ffCdna); if (ff != NULL) { int ffScore = ffScoreCdna(ff); ++ffAccepted; if (ffScore >= 22) { int hiStart, hiEnd; int oldStart, oldEnd; struct ffAli *left, *right; ffFindEnds(ff, &left, &right); hiStart = oldStart = left->nStart - cdna; hiEnd = oldEnd = right->nEnd - cdna; ++ffOkScore; if (solidMatch(&left, &right, cdna, &hiStart, &hiEnd)) { int solidSize = hiEnd - hiStart; int solidScore; int seqStart, seqEnd; double cookedScore; solidScore = scoreCdna(left, right); cookedScore = (double)solidScore/solidSize; if (cookedScore > 0.25) { struct cdnaAliList *cal; ++ffSolidMatch; seqStart = left->hStart - seq->dna; seqEnd = right->hEnd - seq->dna; fprintf(hitOut, "%3.1f%% %c %s:%d-%d (old %d-%d) of %d at %s.%d:%d-%d\n", 100.0 * cookedScore, strand, cdnaName, hiStart, hiEnd, oldStart, oldEnd, cdnaSize, contigName, seqIx, seqStart, seqEnd); cal = newCal(bacIx, seqIx, hiStart, hiEnd, cdnaSize, strand, dir, cookedScore); slAddHead(pList, cal); } } } ffFreeAli(&ff); } } slFreeList(&clumpList); }
void cal2::nextOnClicked() { newCal(cur_date.addMonths(1)); emit calmonthchange(cur_date); }
cal2::cal2(QWidget *parent) : QWidget(parent) { initBasicData(); //--------------------------顶层-------------------------------------------------------------- QFont font1; font1.setPixelSize(15); QPalette palette1; palette1.setColor(QPalette::WindowText,QColor(155,155,155,255)); today = new ClickedLabel; today->setFont(font1); today->setPalette(palette1); today->setText(tr("Today")); connect(today,SIGNAL(clicked(ClickedLabel*)),this,SLOT(todayOnClicked())); pre = new ClickedLabel; pre->setFont(font1); pre->setPalette(palette1); pre->setText(tr("PRE")); connect(pre,SIGNAL(clicked(ClickedLabel*)),this,SLOT(preOnClicked())); next = new ClickedLabel; next->setFont(font1); next->setPalette(palette1); next->setText(tr("NEXT")); connect(next,SIGNAL(clicked(ClickedLabel*)),this,SLOT(nextOnClicked())); month = new ClickedLabel; month->setFont(font1); month->setPalette(palette1); year = new ClickedLabel; year->setFont(font1); year->setPalette(palette1); QHBoxLayout *toplayout = new QHBoxLayout; toplayout->addWidget(today); toplayout->addStretch(); toplayout->addWidget(pre); toplayout->addSpacing(20); toplayout->addWidget(month); toplayout->addSpacing(5); toplayout->addWidget(year); toplayout->addSpacing(20); toplayout->addWidget(next); toplayout->addStretch(); //--------------------------顶层结束---------------------------------------------------------- //---------------------------星期--------------------------------------------------------------- QString weekstr[7]={"MON","TUE","WED","THU","FRI","SAT","SUN"}; QHBoxLayout* weeklayout = new QHBoxLayout; weeklayout->setSpacing(0); QFont font2; font2.setPixelSize(15); QPalette palette2; palette2.setColor(QPalette::WindowText,QColor(155,155,155,255)); for(int i=0;i<7;i++) { QLabel* label = new QLabel(tr("%1").arg(weekstr[i])); label->setFont(font2); label->setPalette(palette2); label->setAlignment(Qt::AlignBottom|Qt::AlignHCenter); label->setFixedHeight(20); weeklayout->addWidget(label); } QVBoxLayout *toplayout2 = new QVBoxLayout; toplayout2->addLayout(toplayout); toplayout2->addLayout(weeklayout); QWidget *topwidget = new QWidget; topwidget->setLayout(toplayout2); topwidget->setFixedHeight(70); topwidget->setAutoFillBackground(true); QPalette pet; pet.setColor(QPalette::Background,QColor(50,58,69)); topwidget->setPalette(pet); topwidget->setFixedHeight(100); //topwidget->setStyleSheet("background-color: rgb(50,58,69)"); //---------------------------星期结束--------------------------------------------------------------- //----------------------------月历---------------------------------------------------------------- QGridLayout* grid = new QGridLayout; grid->setSpacing(1); int row,col,num; for(row=0;row<6;row++) for(col=1;col<=7;col++) { num =row*7+col; labels[num] = new cal_label; QPalette lpa; lpa.setColor(QPalette::WindowText,QColor(200,200,200)); labels[num]->lunarday->setPalette(lpa); connect(labels[num],SIGNAL(clicked(cal_label*)),this,SLOT(changeday(cal_label*))); grid->addWidget(labels[num],row,col-1); } QVBoxLayout* mainlayout = new QVBoxLayout(); //mainlayout->setSpacing(0); mainlayout->addWidget(topwidget); mainlayout->addLayout(grid); QFont rtfont1; rtfont1.setPixelSize(30); righttop = new QLabel; righttop->setFont(rtfont1); righttop->setStyleSheet("color:white;background-color:rgb(20,185,214)"); righttop->setFixedSize(360,100); //righttop->setAlignment(Qt::AlignCenter); righttop->setIndent(20); righttop2 = new QLabel; rtfont1.setPixelSize(20); righttop2->setFont(rtfont1); righttop2->setFixedHeight(100); righttop2->setStyleSheet("color:white;background-color:grey"); righttop2->setAlignment(Qt::AlignCenter); //righttop2->setIndent(30); QVBoxLayout *rtlayout = new QVBoxLayout; rtlayout->addWidget(righttop); rtlayout->addWidget(righttop2); rtlayout->setSpacing(0); // QLabel *rtwidget = new QLabel; // rtwidget->setLayout(rtlayout); // rtwidget->setFixedHeight(200); // rtwidget->setStyleSheet("background-color:rgb(107,203,202)"); // //rtwidget->setPalette(pet); todaylist = new QListWidget; QFont f1; f1.setPixelSize(20); todaylist->setFont(f1); //todaylist->setStyleSheet("background-color:rgb(24,34,144)"); QVBoxLayout *right1 = new QVBoxLayout; right1->addLayout(rtlayout); right1->addWidget(todaylist); QHBoxLayout *lastlayout = new QHBoxLayout(this); lastlayout->setSpacing(1); lastlayout->addLayout(mainlayout); lastlayout->addLayout(right1); lastlayout->setMargin(0); newCal(); }