├── .gitignore ├── LICENSE ├── README.md ├── dependence ├── DataBase │ ├── Rare List.txt │ ├── SoapTypingDB.db │ ├── altered_all.classes │ └── availble.txt ├── Database_V1.0.5.1 │ ├── commonGsspDatabase │ ├── dir.ini │ ├── report.ini │ ├── soapTypingGsspDatabase │ └── soapTypingStaticDatabase ├── config.dat ├── font │ └── msyh.ttc └── keyfile ├── doc ├── ABIF_File_Format.pdf ├── SOAPTyping_Supplement_Materials.docx ├── images │ ├── alleleAlignment.png │ ├── databaseUpdate.png │ ├── gsspInsert.png │ ├── gsspUpdate.png │ ├── mainUI.png │ ├── mainUI_old.png │ ├── openFile.png │ ├── propositionalWorkflow.png │ └── reportDemo.png └── 更新说明.docx └── src ├── Core ├── Ab1.cpp ├── Ab1.h ├── core.cpp ├── core.h ├── fileTablebase.cpp └── fileTablebase.h ├── DataBase ├── soaptypingdb.cpp └── soaptypingdb.h ├── Dialog ├── alignmentdlg.cpp ├── alignmentdlg.h ├── alignmentdlg.ui ├── allelepairdlg.cpp ├── allelepairdlg.h ├── allelepairdlg.ui ├── deletefiledlg.cpp ├── deletefiledlg.h ├── deletefiledlg.ui ├── exontimdlg.cpp ├── exontimdlg.h ├── exontimdlg.ui ├── finaltypedlg.cpp ├── finaltypedlg.h ├── finaltypedlg.ui ├── gsspinfodlg.cpp ├── gsspinfodlg.h ├── gsspinfodlg.ui ├── loadfiledlg.cpp ├── loadfiledlg.h ├── loadfiledlg.ui ├── openfiledialog.cpp ├── openfiledialog.h ├── openfiledialog.ui ├── reportdlg.cpp ├── reportdlg.h ├── reportdlg.ui ├── savefiledlg.cpp ├── savefiledlg.h ├── savefiledlg.ui ├── setdlg.cpp ├── setdlg.h ├── setdlg.ui ├── updatedatadlg.cpp ├── updatedatadlg.h ├── updatedatadlg.ui ├── usercommentdlg.cpp ├── usercommentdlg.h └── usercommentdlg.ui ├── HLA.pro ├── Mainwindow ├── basealigntablewidget.cpp ├── basealigntablewidget.h ├── exonnavigatorwidget.cpp ├── exonnavigatorwidget.h ├── mainwindow.cpp ├── mainwindow.h ├── mainwindow.ui ├── matchlistwidget.cpp ├── matchlistwidget.h ├── multipeakwidget.cpp ├── multipeakwidget.h ├── sampletreewidget.cpp └── sampletreewidget.h ├── SoapTyping.rc ├── ThreadTask ├── analysisab1threadtask.cpp ├── analysisab1threadtask.h ├── analysissamplethreadtask.cpp ├── analysissamplethreadtask.h ├── fileprocessthreadtask.cpp └── fileprocessthreadtask.h ├── all_base_struct.h ├── font └── msyh.ttc ├── hla.qrc ├── images ├── about.png ├── alignlab.png ├── alignpair.png ├── apply.png ├── backward.png ├── branch-end.png ├── branch-more.png ├── control.png ├── deleteall.png ├── filetree00.png ├── filetree01.png ├── filetree02.png ├── filetree03.png ├── filetree04.png ├── filetree10.png ├── filetree11.png ├── filetree12.png ├── filetree13.png ├── filetree14.png ├── filetree20.png ├── filetree21.png ├── filetree22.png ├── filetree23.png ├── filetree24.png ├── filetree30.png ├── filetree31.png ├── filetree32.png ├── filetree33.png ├── filetree34.png ├── filetreeFile0.png ├── filetreeFile1.png ├── filetreeFile2.png ├── forward.png ├── logo.png ├── logo1.png ├── markfinishedall.png ├── marksuccessfulall.png ├── minus.png ├── opennewfile.png ├── openoldfile.png ├── plus.png ├── putdown-.png ├── putdown-bg.png ├── putleft-.png ├── putleft-bg.png ├── putright-.png ├── putright-bg.png ├── putup-.png ├── putup-bg.png ├── report.png ├── reset.png ├── saveall.png ├── updatedatabase.png ├── vline.png ├── zoomreset.png ├── zoomxincrease.png ├── zoomxreduce.png ├── zoomyaxisincrease.png ├── zoomyaxisreduce.png ├── zoomyincrease.png └── zoomyreduce.png ├── log ├── log.cpp ├── log.h └── macro_define.h ├── logo.ico ├── main.cpp └── qss └── qss /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | src/SoapTyping.pro.user.-1 3 | -------------------------------------------------------------------------------- /dependence/DataBase/SoapTypingDB.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/dependence/DataBase/SoapTypingDB.db -------------------------------------------------------------------------------- /dependence/DataBase/altered_all.classes: -------------------------------------------------------------------------------- 1 | A 0 2 | A 192 3 | A 194 4 | A 224 5 | A 226 6 | A 240 7 | A 242 8 | B 0 9 | B 2 10 | B 64 11 | B 66 12 | B 96 13 | B 98 14 | B 112 15 | B 114 16 | C 0 17 | C 2 18 | C 192 19 | C 194 20 | C 224 21 | C 226 22 | C 240 23 | C 242 24 | G 0 25 | G 2 26 | G 192 27 | G 194 28 | G 224 29 | G 226 30 | G 240 31 | G 242 32 | DPA1 0 33 | DPA1 2 34 | DPA1 8 35 | DPA1 10 36 | DPB1 0 37 | DPB1 24 38 | DPB1 26 39 | DQA1 0 40 | DQA1 2 41 | DQA1 8 42 | DQA1 10 43 | DQB1 0 44 | DQB1 2 45 | DQB1 16 46 | DQB1 18 47 | DQB1 24 48 | DQB1 26 49 | DRB1 0 50 | DRB1 32 51 | DRB1 34 52 | DRB1 48 53 | DRB1 50 54 | DRB1 56 55 | DRB1 58 56 | DRB3 0 57 | DRB3 48 58 | DRB3 50 59 | DRB3 58 60 | DRB4 0 61 | DRB4 50 62 | DRB4 58 63 | DRB5 0 64 | DRB5 50 65 | DRB5 58 66 | -------------------------------------------------------------------------------- /dependence/DataBase/availble.txt: -------------------------------------------------------------------------------- 1 | A 123456 2 | B 123456 3 | C 1234567 4 | DRB1 1234 5 | DRB3 23 6 | DRB4 23 7 | DRB5 23 8 | DQA1 1234 9 | DQB1 12345 10 | DPB1 1234 11 | G 12345 12 | DPA1 123 13 | -------------------------------------------------------------------------------- /dependence/Database_V1.0.5.1/commonGsspDatabase: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/dependence/Database_V1.0.5.1/commonGsspDatabase -------------------------------------------------------------------------------- /dependence/Database_V1.0.5.1/dir.ini: -------------------------------------------------------------------------------- 1 | E:\9samples\16D0155253-A-0067-E02_A_2F_E02.ab1 2 | -------------------------------------------------------------------------------- /dependence/Database_V1.0.5.1/report.ini: -------------------------------------------------------------------------------- 1 | D:\test 2 | -------------------------------------------------------------------------------- /dependence/Database_V1.0.5.1/soapTypingGsspDatabase: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/dependence/Database_V1.0.5.1/soapTypingGsspDatabase -------------------------------------------------------------------------------- /dependence/Database_V1.0.5.1/soapTypingStaticDatabase: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/dependence/Database_V1.0.5.1/soapTypingStaticDatabase -------------------------------------------------------------------------------- /dependence/config.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/dependence/config.dat -------------------------------------------------------------------------------- /dependence/font/msyh.ttc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/dependence/font/msyh.ttc -------------------------------------------------------------------------------- /dependence/keyfile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/dependence/keyfile -------------------------------------------------------------------------------- /doc/ABIF_File_Format.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/doc/ABIF_File_Format.pdf -------------------------------------------------------------------------------- /doc/SOAPTyping_Supplement_Materials.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/doc/SOAPTyping_Supplement_Materials.docx -------------------------------------------------------------------------------- /doc/images/alleleAlignment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/doc/images/alleleAlignment.png -------------------------------------------------------------------------------- /doc/images/databaseUpdate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/doc/images/databaseUpdate.png -------------------------------------------------------------------------------- /doc/images/gsspInsert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/doc/images/gsspInsert.png -------------------------------------------------------------------------------- /doc/images/gsspUpdate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/doc/images/gsspUpdate.png -------------------------------------------------------------------------------- /doc/images/mainUI.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/doc/images/mainUI.png -------------------------------------------------------------------------------- /doc/images/mainUI_old.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/doc/images/mainUI_old.png -------------------------------------------------------------------------------- /doc/images/openFile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/doc/images/openFile.png -------------------------------------------------------------------------------- /doc/images/propositionalWorkflow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/doc/images/propositionalWorkflow.png -------------------------------------------------------------------------------- /doc/images/reportDemo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/doc/images/reportDemo.png -------------------------------------------------------------------------------- /doc/更新说明.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/doc/更新说明.docx -------------------------------------------------------------------------------- /src/Core/Ab1.h: -------------------------------------------------------------------------------- 1 | #ifndef AB1_H 2 | #define AB1_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | typedef struct _tagAB1Tag 9 | { 10 | qint32 name; /* tag name */ 11 | qint32 number; /* tag number */ 12 | qint16 elementtype; /* element type code */ 13 | qint16 elementsize; /* element size */ 14 | qint32 numelements; /* number of elements */ 15 | qint32 datasize; /* data size */ 16 | qint32 dataoffset; /* data offset */ 17 | qint32 datahandle; /*reserve,unuse*/ 18 | } AB1Tag; 19 | 20 | typedef struct _tagBaseo 21 | { 22 | char basetype; /* A T G C (sequences or stored in trace data) */ 23 | int pos; /* position */ 24 | int signal; /* signal strength value */ 25 | int qual; /* quality value if sequence or else 0 */ 26 | } Baseo; 27 | 28 | class Ab1 29 | { 30 | public: 31 | Ab1(const QString &str_path); 32 | ~Ab1(); 33 | bool AnalysisFile(); 34 | bool IsAb1File(); 35 | int getNumBase(); 36 | int getBaseOffset(); 37 | int getBasePosOffset(); 38 | int getQualOffset(); 39 | int getNumTraceData(); 40 | bool getFWO(); 41 | float getBaseSpace(); 42 | bool getTraceDataOffset(long *Offset); 43 | bool isAb1Good(); 44 | bool getBaseSeq(long offset, long num, char* pseq); 45 | bool getBaseQual(long offset, long num, int *qualArry, int &maxQual); 46 | bool getBasePosition(long offset, long num, int *posArry); 47 | bool getTraceData(Baseo *baseG, Baseo *baseA, Baseo *baseT, Baseo *baseC, 48 | long *offset, long num, int &maxSignal); 49 | bool getBaseData(Baseo* base, long num, int *basqQual, char *baseSeq, int *basePos, 50 | Baseo* baseG, Baseo* baseA, Baseo* baseT, Baseo* baseC); 51 | bool hasPeak_test(Baseo* base, int low, int high, int &pos); 52 | bool hasPeak(Baseo* base, int low, int high, int &pos); 53 | bool IsValidPeak(Baseo* base, int low, int high,int basePos,int signal); 54 | bool getPeak(Baseo* baseG, Baseo* baseA, Baseo* baseT, Baseo* baseC, Baseo* base, 55 | int *basePos, long num); 56 | float signalRatio(Baseo *baseG, Baseo *baseA, Baseo *baseT, Baseo *baseC, Baseo *base, 57 | int *basePos, long num); 58 | Baseo* reverseComplement(Baseo* base, int numBase, int numTrace, int flag); 59 | private: 60 | QFile m_file; 61 | char m_cFWO[4]; 62 | QMultiHash m_multiHash; 63 | }; 64 | 65 | #endif // AB1_H 66 | -------------------------------------------------------------------------------- /src/Core/core.cpp: -------------------------------------------------------------------------------- 1 | #include "core.h" 2 | #include 3 | 4 | #define LEFT 1 5 | #define TOP 2 6 | #define DIAG 3 7 | 8 | #define SCORE_SAME 2 9 | #define SCORE_MATCH 1 10 | #define SCORE_MISMATCH -1 11 | #define SCORE_INSERTION -1 12 | #define SCORE_DELETION -1 13 | 14 | #define MIN_MIS 15 15 | #define MIN_CUT_MIS 10 16 | 17 | Core::Core() 18 | { 19 | m_pConfigSet = new QSettings("./config.ini", QSettings::IniFormat); 20 | } 21 | 22 | Core::~Core() 23 | { 24 | delete m_pConfigSet; 25 | m_pConfigSet = nullptr; 26 | } 27 | 28 | void Core::AnalysisAb1() 29 | { 30 | 31 | } 32 | 33 | int Core::equal(char a, char b)//简并碱基有相同的碱基,认为是相同(H=Y H=W) 34 | { 35 | int fa = formatMerge(a); 36 | int fb = formatMerge(b); 37 | 38 | return fa & fb; 39 | } 40 | 41 | char *Core::reverse(char *s) 42 | { 43 | int m = strlen(s); 44 | int i; 45 | char *rs = (char*) malloc(sizeof(char)*(m+1)); 46 | 47 | for(i = 0; i < m; i++) 48 | rs[i] = s[m-1-i]; 49 | 50 | rs[m] = '\0'; 51 | return rs; 52 | } 53 | 54 | 55 | bool Core::can_merge(char A, char B) 56 | { 57 | if(A=='.' || B=='.') 58 | return false; 59 | if(B == 'N') 60 | return true; 61 | //return ((~formatMerge(A)) & formatMerge(B)) == 0; 62 | return equal(A, B); 63 | } 64 | 65 | void Core::GetFileAlignResult(FileAlignNew &file_align_new, FileAlignResult &result, bool auto_cut) 66 | { 67 | if(strlen(file_align_new.consensus)==0 || 68 | file_align_new.exclude_left_num+file_align_new.exclude_right_num >= strlen(file_align_new.raw_seq)) 69 | { 70 | result.isUnDefined =1; 71 | return; 72 | } 73 | 74 | 75 | FileAlignResultNew tmp_result; 76 | tmp_result.left_cut = file_align_new.exclude_left_num; 77 | tmp_result.right_cut = file_align_new.exclude_right_num; 78 | 79 | //寻找consensus和raw_seq的最大公共子序列,并调整边界,把结果序列保存到tmp_result中 80 | 81 | 82 | // qDebug()<<"---start------"; 83 | // qDebug()<setValue(key, value); 259 | } 260 | 261 | void Core::GetConfig(const QString &key,QString &value) 262 | { 263 | value = m_pConfigSet->value(key).toString(); 264 | } 265 | 266 | bool Core::isEqualPC(char A, char B) 267 | { 268 | unsigned int a = formatMerge(A); 269 | unsigned int b = formatMerge(B); 270 | return (a|b)==a; 271 | } 272 | 273 | 274 | void Core::Align_LCS_new(const char *ref, const char *seq, FileAlignResultNew *result) 275 | { 276 | int m = strlen(ref); 277 | int n = strlen(seq); 278 | //SC: limit sanger seq length 279 | if (n>1100){ 280 | n = 1100; 281 | } 282 | int maxscore = 0, x = 0, y = 0; 283 | std::vector> vec_matrix(m, std::vector(n+1, 0)); 284 | //SC: set empty matrix to mx(n+1), to keep the most right column be '0''. 空矩阵设为mx(n+1),保证最右一个列全是0 285 | std::vector ref_back; 286 | std::vector seq_back; 287 | 288 | for (int i = 0; i < m ; i++) 289 | { 290 | for (int j = 0; j < n ; j++) 291 | { 292 | if (equal(ref[i], seq[j])) 293 | { 294 | if (i == 0 || j == 0) 295 | { 296 | vec_matrix[i][j] = 1; 297 | } 298 | else 299 | { 300 | vec_matrix[i][j] = vec_matrix[i - 1][j - 1] + 1; 301 | } 302 | } 303 | 304 | if (maxscore < vec_matrix[i][j]) 305 | { 306 | maxscore = vec_matrix[i][j]; 307 | x = i; 308 | y = j; 309 | } 310 | } 311 | } 312 | 313 | int ref_stop = x+1; 314 | int seq_stop = y+1; 315 | 316 | ref_back.clear(); 317 | seq_back.clear(); 318 | while (maxscore>0) 319 | { 320 | //SC: ignore alignment smaller than 10. 小于10的片段不考虑 321 | if (vec_matrix[x][y]<(vec_matrix[x][y+1]-10)){ 322 | ref_back.push_back(ref[x--]); 323 | seq_back.push_back('-'); 324 | // qDebug()<= 0 && y >= 0) 338 | // { 339 | // if (equal(ref[x], seq[y])) 340 | // { 341 | // ref_back.push_back(ref[x]); 342 | // seq_back.push_back(seq[y]); 343 | // x--; 344 | // y--; 345 | // } 346 | // else 347 | // { 348 | // ref_back.push_back('-'); 349 | // seq_back.push_back(seq[y]); 350 | // y--; 351 | // } 352 | 353 | // } 354 | 355 | while (x >= 0) 356 | { 357 | ref_back.push_back(ref[x--]); 358 | seq_back.push_back('-'); 359 | } 360 | 361 | std::reverse(ref_back.begin(), ref_back.end()); 362 | std::reverse(seq_back.begin(), seq_back.end()); 363 | 364 | int dif_num = 0; 365 | std::vector ref_back_tmp; 366 | std::vector seq_back_tmp; 367 | int ref_stop_tmp = ref_stop; 368 | int seq_stop_tmp = seq_stop; 369 | while (ref_stop < m && seq_stop< n) 370 | { 371 | if (equal(ref[ref_stop], seq[seq_stop])) 372 | { 373 | ref_back_tmp.push_back(ref[ref_stop]); 374 | seq_back_tmp.push_back(seq[seq_stop]); 375 | ref_stop++; 376 | seq_stop++; 377 | } 378 | else 379 | { 380 | ref_back_tmp.push_back('-'); 381 | seq_back_tmp.push_back(seq[seq_stop]); 382 | seq_stop++; 383 | dif_num++; 384 | } 385 | } 386 | 387 | if(dif_num > 5) //不一致的过多 388 | { 389 | ref_stop = ref_stop_tmp; 390 | seq_stop = seq_stop_tmp; 391 | // seq_stop = seq_stop_tmp+(m-ref_stop); 392 | // if(seq_stop>n) 393 | // { 394 | // seq_stop = n; 395 | // } 396 | } 397 | else 398 | { 399 | for(auto it=ref_back_tmp.begin();it!=ref_back_tmp.end();it++) 400 | { 401 | ref_back.push_back(*it); 402 | } 403 | 404 | for(auto it=seq_back_tmp.begin();it!=seq_back_tmp.end();it++) 405 | { 406 | seq_back.push_back(*it); 407 | } 408 | } 409 | while (ref_stop < m) 410 | { 411 | ref_back.push_back(ref[ref_stop]); 412 | seq_back.push_back('-'); 413 | ref_stop++; 414 | } 415 | 416 | result->consensus_alignment.append(ref_back.data(), ref_back.size()); 417 | result->sample_alignment.append(seq_back.data(), seq_back.size()); 418 | result->left_cut = y+1; 419 | result->right_cut = seq_stop; 420 | result->is_match = true; 421 | } 422 | -------------------------------------------------------------------------------- /src/Core/core.h: -------------------------------------------------------------------------------- 1 | #ifndef CORE_H 2 | #define CORE_H 3 | 4 | #include "all_base_struct.h" 5 | #include 6 | #include 7 | 8 | typedef struct _tagMyalign 9 | { 10 | std::vector ref_back; 11 | std::vector seq_back; 12 | int ref_start; 13 | int ref_stop; 14 | int seq_start; 15 | int seq_stop; 16 | }Myalign; 17 | 18 | class Core 19 | { 20 | public: 21 | static Core *GetInstance() 22 | { 23 | static Core instance; 24 | return &instance; 25 | } 26 | ~Core(); 27 | void AnalysisAb1(); 28 | void GetFileAlignResult(FileAlignNew &file_align_new, FileAlignResult &result, bool auto_cut); 29 | int equal(char a, char b); 30 | char *reverse(char *s); 31 | bool can_merge(char A, char B); 32 | unsigned int formatMerge(char A); 33 | char reFormatMerge(unsigned int a); 34 | char mergeBases(char A, char B); 35 | QIcon getIcon(int analysisType, int markType); 36 | QString getAnalysisType(int type); 37 | QString getMarkType(int type); 38 | void SetConfig(const QString &key, const QString &value); 39 | void GetConfig(const QString &key, QString &value); 40 | bool isEqualPC(char A, char B); 41 | void zzk(const char *ref, const char *seq, Myalign &zlign); 42 | bool zzk_boundary(const char *ref, const char *seq, Myalign &zlign, FileAlignResultNew *result); 43 | void Align_LCS_new(const char *ref, const char *seq, FileAlignResultNew *result); 44 | private: //禁用构造函数 45 | Core(); 46 | Core(const Core &){} 47 | Core& operator=(const Core&){} 48 | 49 | private: 50 | QSettings *m_pConfigSet; //读写ini文件 51 | }; 52 | 53 | #endif // CORE_H 54 | -------------------------------------------------------------------------------- /src/Core/fileTablebase.cpp: -------------------------------------------------------------------------------- 1 | #include "fileTablebase.h" 2 | 3 | Ab1FileTableBase::Ab1FileTableBase() 4 | { 5 | m_bGssp = false; 6 | m_cROrF = 'F'; 7 | m_iExonIndex = 0; 8 | m_iExonStartPos = 0; 9 | m_iExonEndPos = 0; 10 | m_iBaseNumber = 0; 11 | m_iSignalNumber = 0; 12 | m_iMaxSignal = 0; 13 | m_iMaxQuality = 0; 14 | m_iIsGood = 0; 15 | m_iAlignResult = 0; 16 | m_iAlignStartPos = 0; 17 | m_iAlignEndPos = 0; 18 | m_iExcludeLeft = 0; 19 | m_iExcludeRight = 0; 20 | m_fAverageBaseWidth = 0.0; 21 | 22 | m_iExtraFile = 0; 23 | m_fAvgsignal = 0.0; 24 | } 25 | 26 | Ab1FileTableBase::~Ab1FileTableBase() 27 | { 28 | 29 | } 30 | 31 | Ab1NormalFileTable::Ab1NormalFileTable() 32 | { 33 | m_iExtraFile = 0; 34 | m_fAvgsignal = 0.0; 35 | } 36 | 37 | Ab1NormalFileTable::~Ab1NormalFileTable() 38 | { 39 | 40 | } 41 | 42 | Ab1GsspFileTable::Ab1GsspFileTable() 43 | { 44 | 45 | } 46 | 47 | Ab1GsspFileTable::~Ab1GsspFileTable() 48 | { 49 | 50 | } 51 | 52 | SampleTable::SampleTable() 53 | { 54 | m_iFileType = 0; 55 | m_iMarkType = 0; 56 | m_iAnalysisType = 0; 57 | m_iMinExonIndex = 0; 58 | m_iMaxExonIndex = 0; 59 | m_iExonStartPos = 0; 60 | m_iExonEndPos = 0; 61 | } 62 | 63 | SampleTable::~SampleTable() 64 | { 65 | 66 | } 67 | -------------------------------------------------------------------------------- /src/Core/fileTablebase.h: -------------------------------------------------------------------------------- 1 | #ifndef FILEINFOBASE_H 2 | #define FILEINFOBASE_H 3 | 4 | #include 5 | 6 | #define DEF_SET_GET(varType,varName,funName) \ 7 | private : varType varName; \ 8 | public : void set##funName(const varType &varName){this->varName = varName;} \ 9 | public : varType get##funName(void){return this->varName;} 10 | 11 | #define DEF_SET_GET_REF(varType,varName,funName) \ 12 | private : varType varName; \ 13 | public : void set##funName(const varType &varName){this->varName = varName;} \ 14 | public : varType &get##funName(void){return this->varName;} 15 | 16 | #define DEF_SET_GET_VIRTUAL(varType,funName) \ 17 | public : virtual void set##funName(const varType &){} \ 18 | public : virtual varType get##funName(void){return 0;} 19 | 20 | #define DEF_SET_GET_VIRTUAL_REF(varType,funName) \ 21 | public : virtual void set##funName(const varType &){} \ 22 | public : virtual varType &get##funName(void){static varType tmp;return tmp;} 23 | 24 | 25 | class Ab1FileTableBase 26 | { 27 | public: 28 | Ab1FileTableBase(); 29 | virtual ~Ab1FileTableBase(); 30 | 31 | DEF_SET_GET(bool, m_bGssp, IsGssp) 32 | DEF_SET_GET(QChar, m_cROrF, ROrF) 33 | 34 | DEF_SET_GET(int, m_iExonIndex, ExonIndex) 35 | DEF_SET_GET(int, m_iExonStartPos, ExonStartPos) 36 | DEF_SET_GET(int, m_iExonEndPos, ExonEndPos) 37 | DEF_SET_GET(int, m_iBaseNumber, BaseNumber) 38 | DEF_SET_GET(int, m_iSignalNumber, SignalNumber) 39 | DEF_SET_GET(int, m_iMaxSignal, MaxSignal) 40 | DEF_SET_GET(int, m_iMaxQuality, MaxQuality) 41 | DEF_SET_GET(int, m_iIsGood, IsGood) 42 | DEF_SET_GET(int, m_iAlignResult, AlignResult) 43 | DEF_SET_GET(int, m_iAlignStartPos, AlignStartPos) 44 | DEF_SET_GET(int, m_iAlignEndPos, AlignEndPos) 45 | DEF_SET_GET(int, m_iExcludeLeft, ExcludeLeft) 46 | DEF_SET_GET(int, m_iExcludeRight, ExcludeRight) 47 | 48 | DEF_SET_GET(float, m_fAverageBaseWidth, AverageBaseWidth) 49 | 50 | DEF_SET_GET_REF(QString, m_strFileName, FileName) 51 | DEF_SET_GET_REF(QString, m_strSampleName, SampleName) 52 | DEF_SET_GET_REF(QString, m_strFilePath, FilePath) 53 | DEF_SET_GET_REF(QString, m_strGeneName, GeneName) 54 | DEF_SET_GET_REF(QString, m_strUsefulSequence, UsefulSequence) 55 | DEF_SET_GET_REF(QByteArray, m_strBaseSequence, BaseSequence) 56 | DEF_SET_GET_REF(QString, m_strBasePostion, BasePostion) 57 | DEF_SET_GET_REF(QString, m_strBaseQuality, BaseQuality) 58 | DEF_SET_GET_REF(QString, m_strBaseASignal, BaseASignal) 59 | DEF_SET_GET_REF(QString, m_strBaseTSignal, BaseTSignal) 60 | DEF_SET_GET_REF(QString, m_strBaseGSignal, BaseGSignal) 61 | DEF_SET_GET_REF(QString, m_strBaseCSignal, BaseCSignal) 62 | DEF_SET_GET_REF(QString, m_strAlignInfo, AlignInfo) 63 | DEF_SET_GET_REF(QString, m_strEditInfo, EditInfo) 64 | 65 | // DEF_SET_GET_VIRTUAL(int, ExtraFile) 66 | // DEF_SET_GET_VIRTUAL(float, Avgsignal) 67 | 68 | // DEF_SET_GET_VIRTUAL_REF(QString, GsspName) 69 | // DEF_SET_GET_VIRTUAL_REF(QString, TypeResult) 70 | // DEF_SET_GET_VIRTUAL_REF(QString, FilterResult) 71 | DEF_SET_GET(int, m_iExtraFile, ExtraFile) 72 | DEF_SET_GET(float, m_fAvgsignal, Avgsignal) 73 | 74 | DEF_SET_GET_REF(QString, m_strGsspName, GsspName) 75 | DEF_SET_GET_REF(QString, m_strTypeResult, TypeResult) 76 | DEF_SET_GET_REF(QString, m_strFilterResult, FilterResult) 77 | 78 | }; 79 | 80 | 81 | class Ab1NormalFileTable:public Ab1FileTableBase 82 | { 83 | public: 84 | Ab1NormalFileTable(); 85 | ~Ab1NormalFileTable(); 86 | 87 | DEF_SET_GET(int, m_iExtraFile, ExtraFile) 88 | DEF_SET_GET(float, m_fAvgsignal, Avgsignal) 89 | }; 90 | 91 | class Ab1GsspFileTable:public Ab1FileTableBase 92 | { 93 | public: 94 | Ab1GsspFileTable(); 95 | ~Ab1GsspFileTable(); 96 | 97 | DEF_SET_GET_REF(QString, m_strGsspName, GsspName) 98 | DEF_SET_GET_REF(QString, m_strTypeResult, TypeResult) 99 | DEF_SET_GET_REF(QString, m_strFilterResult, FilterResult) 100 | }; 101 | 102 | class SampleTable 103 | { 104 | public: 105 | SampleTable(); 106 | ~SampleTable(); 107 | 108 | DEF_SET_GET_REF(QString, m_strSampleName, SampleName) 109 | DEF_SET_GET_REF(QString, m_strGeneName, GeneName) 110 | 111 | DEF_SET_GET(int, m_iFileType, FileType) 112 | DEF_SET_GET(int, m_iMarkType, MarkType) 113 | DEF_SET_GET(int, m_iAnalysisType, AnalysisType) 114 | DEF_SET_GET(int, m_iMinExonIndex, MinExonIndex) 115 | DEF_SET_GET(int, m_iMaxExonIndex, MaxExonIndex) 116 | DEF_SET_GET(int, m_iExonStartPos, ExonStartPos) 117 | DEF_SET_GET(int, m_iExonEndPos, ExonEndPos) 118 | 119 | DEF_SET_GET_REF(QString, m_strConsensusSequence, ConsensusSequence) 120 | DEF_SET_GET_REF(QString, m_strForwardSequence, ForwardSequence) 121 | DEF_SET_GET_REF(QString, m_strReverseSequence, ReverseSequence) 122 | DEF_SET_GET_REF(QString, m_strPatternSequence, PatternSequence) 123 | DEF_SET_GET_REF(QString, m_strMismatchBetweenPC, MismatchBetweenPC) 124 | DEF_SET_GET_REF(QString, m_strMismatchBetweenFR, MismatchBetweenFR) 125 | DEF_SET_GET_REF(QString, m_strMmismatchBetweenFR, MmismatchBetweenFR) 126 | DEF_SET_GET_REF(QString, m_strEditPostion, EditPostion) 127 | DEF_SET_GET_REF(QString, m_strTypeResult, TypeResult) 128 | DEF_SET_GET_REF(QString, m_strGsspInfo, GsspInfo) 129 | DEF_SET_GET_REF(QString, m_strShieldAllele, ShieldAllele) 130 | DEF_SET_GET_REF(QString, m_strSetResult, SetResult) 131 | DEF_SET_GET_REF(QString, m_strSetNote, SetNote) 132 | DEF_SET_GET_REF(QString, m_strSetGSSP, SetGSSP) 133 | DEF_SET_GET_REF(QString, m_strCombinedResult, CombinedResult) 134 | }; 135 | 136 | #endif // FILEINFOBASE_H 137 | -------------------------------------------------------------------------------- /src/DataBase/soaptypingdb.h: -------------------------------------------------------------------------------- 1 | #ifndef SOAPTYPINGDB_H 2 | #define SOAPTYPINGDB_H 3 | 4 | #include 5 | #include "all_base_struct.h" 6 | #include "Core/fileTablebase.h" 7 | 8 | class SoapTypingDB 9 | { 10 | public: 11 | static SoapTypingDB *GetInstance() 12 | { 13 | static SoapTypingDB instance; 14 | return &instance; 15 | } 16 | ~SoapTypingDB(); 17 | void GetGsspNames(QStringList &gsspNames); //获取gssp名称列表 18 | bool GetCommonGsspMapToExonAndFR(QMap &mapToExonAndFR); 19 | void GetGsspMapToExonAndFR(QMap &mapToExonAndFR); 20 | void GetExonInfo(const QString &gene_name, int exon_index, ExonInfoS& exonInfo); 21 | int GetExcludePosition(const QString &key, int &lefpos, int &rightpos); 22 | void InsertOneFileTable(Ab1FileTableBase &fileTable); 23 | void insertOneGsspFileTable(Ab1FileTableBase &fileTable); 24 | int getFileInfoFromRealTimeDatabase(const QString &sampleName, QVector &fileInfos, 25 | ExonInfo &exonInfo); 26 | int getGsspFileInfoFromRealTimeDatabase(const QString &sampleName, QVector &gsspFileInfos, 27 | ExonInfo &exonInfo); 28 | void compareWithExonInfo(ExonInfo &exonInfo, int exonIndex, int exonStartPos, int exonEndPos); 29 | void modifySequence(QByteArray &sequence, QSet &editPostion, int exonStartPos, int excludeLeft, 30 | int excludeRight, const QString &editString); 31 | void insertSampleInfoToRealTimeDatabase(const SampleInfo &sampleInfo); 32 | void getConsensusSequenceFromStaticDatabase(const QString &geneName, QByteArray &geneSequence, 33 | int exonStartPos, int exonLength); 34 | void getShieldAllelesFromDatabase(const QString &sampleName, QSet &shieldAlleles); 35 | void getAlleleInfosFromStaticDatabase(const QString &geneName, int exonStartPos, int alleleLength, 36 | int minExonIndex, int maxExonIndex, QVector &alleleInfos, 37 | QSet &shieldAlleles); 38 | void getGsspAlleleInfosFromStaticDatabase(const QString &geneName, int exonStartPos, int gsspLength, 39 | QVector &gsspAlleleInfos, const QString &gsspName); 40 | void getGsspPosAndSeqFromGsspDatabase(const QString &gsspName, int &gsspPos, QString &gsspSeq); 41 | void updateGsspFileResultToRealTimeDatabase(const QString &fileName, int alignResult, 42 | const QString &typeResult, const QString &filterResult); 43 | 44 | void getSampleTreeDataFromSampleTable(QMap &map_sampleTreeInfo); 45 | void getFileTreeInfosFromRealTimeDatabase(const QString &sampleName, QVector &fileTreeInfos); 46 | void getGsspFileTreeInfosFromRealTimeDatabase(const QString &sampleName, QVector &gsspTreeInfos); 47 | void getResultDataFromsampleTable(const QString &sampleName, bool isCombined, QStringList &typeResult); 48 | void getResultDataFromGsspTable(const QString &fileName, bool isGsspFilter, 49 | bool isGssp, QStringList &typeResult); 50 | 51 | void getAlldataFormRealTime(const QString &sampleName, int exonIndex, 52 | QVector &vec_filetable); 53 | 54 | void getExonPositionIndex(const QString &geneName, QVector &position); 55 | void getExonNavigatorInfo(const QString &sampleName, ExonNavigatorInfo &exonNavigatorInfo); 56 | 57 | void getBaseAlignSampleInfo(const QString &sampleName, BaseAlignSampleInfo &baseAlignSampleInfo); 58 | 59 | void getMarkTypeAndAnalysisFromSampleTable(const QString &sampleName, int &marktype, int &analysis); 60 | void setMarkTypeBySampleName(const QString &sampleName, int type); 61 | 62 | void getSetNoteFromSampleTable(const QString &sampleName, QString ¬einfo); 63 | void updateSetNoteBySampleName(const QString &sampleName, const QString &info); 64 | 65 | void deleteSample(const QString &sampleName); 66 | void deleteFile(bool isgssp, const QString &str_filename); 67 | 68 | void saveSample(const QString &sampleName,const QString &samplePath,const QString &date); 69 | void saveFile(bool isGssp, const QString &fileName, const QString &filePath,const QString &dir, 70 | const QString &date); 71 | 72 | void getIndelInfoFromalleleTable(const QString &alleleName, IndelInfo &indelInfo); 73 | void updateShieldAllelesToSampleTable(const QString &sampleName, const QString &alleles); 74 | 75 | void updateSetGsspBySampleName(const QString& sampleName, const QString &gsspInfo); 76 | void updateSetResultBySampleName(const QString &sampleName, const QString &result); 77 | void getSetResultBySampleName(const QString &sampleName, QString & result); 78 | void getAlleleSequence(const QString &alleleName, QByteArray &alleleSeq,int alignStartPos = 0, int alignLength = 0); 79 | void getExonIndexAndGeneBySampleName(const QString &sampleName, int &exonStart, int &exonEnd, QByteArray &geneName); 80 | void getGsspTablesFromGsspDatabase(const QString &geneName, int exon, QVector &gsspTables); 81 | void getExonPositionIndexFromStaticDatabase(const QString &geneName, QVector &position); 82 | void insertOneSampleTable(SampleTable &sampleTable); 83 | void getSampleNamesFromRealTimeDatabase(QStringList &sampleNames); 84 | void getSampleStartEndBySampleName(const QString &sampleName, int &start, int &end); 85 | int getResultFromRealTimeDatabaseBySampleName(const QString &sampleName, QString &result); 86 | bool isIndelInRange(const QString &alleleName, int start, int end); 87 | 88 | int getMarkTypeBySampleName(const QString &sampleName); 89 | void resetFileByFileName(const QString &fileName, bool isGssp); 90 | void markAllSampleApproved(); 91 | int markAllSampleReviewed(); 92 | void getAlleleNameListFromStaticDabase(const QString &geneName, QStringList &alleleNames); 93 | 94 | void getGeneNames(QStringList &geneNames); 95 | void getGeneVersion(QString &strver); 96 | void getExonTrimListByGeneName(const QString &geneName, QVector &exonTrimTableList); 97 | void updateExonTrim(const ExonTrimTable &exonTrimTable); 98 | void getAlleleNamesAndSeqsByGeneName(const QString &geneName, QStringList &alleleNames, 99 | QStringList &alleleSeqs, QVector< QVector > &misPositions); 100 | void getAlleleSequenceByAlleleName(const QString &alleleName, QString &alleleSeq); 101 | 102 | bool upDateAlignInfo(const QString &filename, const QString &straligninfo,bool isgssp); 103 | bool upDateUsefulSeq(const QString &filename, const QString &usefulseq,bool isgssp); 104 | bool upDatabyChangebp(const QString &filename, const QString &streditinfo,bool isgssp); 105 | bool upDataExclude(bool isgssp, const QString &filename, int exclude_left, int exclude_right); 106 | bool upDataAlignPos(bool isgssp, const QString &filename, int start, int end); 107 | bool deleteTable(const QString &tableName); 108 | void readGeneTableTxtFile(const QString &geneFile); 109 | void insertGeneTable(const GeneTable &geneTable); 110 | void readAlleleTableTxtFile(const QString &alleleFile); 111 | void insertAlleleTable(const AlleleTable &alleleTable); 112 | void readGsspTableTxtFile(const QString &gsspFile); 113 | void insertGsspTable(const GsspTable &gsspTable); 114 | void readLabAlignTableTxtFile(const QString &labAlignFile); 115 | void insertLabAlignTable(const LabAlignTable &labAlignTable); 116 | void readCommonGsspTableTxt(const QString &txtFile); 117 | void insertCommonGsspTable(const CommonGsspTable &commonGsspTable); 118 | 119 | void StartTransaction(); 120 | void EndTransaction(); 121 | void getTypeResultFromSampleTable(const QString &sampleName, QMap &typeResult); 122 | bool getSampleanalysisType(const QString &samplename, SampleTreeInfo_t &sampleTreeInfo); 123 | private: 124 | bool InitDB(); 125 | 126 | public: 127 | SoapTypingDB(); 128 | SoapTypingDB(const SoapTypingDB &){} 129 | SoapTypingDB& operator=(const SoapTypingDB&){} 130 | private: 131 | static QSqlDatabase m_SqlDB; 132 | //QSqlQuery *m_pQuery; 133 | }; 134 | 135 | #endif // SOAPTYPINGDB_H 136 | -------------------------------------------------------------------------------- /src/Dialog/alignmentdlg.h: -------------------------------------------------------------------------------- 1 | #ifndef ALIGNMENTDLG_H 2 | #define ALIGNMENTDLG_H 3 | 4 | #include 5 | #include 6 | 7 | namespace Ui { 8 | class AlignmentDlg; 9 | } 10 | 11 | struct AlleleNameSeqPair 12 | { 13 | QString name; 14 | QString seq; 15 | QVector mis; 16 | }; 17 | 18 | class AlignPaintWgt : public QWidget 19 | { 20 | Q_OBJECT 21 | public: 22 | AlignPaintWgt(QWidget *parent=0); 23 | ~AlignPaintWgt(); 24 | void setShowCodon(bool show); 25 | void setExonPositionInfo(QVector &exonStartPosIndex); 26 | void setFirstPair(const AlleleNameSeqPair &pair); 27 | void setSelectAlleles(const QMap &mapPair); 28 | void setCodonStart(int pos); 29 | void getSize(); 30 | protected: 31 | QSize minimumSizeHint() const; 32 | void paintEvent(QPaintEvent *); 33 | public slots: 34 | void slotRepaint(); 35 | private: 36 | 37 | void setArray(); 38 | private: 39 | bool brushColor_; 40 | bool showCodon_; 41 | int codonStart_; 42 | int headerWidth_; 43 | int fontWidth_; 44 | int fontHeight_; 45 | int lineBaseNumber_; 46 | int rowsHeight_; 47 | int baseNumber_; 48 | int rowNum_; 49 | AlleleNameSeqPair firstPair_; 50 | QVector alleNames_; 51 | QVector alleSeqs_; 52 | QVector >mis_; 53 | QMap posToExon_; 54 | int exonNum_; 55 | int *xx_; 56 | int *yy_; 57 | int *exon_; 58 | int *exonRow_; 59 | }; 60 | 61 | class AlignmentDlg : public QDialog 62 | { 63 | Q_OBJECT 64 | 65 | public: 66 | explicit AlignmentDlg(QWidget *parent,const QString &strver,const QString &strgene); 67 | ~AlignmentDlg(); 68 | protected: 69 | virtual void resizeEvent(QResizeEvent *) override; 70 | private: 71 | void InitUI(); 72 | void ConnectSignalandSlot(); 73 | void setGeneBoxData(); 74 | private slots: 75 | void slotGeneBoxItemChanged(const QString &gene); 76 | void slotClickShowInfoButton(); 77 | void slotListSelectionChanged(); 78 | void slotClickClearAllButton(); 79 | void slotClickShowCodonBox(bool); 80 | private: 81 | Ui::AlignmentDlg *ui; 82 | QString m_str_geneInfo; 83 | QString m_str_genever; 84 | QVector m_vec_exon; 85 | QStringList m_strlist_alleleNames; 86 | QStringList m_strlist_alleleSeqs; 87 | QVector< QVector > m_vec_misPositions; 88 | QMap m_map_pair; 89 | QMap m_map_coden; 90 | AlignPaintWgt *m_pAlignPaintWgt; 91 | QString m_str_selgene; 92 | }; 93 | 94 | #endif // ALIGNMENTDLG_H 95 | -------------------------------------------------------------------------------- /src/Dialog/alignmentdlg.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | AlignmentDlg 4 | 5 | 6 | 7 | 0 8 | 0 9 | 800 10 | 609 11 | 12 | 13 | 14 | Dialog 15 | 16 | 17 | 18 | :/png/images/about.png:/png/images/about.png 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | Genes: 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | Show Codon 37 | 38 | 39 | 40 | 41 | 42 | 43 | Clear All 44 | 45 | 46 | 47 | 48 | 49 | 50 | Info 51 | 52 | 53 | 54 | 55 | 56 | 57 | Exit 58 | 59 | 60 | 61 | 62 | 63 | 64 | Qt::Horizontal 65 | 66 | 67 | 68 | 40 69 | 20 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 171 81 | 560 82 | 83 | 84 | 85 | 86 | 171 87 | 16777215 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | Qt::ScrollBarAlwaysOff 96 | 97 | 98 | QAbstractScrollArea::AdjustToContents 99 | 100 | 101 | false 102 | 103 | 104 | 105 | 106 | 0 107 | 0 108 | 603 109 | 558 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | -------------------------------------------------------------------------------- /src/Dialog/allelepairdlg.cpp: -------------------------------------------------------------------------------- 1 | #include "allelepairdlg.h" 2 | #include "ui_allelepairdlg.h" 3 | #include "DataBase/soaptypingdb.h" 4 | 5 | AllelePairDlg::AllelePairDlg(QWidget *parent) : 6 | QDialog(parent), 7 | ui(new Ui::AllelePairDlg) 8 | { 9 | ui->setupUi(this); 10 | ConnectSignalandSlot(); 11 | } 12 | 13 | AllelePairDlg::~AllelePairDlg() 14 | { 15 | delete ui; 16 | } 17 | 18 | void AllelePairDlg::SetData(const QString &str_genename) 19 | { 20 | QStringList alleleNames; 21 | SoapTypingDB::GetInstance()->getAlleleNameListFromStaticDabase(str_genename, alleleNames); 22 | ui->comboBox->addItems(alleleNames); 23 | ui->comboBox_2->addItems(alleleNames); 24 | } 25 | 26 | void AllelePairDlg::ConnectSignalandSlot() 27 | { 28 | connect(ui->btnOk, &QPushButton::clicked, this, &AllelePairDlg::slotClickOK); 29 | } 30 | 31 | void AllelePairDlg::slotClickOK() 32 | { 33 | m_str_allele1 = ui->comboBox->currentText(); 34 | m_str_allele2 = ui->comboBox->currentText(); 35 | close(); 36 | } 37 | 38 | void AllelePairDlg::getSelectAllele(QString &str_allele1, QString &str_allele2) 39 | { 40 | str_allele1 = m_str_allele1; 41 | str_allele2 = m_str_allele2; 42 | } 43 | -------------------------------------------------------------------------------- /src/Dialog/allelepairdlg.h: -------------------------------------------------------------------------------- 1 | #ifndef ALLELEPAIRDLG_H 2 | #define ALLELEPAIRDLG_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class AllelePairDlg; 8 | } 9 | 10 | class AllelePairDlg : public QDialog 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | explicit AllelePairDlg(QWidget *parent = nullptr); 16 | ~AllelePairDlg(); 17 | void getSelectAllele(QString &str_allele1, QString &str_allele2); 18 | void SetData(const QString &str_genename); 19 | private: 20 | void ConnectSignalandSlot(); 21 | private slots: 22 | void slotClickOK(); 23 | private: 24 | Ui::AllelePairDlg *ui; 25 | QString m_str_allele1; 26 | QString m_str_allele2; 27 | }; 28 | 29 | #endif // ALLELEPAIRDLG_H 30 | -------------------------------------------------------------------------------- /src/Dialog/allelepairdlg.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | AllelePairDlg 4 | 5 | 6 | 7 | 0 8 | 0 9 | 360 10 | 180 11 | 12 | 13 | 14 | AllelePair 15 | 16 | 17 | 18 | :/png/images/about.png:/png/images/about.png 19 | 20 | 21 | 22 | 23 | 40 24 | 10 25 | 281 26 | 61 27 | 28 | 29 | 30 | 31 | 微软雅黑 32 | 10 33 | 34 | 35 | 36 | Select a pair of alleles and the sequence 37 | will be listed in the Sequence result window. 38 | 39 | 40 | 41 | 42 | 43 | 20 44 | 90 45 | 141 46 | 22 47 | 48 | 49 | 50 | 51 | 52 | 53 | 180 54 | 90 55 | 151 56 | 22 57 | 58 | 59 | 60 | 61 | 62 | 63 | 130 64 | 140 65 | 75 66 | 23 67 | 68 | 69 | 70 | OK 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /src/Dialog/deletefiledlg.cpp: -------------------------------------------------------------------------------- 1 | #include "deletefiledlg.h" 2 | #include "ui_deletefiledlg.h" 3 | #include "DataBase/soaptypingdb.h" 4 | #include "Core/core.h" 5 | #include 6 | 7 | DeleteFileDlg::DeleteFileDlg(QWidget *parent) : 8 | QDialog(parent), 9 | ui(new Ui::DeleteFileDlg) 10 | { 11 | ui->setupUi(this); 12 | InitUI(); 13 | ConnectSignalandSlot(); 14 | setTableDefaultSample(); 15 | } 16 | 17 | DeleteFileDlg::~DeleteFileDlg() 18 | { 19 | delete ui; 20 | } 21 | 22 | void DeleteFileDlg::InitUI() 23 | { 24 | ui->tableWidget->setEditTriggers(QAbstractItemView::NoEditTriggers); 25 | ui->tableWidget->setAlternatingRowColors(true); 26 | ui->tableWidget->horizontalHeader()->setStretchLastSection(true); 27 | ui->tableWidget->verticalHeader()->setVisible(false); 28 | ui->tableWidget->setColumnCount(4); 29 | ui->tableWidget->setColumnWidth(0, 200); 30 | ui->tableWidget->setColumnWidth(1, 100); 31 | ui->tableWidget->setColumnWidth(2, 100); 32 | ui->tableWidget->setColumnWidth(3, 100); 33 | QStringList header; 34 | header<<"Sample Name"<<"Analysis Type"<<"Mark Type"<<"User"; 35 | ui->tableWidget->setHorizontalHeaderLabels(header); 36 | 37 | } 38 | 39 | void DeleteFileDlg::ConnectSignalandSlot() 40 | { 41 | connect(ui->checkBox, &QCheckBox::clicked, this, &DeleteFileDlg::slotClickCheckAllBox); 42 | connect(ui->btnDel, &QPushButton::clicked, this, &DeleteFileDlg::slotClickDeleteButton); 43 | connect(ui->btnExit, &QPushButton::clicked, this, &DeleteFileDlg::close); 44 | } 45 | 46 | void DeleteFileDlg::slotClickCheckAllBox(bool status) 47 | { 48 | for(int i=0; itableWidget->rowCount(); i++) 49 | { 50 | Qt::CheckState state = status ? Qt::Checked: Qt::Unchecked; 51 | ui->tableWidget->item(i, 0)->setCheckState(state); 52 | } 53 | } 54 | 55 | void DeleteFileDlg::slotClickDeleteButton() 56 | { 57 | int i_row = ui->tableWidget->rowCount(); 58 | if(i_row > 0) 59 | { 60 | QVector vec_checked; 61 | for(int i=0; itableWidget->item(i, 0)->checkState() == Qt::Checked) 64 | { 65 | QString str_name = ui->tableWidget->item(i, 0)->text(); 66 | vec_checked.push_back(m_map_SampleTreeInfo[str_name]); 67 | } 68 | } 69 | 70 | if(vec_checked.empty()) 71 | { 72 | QMessageBox::warning(this, tr("Soap Typing"), "Please choose sample to save!"); 73 | return; 74 | } 75 | 76 | ui->checkBox->setEnabled(false); 77 | ui->btnExit->setEnabled(false); 78 | ui->btnDel->setEnabled(false); 79 | deleteFile(vec_checked); 80 | close(); 81 | } 82 | } 83 | 84 | void DeleteFileDlg::deleteFile(QVector &sampleInfos) 85 | { 86 | ui->btnStatus->setText("Waiting:.."); 87 | ui->progressBar->setRange(0, sampleInfos.size()); 88 | for(int i=0; ideleteSample(sampleInfos.at(i).sampleName); 91 | ui->progressBar->setValue(i+1); 92 | } 93 | ui->btnStatus->setText("Ready:"); 94 | return; 95 | } 96 | 97 | void DeleteFileDlg::setTableDefaultSample() 98 | { 99 | SoapTypingDB::GetInstance()->getSampleTreeDataFromSampleTable(m_map_SampleTreeInfo); 100 | 101 | ui->tableWidget->setRowCount(m_map_SampleTreeInfo.size()); 102 | int i = 0; 103 | foreach(const SampleTreeInfo_t& info, m_map_SampleTreeInfo.values()) 104 | { 105 | ui->tableWidget->setRowHeight(i, 20); 106 | QTableWidgetItem *item = new QTableWidgetItem; 107 | item->setCheckState(Qt::Checked); 108 | item->setIcon(Core::GetInstance()->getIcon(info.analysisType, info.markType)); 109 | item->setText(info.sampleName); 110 | ui->tableWidget->setItem(i, 0, item); 111 | 112 | item = new QTableWidgetItem; 113 | item->setText(Core::GetInstance()->getAnalysisType(info.analysisType)); 114 | ui->tableWidget->setItem(i, 1, item); 115 | 116 | item = new QTableWidgetItem; 117 | item->setText(Core::GetInstance()->getMarkType(info.markType)); 118 | ui->tableWidget->setItem(i, 2, item); 119 | 120 | item = new QTableWidgetItem; 121 | item->setText("default"); 122 | ui->tableWidget->setItem(i, 3, item); 123 | i++; 124 | } 125 | } 126 | 127 | -------------------------------------------------------------------------------- /src/Dialog/deletefiledlg.h: -------------------------------------------------------------------------------- 1 | #ifndef DELETEFILEDLG_H 2 | #define DELETEFILEDLG_H 3 | 4 | #include 5 | #include "all_base_struct.h" 6 | 7 | namespace Ui { 8 | class DeleteFileDlg; 9 | } 10 | 11 | class DeleteFileDlg : public QDialog 12 | { 13 | Q_OBJECT 14 | 15 | public: 16 | explicit DeleteFileDlg(QWidget *parent = nullptr); 17 | ~DeleteFileDlg(); 18 | private: 19 | void InitUI(); 20 | void ConnectSignalandSlot(); 21 | void setTableDefaultSample(); 22 | void deleteFile(QVector &sampleInfos); 23 | private slots: 24 | void slotClickCheckAllBox(bool); 25 | void slotClickDeleteButton(); 26 | private: 27 | Ui::DeleteFileDlg *ui; 28 | QMap m_map_SampleTreeInfo; 29 | }; 30 | 31 | #endif // DELETEFILEDLG_H 32 | -------------------------------------------------------------------------------- /src/Dialog/deletefiledlg.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | DeleteFileDlg 4 | 5 | 6 | 7 | 0 8 | 0 9 | 600 10 | 400 11 | 12 | 13 | 14 | Delete File 15 | 16 | 17 | 18 | :/png/images/about.png:/png/images/about.png 19 | 20 | 21 | 22 | 23 | 5 24 | 3 25 | 591 26 | 331 27 | 28 | 29 | 30 | 31 | 32 | 33 | 10 34 | 340 35 | 81 36 | 16 37 | 38 | 39 | 40 | check all 41 | 42 | 43 | 44 | 45 | 46 | 430 47 | 340 48 | 75 49 | 23 50 | 51 | 52 | 53 | Delete 54 | 55 | 56 | 57 | 58 | 59 | 520 60 | 340 61 | 75 62 | 23 63 | 64 | 65 | 66 | Exit 67 | 68 | 69 | 70 | 71 | 72 | 10 73 | 370 74 | 75 75 | 23 76 | 77 | 78 | 79 | Ready: 80 | 81 | 82 | 83 | 84 | 85 | 100 86 | 370 87 | 491 88 | 23 89 | 90 | 91 | 92 | 0 93 | 94 | 95 | false 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | -------------------------------------------------------------------------------- /src/Dialog/exontimdlg.cpp: -------------------------------------------------------------------------------- 1 | #include "exontimdlg.h" 2 | #include "ui_exontimdlg.h" 3 | #include "DataBase/soaptypingdb.h" 4 | 5 | ExonTimDlg::ExonTimDlg(QWidget *parent) : 6 | QDialog(parent), 7 | ui(new Ui::ExonTimDlg) 8 | { 9 | ui->setupUi(this); 10 | InitUI(); 11 | ConnectSignalandSlot(); 12 | setGeneBoxData(); 13 | } 14 | 15 | ExonTimDlg::~ExonTimDlg() 16 | { 17 | delete ui; 18 | } 19 | 20 | void ExonTimDlg::InitUI() 21 | { 22 | ui->tableWidget->setEditTriggers(QAbstractItemView::DoubleClicked); 23 | ui->tableWidget->setSelectionBehavior(QAbstractItemView::SelectItems); 24 | ui->tableWidget->setSelectionMode(QAbstractItemView::SingleSelection); 25 | QStringList theader; 26 | theader<<"Gene"<<"Exon"<<"R/F"<<"Default Start"<<"Default End"<<"Exclude Left Num"<<"Exclude Right Num"; 27 | ui->tableWidget->verticalHeader()->setVisible(false); 28 | ui->tableWidget->setColumnCount(7); 29 | ui->tableWidget->setHorizontalHeaderLabels(theader); 30 | ui->tableWidget->horizontalHeader()->setStretchLastSection(true); 31 | ui->tableWidget->setColumnWidth(0, 70); 32 | ui->tableWidget->setColumnWidth(1, 50); 33 | ui->tableWidget->setColumnWidth(2, 40); 34 | ui->tableWidget->setColumnWidth(3, 100); 35 | ui->tableWidget->setColumnWidth(4, 95); 36 | ui->tableWidget->setColumnWidth(5, 130); 37 | ui->tableWidget->setColumnWidth(6, 100); 38 | } 39 | 40 | void ExonTimDlg::ConnectSignalandSlot() 41 | { 42 | connect(ui->btnReset, &QPushButton::clicked, this, &ExonTimDlg::slotClickResetButton); 43 | connect(ui->btnApply, &QPushButton::clicked, this, &ExonTimDlg::slotClickApplyButton); 44 | connect(ui->btnExit, &QPushButton::clicked, this, &ExonTimDlg::close); 45 | connect(ui->comboBox, QOverload::of(&QComboBox::currentIndexChanged), 46 | this, &ExonTimDlg::slotGeneBoxIndexChanged); 47 | connect(ui->tableWidget, &QTableWidget::itemClicked, this, &ExonTimDlg::slotClickTableItem); 48 | } 49 | 50 | void ExonTimDlg::slotClickResetButton() 51 | { 52 | for(int i=0; itableWidget->rowCount(); i++) 53 | { 54 | ui->tableWidget->item(i, 5)->setText("0"); 55 | ui->tableWidget->item(i, 6)->setText("0"); 56 | } 57 | } 58 | 59 | void ExonTimDlg::slotClickApplyButton() 60 | { 61 | for(int i=0; itableWidget->rowCount(); i++) 62 | { 63 | ExonTrimTable etTable; 64 | etTable.geneName=ui->tableWidget->item(i, 0)->text(); 65 | etTable.exonIndex=ui->tableWidget->item(i, 1)->text(); 66 | etTable.fOrR=ui->tableWidget->item(i, 2)->text(); 67 | etTable.exonStart=ui->tableWidget->item(i, 3)->text(); 68 | etTable.exonEnd=ui->tableWidget->item(i, 4)->text(); 69 | etTable.excludeLeft=ui->tableWidget->item(i, 5)->text(); 70 | etTable.excludeRight=ui->tableWidget->item(i, 6)->text(); 71 | etTable.etKey=QString("%1_%2_%3").arg(etTable.geneName).arg(etTable.exonIndex).arg(etTable.fOrR); 72 | SoapTypingDB::GetInstance()->updateExonTrim(etTable); 73 | } 74 | } 75 | 76 | void ExonTimDlg::slotGeneBoxIndexChanged(const QString &genename) 77 | { 78 | QVector etList; 79 | SoapTypingDB::GetInstance()->getExonTrimListByGeneName(genename, etList); 80 | setTableData(etList); 81 | } 82 | 83 | void ExonTimDlg::slotClickTableItem() 84 | { 85 | int c = ui->tableWidget->currentColumn(); 86 | if (c<=4) 87 | { 88 | ui->tableWidget->setEditTriggers(QAbstractItemView::NoEditTriggers); 89 | } 90 | else 91 | { 92 | ui->tableWidget->setEditTriggers(QAbstractItemView::DoubleClicked); 93 | } 94 | } 95 | 96 | void ExonTimDlg::setGeneBoxData() 97 | { 98 | QStringList geneNames; 99 | SoapTypingDB::GetInstance()->getGeneNames(geneNames); 100 | ui->comboBox->addItems(geneNames); 101 | ui->comboBox->setCurrentIndex(0); 102 | } 103 | 104 | void ExonTimDlg::setTableData(QVector &etList) 105 | { 106 | ui->tableWidget->clear(); 107 | // QStringList theader; 108 | // theader<<"Gene"<<"Exon"<<"R/F"<<"Default Start"<<"Default End"<<"Exclude Left Num"<<"Exclude Right Num"; 109 | // table->setHorizontalHeaderLabels(theader); 110 | 111 | int size = etList.size(); 112 | if(size<0) 113 | return; 114 | ui->tableWidget->setRowCount(size); 115 | for(int i=0; itableWidget->setRowHeight(i, 18); 118 | const ExonTrimTable &etTable = etList.at(i); 119 | QTableWidgetItem *item = new QTableWidgetItem; 120 | item->setText(etTable.geneName); 121 | ui->tableWidget->setItem(i, 0, item); 122 | 123 | item = new QTableWidgetItem; 124 | item->setText(etTable.exonIndex); 125 | ui->tableWidget->setItem(i, 1, item); 126 | 127 | item = new QTableWidgetItem; 128 | item->setText(etTable.fOrR); 129 | ui->tableWidget->setItem(i, 2, item); 130 | 131 | item = new QTableWidgetItem; 132 | item->setText(etTable.exonStart); 133 | ui->tableWidget->setItem(i, 3, item); 134 | 135 | item = new QTableWidgetItem; 136 | item->setText(etTable.exonEnd); 137 | ui->tableWidget->setItem(i, 4, item); 138 | 139 | item = new QTableWidgetItem; 140 | item->setText(etTable.excludeLeft); 141 | ui->tableWidget->setItem(i, 5, item); 142 | 143 | item = new QTableWidgetItem; 144 | item->setText(etTable.excludeRight); 145 | ui->tableWidget->setItem(i, 6, item); 146 | } 147 | } 148 | -------------------------------------------------------------------------------- /src/Dialog/exontimdlg.h: -------------------------------------------------------------------------------- 1 | #ifndef EXONTIMDLG_H 2 | #define EXONTIMDLG_H 3 | 4 | #include 5 | #include "all_base_struct.h" 6 | 7 | namespace Ui { 8 | class ExonTimDlg; 9 | } 10 | 11 | class ExonTimDlg : public QDialog 12 | { 13 | Q_OBJECT 14 | 15 | public: 16 | explicit ExonTimDlg(QWidget *parent = nullptr); 17 | ~ExonTimDlg(); 18 | 19 | private: 20 | void InitUI(); 21 | void ConnectSignalandSlot(); 22 | void setGeneBoxData(); 23 | void setTableData(QVector &etList); 24 | private slots: 25 | void slotClickResetButton(); 26 | void slotClickApplyButton(); 27 | void slotGeneBoxIndexChanged(const QString &); 28 | void slotClickTableItem(); 29 | private: 30 | Ui::ExonTimDlg *ui; 31 | }; 32 | 33 | #endif // EXONTIMDLG_H 34 | -------------------------------------------------------------------------------- /src/Dialog/exontimdlg.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | ExonTimDlg 4 | 5 | 6 | 7 | 0 8 | 0 9 | 650 10 | 350 11 | 12 | 13 | 14 | Dialog 15 | 16 | 17 | 18 | 19 | 5 20 | 5 21 | 641 22 | 301 23 | 24 | 25 | 26 | 27 | 28 | 29 | 10 30 | 320 31 | 81 32 | 22 33 | 34 | 35 | 36 | 37 | 38 | 39 | 390 40 | 320 41 | 75 42 | 23 43 | 44 | 45 | 46 | Reset 47 | 48 | 49 | 50 | 51 | 52 | 480 53 | 320 54 | 75 55 | 23 56 | 57 | 58 | 59 | Apply 60 | 61 | 62 | 63 | 64 | 65 | 570 66 | 320 67 | 75 68 | 23 69 | 70 | 71 | 72 | Exit 73 | 74 | 75 | 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /src/Dialog/finaltypedlg.cpp: -------------------------------------------------------------------------------- 1 | #include "finaltypedlg.h" 2 | #include "ui_finaltypedlg.h" 3 | #include "DataBase/soaptypingdb.h" 4 | 5 | FinalTypeDlg::FinalTypeDlg(QWidget *parent) : 6 | QDialog(parent), 7 | ui(new Ui::FinalTypeDlg) 8 | { 9 | ui->setupUi(this); 10 | InitUI(); 11 | ConnectSignalandSlot(); 12 | } 13 | 14 | FinalTypeDlg::~FinalTypeDlg() 15 | { 16 | delete ui; 17 | } 18 | 19 | void FinalTypeDlg::InitUI() 20 | { 21 | ui->tableWidget->setEditTriggers(QAbstractItemView::NoEditTriggers); 22 | ui->tableWidget->setSelectionBehavior(QAbstractItemView::SelectRows); 23 | ui->tableWidget->verticalHeader()->setVisible(false); 24 | ui->tableWidget->setSelectionMode(QAbstractItemView::SingleSelection); 25 | ui->tableWidget->horizontalHeader()->setStretchLastSection(true); 26 | ui->tableWidget->setColumnCount(3); 27 | QStringList header; 28 | header<<"Mis"<<"Allele1"<<"Allele2"; 29 | ui->tableWidget->setHorizontalHeaderLabels(header); 30 | ui->tableWidget->setColumnWidth(0, 50); 31 | ui->tableWidget->setColumnWidth(1, 100); 32 | ui->tableWidget->setColumnWidth(2, 100); 33 | } 34 | 35 | void FinalTypeDlg::ConnectSignalandSlot() 36 | { 37 | connect(ui->btnSet, &QPushButton::clicked, this, &FinalTypeDlg::slotClickSetButton); 38 | connect(ui->tableWidget, &QTableWidget::itemSelectionChanged, this, &FinalTypeDlg::slotRowChanged); 39 | connect(ui->btnSave,&QPushButton::clicked, this, &FinalTypeDlg::slotClickSaveButton); 40 | connect(ui->btnExit, &QPushButton::clicked, this, &FinalTypeDlg::close); 41 | } 42 | 43 | void FinalTypeDlg::slotClickSetButton() 44 | { 45 | ui->lineEdit_allele1->setText(m_str_allele1); 46 | ui->lineEdit_allele2->setText(m_str_allele2); 47 | } 48 | 49 | void FinalTypeDlg::slotRowChanged() 50 | { 51 | int row = ui->tableWidget->currentRow(); 52 | m_str_allele1 = ui->tableWidget->item(row, 1)->text(); 53 | m_str_allele2 = ui->tableWidget->item(row, 2)->text(); 54 | } 55 | 56 | void FinalTypeDlg::slotClickSaveButton() 57 | { 58 | QString result = QString("%1,%2").arg(ui->lineEdit_allele1->text()).arg(ui->lineEdit_allele2->text()); 59 | SoapTypingDB::GetInstance()->updateSetResultBySampleName(m_str_SampleName, result); 60 | close(); 61 | } 62 | 63 | void FinalTypeDlg::setSampleName(const QString &sampleName) 64 | { 65 | m_str_SampleName = sampleName; 66 | ui->lineEdit_samplename->setText(sampleName); 67 | QString resultString; 68 | SoapTypingDB::GetInstance()->getSetResultBySampleName(sampleName, resultString); 69 | if(resultString.isEmpty()) 70 | { 71 | return; 72 | } 73 | 74 | QStringList sp = resultString.split(",", QString::SkipEmptyParts); 75 | m_str_allele1 = sp.at(0); 76 | m_str_allele2 = sp.at(1); 77 | slotClickSetButton(); 78 | } 79 | 80 | void FinalTypeDlg::setAlleleResult(const QVector &result) 81 | { 82 | int size = result.size(); 83 | if (size <= 0) 84 | return; 85 | ui->tableWidget->setRowCount(size); 86 | 87 | for(int i=0; itableWidget->setRowHeight(i, 18); 90 | for(int j=0; j<3; j++) 91 | { 92 | QTableWidgetItem *item = new QTableWidgetItem; 93 | item->setText(result.at(i).at(j)); 94 | ui->tableWidget->setItem(i, j, item); 95 | } 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /src/Dialog/finaltypedlg.h: -------------------------------------------------------------------------------- 1 | #ifndef FINALTYPEDLG_H 2 | #define FINALTYPEDLG_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class FinalTypeDlg; 8 | } 9 | 10 | class FinalTypeDlg : public QDialog 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | explicit FinalTypeDlg(QWidget *parent = nullptr); 16 | ~FinalTypeDlg(); 17 | void setSampleName(const QString &sampleName); 18 | void setAlleleResult(const QVector &result); 19 | 20 | private: 21 | void InitUI(); 22 | void ConnectSignalandSlot(); 23 | private slots: 24 | void slotClickSetButton(); 25 | void slotRowChanged(); 26 | void slotClickSaveButton(); 27 | 28 | private: 29 | Ui::FinalTypeDlg *ui; 30 | QString m_str_SampleName; 31 | QString m_str_allele1; 32 | QString m_str_allele2; 33 | }; 34 | 35 | #endif // FINALTYPEDLG_H 36 | -------------------------------------------------------------------------------- /src/Dialog/finaltypedlg.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | FinalTypeDlg 4 | 5 | 6 | 7 | 0 8 | 0 9 | 550 10 | 300 11 | 12 | 13 | 14 | Dialog 15 | 16 | 17 | 18 | 19 | 10 20 | 5 21 | 71 22 | 16 23 | 24 | 25 | 26 | Sample Name: 27 | 28 | 29 | 30 | 31 | false 32 | 33 | 34 | 35 | 80 36 | 2 37 | 191 38 | 20 39 | 40 | 41 | 42 | 43 | 44 | false 45 | 46 | 47 | 48 | 276 49 | 2 50 | 271 51 | 111 52 | 53 | 54 | 55 | 56 | 57 | 58 | 5 59 | 30 60 | 266 61 | 261 62 | 63 | 64 | 65 | 66 | 67 | 68 | 276 69 | 140 70 | 75 71 | 23 72 | 73 | 74 | 75 | -> 76 | 77 | 78 | 79 | 80 | 81 | 360 82 | 130 83 | 54 84 | 12 85 | 86 | 87 | 88 | Allele 1: 89 | 90 | 91 | 92 | 93 | 94 | 360 95 | 160 96 | 54 97 | 12 98 | 99 | 100 | 101 | Allele 2: 102 | 103 | 104 | 105 | 106 | 107 | 413 108 | 125 109 | 131 110 | 20 111 | 112 | 113 | 114 | 115 | 116 | 117 | 413 118 | 155 119 | 131 120 | 20 121 | 122 | 123 | 124 | 125 | 126 | 127 | 460 128 | 240 129 | 75 130 | 23 131 | 132 | 133 | 134 | Save 135 | 136 | 137 | 138 | 139 | 140 | 460 141 | 270 142 | 75 143 | 23 144 | 145 | 146 | 147 | Exit 148 | 149 | 150 | 151 | 152 | 153 | 154 | -------------------------------------------------------------------------------- /src/Dialog/gsspinfodlg.cpp: -------------------------------------------------------------------------------- 1 | #include "gsspinfodlg.h" 2 | #include "ui_gsspinfodlg.h" 3 | #include "DataBase/soaptypingdb.h" 4 | 5 | GsspInfoDlg::GsspInfoDlg(QWidget *parent) : 6 | QDialog(parent), 7 | ui(new Ui::GsspInfoDlg) 8 | { 9 | ui->setupUi(this); 10 | InitUI(); 11 | ConnectSignalandSlot(); 12 | } 13 | 14 | GsspInfoDlg::~GsspInfoDlg() 15 | { 16 | delete ui; 17 | } 18 | 19 | void GsspInfoDlg::InitUI() 20 | { 21 | ui->tableWidget->setEditTriggers(QAbstractItemView::NoEditTriggers); 22 | ui->tableWidget->setSelectionBehavior(QAbstractItemView::SelectRows); 23 | ui->tableWidget->setSelectionMode(QAbstractItemView::SingleSelection); 24 | ui->tableWidget->verticalHeader()->setVisible(false); 25 | ui->tableWidget->setColumnCount(6); 26 | QStringList theader; 27 | theader<<"Allele 11"<<"Allele 12"<<"="<<"Allele 21"<<"Allele 22"<<"GSSPs"; 28 | ui->tableWidget->setHorizontalHeaderLabels(theader); 29 | ui->tableWidget->horizontalHeader()->setStretchLastSection(true); 30 | ui->tableWidget->setColumnWidth(0, 100); 31 | ui->tableWidget->setColumnWidth(1, 100); 32 | ui->tableWidget->setColumnWidth(2, 20); 33 | ui->tableWidget->setColumnWidth(3, 100); 34 | ui->tableWidget->setColumnWidth(4, 100); 35 | ui->tableWidget->setColumnWidth(5, 200); 36 | 37 | ui->tableWidget_2->setEditTriggers(QAbstractItemView::NoEditTriggers); 38 | ui->tableWidget_2->setSelectionBehavior(QAbstractItemView::SelectRows); 39 | ui->tableWidget_2->setSelectionMode(QAbstractItemView::SingleSelection); 40 | ui->tableWidget_2->verticalHeader()->setVisible(false); 41 | ui->tableWidget_2->setColumnCount(10); 42 | QStringList header2; 43 | header2<<"Allele 11"<<"Allele 12"<<"="<<"Allele 21"<<"Allele 22"<<"Position"<<"Exon"<<"R/F"<<"GSSP"<<"GSSP Seq"; 44 | ui->tableWidget_2->setHorizontalHeaderLabels(header2); 45 | ui->tableWidget_2->horizontalHeader()->setStretchLastSection(true); 46 | ui->tableWidget_2->setColumnWidth(0, 100); 47 | ui->tableWidget_2->setColumnWidth(1, 100); 48 | ui->tableWidget_2->setColumnWidth(2, 20); 49 | ui->tableWidget_2->setColumnWidth(3, 100); 50 | ui->tableWidget_2->setColumnWidth(4, 100); 51 | ui->tableWidget_2->setColumnWidth(5, 60); 52 | ui->tableWidget_2->setColumnWidth(6, 40); 53 | ui->tableWidget_2->setColumnWidth(7, 40); 54 | ui->tableWidget_2->setColumnWidth(8, 50); 55 | ui->tableWidget_2->setColumnWidth(9, 100); 56 | } 57 | 58 | void GsspInfoDlg::ConnectSignalandSlot() 59 | { 60 | connect(ui->tableWidget, &QTableWidget::itemSelectionChanged, this, &GsspInfoDlg::slotSetGsspInfoTable2); 61 | connect(ui->btnDefault , &QPushButton::clicked, this, &GsspInfoDlg::slotClickSaveDefaultBt); 62 | connect(ui->btnUser, &QPushButton::clicked, this, &GsspInfoDlg::slotClickSaveUserBt); 63 | connect(ui->btnExit, &QPushButton::clicked, this, &GsspInfoDlg::close); 64 | } 65 | 66 | void GsspInfoDlg::slotSetGsspInfoTable2() 67 | { 68 | int index = ui->tableWidget->currentRow(); 69 | ui->tableWidget_2->clear(); 70 | QStringList head; 71 | head<tableWidget->item(index, 0)->text() 72 | <tableWidget->item(index, 1)->text() 73 | <<"=" 74 | <tableWidget->item(index, 3)->text() 75 | <tableWidget->item(index, 4)->text() 76 | <<"position"<<"Exon"<<"R/F" 77 | <<"GSSP"<<"GSSP Seq"; 78 | ui->tableWidget_2->setHorizontalHeaderLabels(head); 79 | int size = m_vec_infos.at(index).size(); 80 | ui->tableWidget_2->setRowCount(size); 81 | for(int i=0; itableWidget_2->setRowHeight(i, 18); 84 | QStringList line = m_vec_infos.at(index).at(i).split(":"); 85 | QTableWidgetItem *item = new QTableWidgetItem; 86 | item->setText(line.at(0)); 87 | ui->tableWidget_2->setItem(i, 0, item); 88 | 89 | item = new QTableWidgetItem; 90 | item->setText(line.at(1)); 91 | ui->tableWidget_2->setItem(i, 1, item); 92 | 93 | item = new QTableWidgetItem; 94 | item->setText(line.at(2)); 95 | ui->tableWidget_2->setItem(i, 3, item); 96 | 97 | item = new QTableWidgetItem; 98 | item->setText(line.at(3)); 99 | ui->tableWidget_2->setItem(i, 4, item); 100 | 101 | item = new QTableWidgetItem; 102 | item->setText(line.at(4)); 103 | ui->tableWidget_2->setItem(i, 5, item); 104 | 105 | item = new QTableWidgetItem; 106 | item->setText(line.at(5)); 107 | ui->tableWidget_2->setItem(i, 6, item); 108 | 109 | item = new QTableWidgetItem; 110 | item->setText(line.at(6)); 111 | ui->tableWidget_2->setItem(i, 7, item); 112 | 113 | item = new QTableWidgetItem; 114 | item->setText(line.at(7)); 115 | ui->tableWidget_2->setItem(i, 8, item); 116 | 117 | item = new QTableWidgetItem; 118 | item->setText(line.at(8)); 119 | ui->tableWidget_2->setItem(i, 9, item); 120 | } 121 | } 122 | 123 | void GsspInfoDlg::slotClickSaveDefaultBt() 124 | { 125 | QString gssp = ui->lineEdit_Recommened->text(); 126 | SoapTypingDB::GetInstance()->updateSetGsspBySampleName(m_str_SampleName, gssp); 127 | close(); 128 | } 129 | 130 | void GsspInfoDlg::slotClickSaveUserBt() 131 | { 132 | QString gssp = ui->lineEdit_User->text(); 133 | SoapTypingDB::GetInstance()->updateSetGsspBySampleName(m_str_SampleName, gssp); 134 | close(); 135 | } 136 | 137 | void GsspInfoDlg::setSampleName(const QString &sampleName) 138 | { 139 | m_str_SampleName = sampleName; 140 | ui->lineEdit_Name->setText(m_str_SampleName); 141 | } 142 | 143 | void GsspInfoDlg::setGsspTable1(QVector &gsspInfos) 144 | { 145 | int size = gsspInfos.size(); 146 | ui->tableWidget->setRowCount(size); 147 | for(int i=0; itableWidget->setRowHeight(i, 18); 150 | QTableWidgetItem* item = new QTableWidgetItem; 151 | item->setText(gsspInfos.at(i).at(0)); 152 | ui->tableWidget->setItem(i, 0, item); 153 | 154 | item = new QTableWidgetItem; 155 | item->setText(gsspInfos.at(i).at(1)); 156 | ui->tableWidget->setItem(i, 1, item); 157 | 158 | item = new QTableWidgetItem; 159 | item->setText("="); 160 | ui->tableWidget->setItem(i, 2, item); 161 | 162 | item = new QTableWidgetItem; 163 | item->setText(gsspInfos.at(i).at(2)); 164 | ui->tableWidget->setItem(i, 3, item); 165 | 166 | item = new QTableWidgetItem; 167 | item->setText(gsspInfos.at(i).at(3)); 168 | ui->tableWidget->setItem(i, 4, item); 169 | 170 | item = new QTableWidgetItem; 171 | item->setText(gsspInfos.at(i).at(4)); 172 | ui->tableWidget->setItem(i, 5, item); 173 | 174 | QStringList info = gsspInfos.at(i).at(5).split(";", QString::SkipEmptyParts); 175 | m_vec_infos.push_back(info); 176 | } 177 | } 178 | 179 | 180 | -------------------------------------------------------------------------------- /src/Dialog/gsspinfodlg.h: -------------------------------------------------------------------------------- 1 | #ifndef GSSPINFODLG_H 2 | #define GSSPINFODLG_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class GsspInfoDlg; 8 | } 9 | 10 | class GsspInfoDlg : public QDialog 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | explicit GsspInfoDlg(QWidget *parent = nullptr); 16 | ~GsspInfoDlg(); 17 | void setSampleName(const QString &sampleName); 18 | void setGsspTable1(QVector &gsspInfos); 19 | 20 | private: 21 | void InitUI(); 22 | void ConnectSignalandSlot(); 23 | 24 | private slots: 25 | void slotSetGsspInfoTable2(); 26 | void slotClickSaveDefaultBt(); 27 | void slotClickSaveUserBt(); 28 | 29 | 30 | private: 31 | Ui::GsspInfoDlg *ui; 32 | QString m_str_SampleName; 33 | QVector m_vec_infos; 34 | }; 35 | 36 | #endif // GSSPINFODLG_H 37 | -------------------------------------------------------------------------------- /src/Dialog/gsspinfodlg.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | GsspInfoDlg 4 | 5 | 6 | 7 | 0 8 | 0 9 | 750 10 | 500 11 | 12 | 13 | 14 | Gssp Infomation 15 | 16 | 17 | 18 | :/png/images/about.png:/png/images/about.png 19 | 20 | 21 | 22 | 23 | 10 24 | 8 25 | 81 26 | 16 27 | 28 | 29 | 30 | Sample Name: 31 | 32 | 33 | 34 | 35 | false 36 | 37 | 38 | 39 | 90 40 | 5 41 | 191 42 | 20 43 | 44 | 45 | 46 | false 47 | 48 | 49 | 50 | 51 | 52 | 380 53 | 8 54 | 101 55 | 20 56 | 57 | 58 | 59 | GSSP Recommened: 60 | 61 | 62 | 63 | 64 | false 65 | 66 | 67 | 68 | 490 69 | 5 70 | 241 71 | 20 72 | 73 | 74 | 75 | 76 | 77 | 78 | 10 79 | 30 80 | 101 81 | 16 82 | 83 | 84 | 85 | Available GSSPs: 86 | 87 | 88 | 89 | 90 | 91 | 340 92 | 30 93 | 101 94 | 20 95 | 96 | 97 | 98 | GSSP Set By User: 99 | 100 | 101 | 102 | 103 | 104 | 450 105 | 30 106 | 281 107 | 20 108 | 109 | 110 | 111 | 112 | 113 | 114 | 10 115 | 60 116 | 731 117 | 192 118 | 119 | 120 | 121 | 122 | 123 | 124 | 10 125 | 260 126 | 731 127 | 192 128 | 129 | 130 | 131 | 132 | 133 | 134 | 484 135 | 470 136 | 81 137 | 23 138 | 139 | 140 | 141 | Save Default 142 | 143 | 144 | 145 | 146 | 147 | 580 148 | 470 149 | 75 150 | 23 151 | 152 | 153 | 154 | Save User 155 | 156 | 157 | 158 | 159 | 160 | 670 161 | 470 162 | 75 163 | 23 164 | 165 | 166 | 167 | Exit 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | -------------------------------------------------------------------------------- /src/Dialog/loadfiledlg.h: -------------------------------------------------------------------------------- 1 | #ifndef LOADFILEDLG_H 2 | #define LOADFILEDLG_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class LoadFileDlg; 8 | } 9 | 10 | struct LoadInfo 11 | { 12 | int analysisType; 13 | int markType; 14 | int dateToNow; 15 | QString sampleName; 16 | QString createdTime; 17 | QString modifiedTime; 18 | QString listFile; 19 | }; 20 | 21 | class LoadFileDlg : public QDialog 22 | { 23 | Q_OBJECT 24 | 25 | public: 26 | explicit LoadFileDlg(QWidget *parent = nullptr); 27 | ~LoadFileDlg(); 28 | 29 | private: 30 | void InitUI(); 31 | void ConnectSignalandSlot(); 32 | void getLoadInfo(); 33 | void getOkIndex(); 34 | void SetTableData(); 35 | void readListFile(const QString &listFilePath, QVector &samplePaths, 36 | QVector &filePaths, QVector &gsspFilePaths); 37 | void loadSample(const QString &strPath); 38 | void loadFile(const QString &strPath); 39 | void loadGssp(const QString &strPath); 40 | private slots: 41 | void slotClickLoadButton(); 42 | void slotClickCheckAllBox(bool status); 43 | void slotdateComboBoxChagned(int index); 44 | void slotLineEditChanged(const QString & name); 45 | private: 46 | Ui::LoadFileDlg *ui; 47 | int m_idaysNum; 48 | QString m_str_SearchName; 49 | QVector m_vec_index; 50 | QVector m_vec_LoadInfo; 51 | }; 52 | 53 | #endif // LOADFILEDLG_H 54 | -------------------------------------------------------------------------------- /src/Dialog/loadfiledlg.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | LoadFileDlg 4 | 5 | 6 | 7 | 0 8 | 0 9 | 900 10 | 600 11 | 12 | 13 | 14 | Load File 15 | 16 | 17 | 18 | :/png/images/about.png:/png/images/about.png 19 | 20 | 21 | 22 | 23 | 10 24 | 10 25 | 881 26 | 521 27 | 28 | 29 | 30 | 31 | 32 | 33 | 10 34 | 540 35 | 71 36 | 16 37 | 38 | 39 | 40 | Check All 41 | 42 | 43 | 44 | 45 | 46 | 100 47 | 540 48 | 91 49 | 16 50 | 51 | 52 | 53 | Search By Date: 54 | 55 | 56 | 57 | 58 | 59 | 190 60 | 536 61 | 111 62 | 25 63 | 64 | 65 | 66 | 67 | 68 | 69 | 330 70 | 540 71 | 91 72 | 16 73 | 74 | 75 | 76 | Search By Name: 77 | 78 | 79 | 80 | 81 | 82 | 420 83 | 538 84 | 261 85 | 25 86 | 87 | 88 | 89 | 90 | 91 | 92 | 730 93 | 540 94 | 75 95 | 23 96 | 97 | 98 | 99 | Load 100 | 101 | 102 | 103 | 104 | 105 | 820 106 | 540 107 | 75 108 | 23 109 | 110 | 111 | 112 | Exit 113 | 114 | 115 | 116 | 117 | 118 | 10 119 | 570 120 | 75 121 | 23 122 | 123 | 124 | 125 | Ready: 126 | 127 | 128 | 129 | 130 | 131 | 90 132 | 570 133 | 801 134 | 23 135 | 136 | 137 | 138 | 0 139 | 140 | 141 | false 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | -------------------------------------------------------------------------------- /src/Dialog/openfiledialog.h: -------------------------------------------------------------------------------- 1 | #ifndef OPENFILEDIALOG_H 2 | #define OPENFILEDIALOG_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include "all_base_struct.h" 10 | #include 11 | #include 12 | 13 | namespace Ui { 14 | class OpenFileDialog; 15 | } 16 | 17 | //class QComboBoxNew : public QComboBox 18 | //{ 19 | // Q_OBJECT 20 | //public: 21 | // QComboBoxNew(QWidget *parent=0) 22 | // :QComboBox(parent) 23 | // {} 24 | //protected: 25 | // bool event(QEvent *event) 26 | // { 27 | // if(event->type() == QEvent::Wheel) //屏蔽鼠标滚轮消息 28 | // { 29 | // event->ignore(); 30 | // return true; 31 | // } 32 | // else 33 | // { 34 | // return QComboBox::event(event); 35 | // } 36 | // } 37 | //}; 38 | 39 | class OpenFileDialog : public QDialog 40 | { 41 | Q_OBJECT 42 | 43 | public: 44 | explicit OpenFileDialog(QWidget *parent = 0); 45 | ~OpenFileDialog(); 46 | private: 47 | void InitUi(); //初始化界面 48 | void InitData(); //从数据库获取初始数据(Gene GSSP) 49 | void ConnectSignalandSlot(); //连接信号与槽函数 50 | void SlotOpenFile(); //响应弹出文件对话框 51 | void SlotAnalysisFile(); //响应解析文件,使用线程池 52 | void SlotCheckAll(int state); //响应全选勾选框 53 | void SlotDelSelect(); //响应删除选中项 54 | // void FilePathListProcess(const QStringList &filePathList); //处理选中的文件列表 55 | // void FilePathProcess(const QString &filePath); //处理选中的文件 56 | bool AnalysisFileName(const QString &filePath, OpenFileTable &openFileTable); //从文件名中提取信息 57 | //void AddRowToTableWidget(const OpenFileTable &openFileTable); //添加到对话框的文件列表中 58 | //void SetComboBoxData(QComboBox *box, const QString &text); 59 | bool AnalysisExonInfo(const QString &exonString, OpenFileTable &openFileTable); //从文件名提取外显子信息 60 | void SetProcessbarValue(); 61 | void slotprocessone(const OpenFileTable &info); 62 | void AddRowToTableWidget_s(const OpenFileTable &openFileTable); 63 | void showPopupList(int row, int column); 64 | void changetableitem(QListWidgetItem *item); 65 | void FilePathProcess_s(const QString &filePath, OpenFileTable &info); 66 | private: 67 | Ui::OpenFileDialog *ui; 68 | 69 | QStringList m_geneNames_List; //基因名称列表 70 | QStringList m_gsspNames_List; //gssp名称列表 71 | QStringList m_exonNames_List; //外显子名称列表 72 | QStringList m_ROrFNames_List; //正序,反序名称列表 73 | QSet m_set_File; //列表文件集合 74 | QSet m_set_sample; //样品set 75 | //QMap m_map_ExonAndRF; //外显子和正反序map 76 | int m_iPrgvalue; //进度条数值 77 | int m_iOpenfile; //选中导入的文件数目 78 | 79 | QListWidget *m_geneNames_ptr; 80 | QListWidget *m_gene_panel_ptr; 81 | QListWidget *m_gsspNames_ptr; 82 | QListWidget *m_exonNames_ptr; 83 | QListWidget *m_ROrFNames_ptr; 84 | 85 | QTableWidgetItem *m_tableitem_ptr; 86 | }; 87 | 88 | #endif // OPENFILEDIALOG_H 89 | -------------------------------------------------------------------------------- /src/Dialog/openfiledialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | OpenFileDialog 4 | 5 | 6 | 7 | 0 8 | 0 9 | 616 10 | 439 11 | 12 | 13 | 14 | Open File 15 | 16 | 17 | 18 | :/png/images/about.png:/png/images/about.png 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 2 27 | 0 28 | 611 29 | 351 30 | 31 | 32 | 33 | false 34 | 35 | 36 | false 37 | 38 | 39 | 40 | 41 | 42 | 10 43 | 375 44 | 91 45 | 16 46 | 47 | 48 | 49 | Select All 50 | 51 | 52 | 53 | 54 | 55 | 110 56 | 370 57 | 121 58 | 23 59 | 60 | 61 | 62 | Delete Selected 63 | 64 | 65 | 66 | 67 | 68 | 310 69 | 370 70 | 75 71 | 23 72 | 73 | 74 | 75 | Open 76 | 77 | 78 | 79 | 80 | 81 | 410 82 | 370 83 | 91 84 | 23 85 | 86 | 87 | 88 | Analysis All 89 | 90 | 91 | 92 | 93 | 94 | 525 95 | 370 96 | 75 97 | 23 98 | 99 | 100 | 101 | Cancel 102 | 103 | 104 | 105 | 106 | 107 | 10 108 | 400 109 | 131 110 | 23 111 | 112 | 113 | 114 | F:%1/S:%2 Ready: 115 | 116 | 117 | 118 | 119 | 120 | 170 121 | 400 122 | 431 123 | 23 124 | 125 | 126 | 127 | 0 128 | 129 | 130 | false 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | -------------------------------------------------------------------------------- /src/Dialog/reportdlg.cpp: -------------------------------------------------------------------------------- 1 | #include "reportdlg.h" 2 | #include "ui_reportdlg.h" 3 | #include "Core/core.h" 4 | #include "DataBase/soaptypingdb.h" 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | ReportDlg::ReportDlg(QWidget *parent) : 12 | QDialog(parent), 13 | ui(new Ui::ReportDlg) 14 | { 15 | ui->setupUi(this); 16 | ConnectSignalandSlot(); 17 | setDefaultPath(); 18 | } 19 | 20 | ReportDlg::~ReportDlg() 21 | { 22 | delete ui; 23 | } 24 | 25 | 26 | void ReportDlg::ConnectSignalandSlot() 27 | { 28 | connect(ui->btnBrowse, &QPushButton::clicked, this, &ReportDlg::slotClickScanBt); 29 | connect(ui->btnSave, &QPushButton::clicked, this, &ReportDlg::slotClickSaveBt); 30 | connect(ui->btnExit, &QPushButton::clicked, this, &ReportDlg::close); 31 | } 32 | 33 | void ReportDlg::setDefaultPath() 34 | { 35 | QString strDir; 36 | Core::GetInstance()->GetConfig("path/ReportDir",strDir); 37 | QString strfile = QString("%1_%2.xls").arg(QDate::currentDate().toString("yyyy_MM_dd")) 38 | .arg(QTime::currentTime().toString("hh_mm_ss_zzz")); 39 | if(strDir.isEmpty()) 40 | { 41 | strDir = QDir::home().path(); 42 | Core::GetInstance()->SetConfig("path/ReportDir",strDir); 43 | } 44 | 45 | QString strPath = QString("%1%2%3").arg(strDir).arg(QDir::separator()).arg(strfile); 46 | ui->lineEdit_path->setText(strPath); 47 | } 48 | 49 | void ReportDlg::setVersion(const QString &strVer) 50 | { 51 | m_str_Version = strVer; 52 | } 53 | 54 | void ReportDlg::slotClickScanBt() 55 | { 56 | QString strDir; 57 | Core::GetInstance()->GetConfig("path/ReportDir",strDir); 58 | 59 | QString strSelectDir= QFileDialog::getExistingDirectory(this, tr("Export"), strDir); 60 | if (!strSelectDir.isEmpty()) 61 | { 62 | Core::GetInstance()->SetConfig("path/ReportDir",strSelectDir); 63 | 64 | QString strPath = QString("%1%2%3_%4.xls").arg(strSelectDir).arg(QDir::separator()) 65 | .arg(QDate::currentDate().toString("yyyy_MM_dd")) 66 | .arg(QTime::currentTime().toString("hh_mm_ss_zzz")); 67 | 68 | ui->lineEdit_path->setText(strPath); 69 | } 70 | } 71 | 72 | void ReportDlg::printReport() 73 | { 74 | QString strPath = ui->lineEdit_path->text(); 75 | int i_num = ui->lineEdit_count->text().toInt(); 76 | bool bignoreIndel = ui->checkBox->checkState(); 77 | QFile file(strPath); 78 | if(!file.open(QFile::WriteOnly)) 79 | { 80 | return; 81 | } 82 | 83 | QTextStream stream(&file); 84 | 85 | QString strtime; 86 | strtime.append(QDate::currentDate().toString("MM/dd/yyyy").trimmed());//"yyyy/MM/dd" 87 | strtime.append(" "); 88 | strtime.append(QTime::currentTime().toString("hh:mm:ss").trimmed()); 89 | QString version = QString("Reported by Soaptyping V%1 %2").arg(m_str_Version).arg(strtime); 90 | stream<getSampleNamesFromRealTimeDatabase(sampleNames); 99 | int start, end; 100 | for(int i=0; igetSampleStartEndBySampleName(sampleNames.at(i), start, end); 103 | stream<getResultFromRealTimeDatabaseBySampleName(sampleNames.at(i), result); 107 | if(type==0) 108 | { 109 | QStringList list = result.split(";", QString::SkipEmptyParts); 110 | int num=0; 111 | for(int i=0; iisIndelInRange(line.at(1),start, end) || 119 | SoapTypingDB::GetInstance()->isIndelInRange(line.at(2), start, end)) 120 | continue; 121 | } 122 | if(i_num==0) 123 | { 124 | if(line.at(0)=="0") 125 | { 126 | isdo = true; 127 | 128 | stream<<"\t"<=i_num) 142 | break; 143 | } 144 | } 145 | } 146 | else if(type==1) 147 | { 148 | QStringList list = result.split(";", QString::SkipEmptyParts); 149 | int num=0; 150 | for(int i=0; iisIndelInRange(line.at(1),start, end) || 158 | SoapTypingDB::GetInstance()->isIndelInRange(line.at(2), start, end)) 159 | continue; 160 | } 161 | if(i_num==0) 162 | { 163 | if(line.at(0).at(0) =='0') 164 | { 165 | isdo = true; 166 | stream<<"\t"<=i_num) 181 | break; 182 | } 183 | } 184 | } 185 | else if (type == 2) 186 | { 187 | QStringList pair = result.split(",", QString::SkipEmptyParts); 188 | isdo = true; 189 | if(i_num == 0) 190 | stream<<"\t"< 5 | 6 | namespace Ui { 7 | class ReportDlg; 8 | } 9 | 10 | class ReportDlg : public QDialog 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | explicit ReportDlg(QWidget *parent = nullptr); 16 | ~ReportDlg(); 17 | void setVersion(const QString &strVer); 18 | private: 19 | void ConnectSignalandSlot(); 20 | void setDefaultPath(); 21 | void printReport(); 22 | private slots: 23 | void slotClickScanBt(); 24 | void slotClickSaveBt(); 25 | private: 26 | Ui::ReportDlg *ui; 27 | QString m_str_Version; 28 | }; 29 | 30 | #endif // REPORTDLG_H 31 | -------------------------------------------------------------------------------- /src/Dialog/reportdlg.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | ReportDlg 4 | 5 | 6 | 7 | 0 8 | 0 9 | 500 10 | 100 11 | 12 | 13 | 14 | Export 15 | 16 | 17 | 18 | :/png/images/about.png:/png/images/about.png 19 | 20 | 21 | 22 | 23 | 10 24 | 8 25 | 61 26 | 16 27 | 28 | 29 | 30 | File Name: 31 | 32 | 33 | 34 | 35 | 36 | 70 37 | 5 38 | 331 39 | 21 40 | 41 | 42 | 43 | 44 | 45 | 46 | 420 47 | 5 48 | 75 49 | 23 50 | 51 | 52 | 53 | Browse 54 | 55 | 56 | 57 | 58 | 59 | 10 60 | 40 61 | 101 62 | 16 63 | 64 | 65 | 66 | Ignore Indel 67 | 68 | 69 | true 70 | 71 | 72 | 73 | 74 | 75 | 370 76 | 40 77 | 81 78 | 20 79 | 80 | 81 | 82 | Allele Count: 83 | 84 | 85 | 86 | 87 | 88 | 450 89 | 40 90 | 41 91 | 20 92 | 93 | 94 | 95 | 96 | 97 | 98 | 340 99 | 70 100 | 75 101 | 23 102 | 103 | 104 | 105 | Save 106 | 107 | 108 | 109 | 110 | 111 | 420 112 | 70 113 | 75 114 | 23 115 | 116 | 117 | 118 | Exit 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | -------------------------------------------------------------------------------- /src/Dialog/savefiledlg.cpp: -------------------------------------------------------------------------------- 1 | #include "savefiledlg.h" 2 | #include "ui_savefiledlg.h" 3 | #include "DataBase/soaptypingdb.h" 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include "Core/core.h" 9 | 10 | const QString RESULTPATH = "Result"; 11 | 12 | SaveFileDlg::SaveFileDlg(QWidget *parent) : 13 | QDialog(parent), 14 | ui(new Ui::SaveFileDlg) 15 | { 16 | ui->setupUi(this); 17 | InitUI(); 18 | setTableDefaultData(); 19 | ConnectSignalandSlot(); 20 | } 21 | 22 | SaveFileDlg::~SaveFileDlg() 23 | { 24 | delete ui; 25 | } 26 | 27 | void SaveFileDlg::InitUI() 28 | { 29 | ui->tableWidget->setEditTriggers(QAbstractItemView::NoEditTriggers); 30 | ui->tableWidget->setAlternatingRowColors(true); 31 | ui->tableWidget->horizontalHeader()->setStretchLastSection(true); 32 | ui->tableWidget->verticalHeader()->setVisible(false); 33 | ui->tableWidget->setColumnCount(4); 34 | ui->tableWidget->setColumnWidth(0, 200); 35 | ui->tableWidget->setColumnWidth(1, 150); 36 | ui->tableWidget->setColumnWidth(2, 150); 37 | ui->tableWidget->setColumnWidth(3, 70); 38 | 39 | QStringList header; 40 | header<<"Sample Name"<<"Analysis Type"<<"Mark Type"<<"User"; 41 | ui->tableWidget->setHorizontalHeaderLabels(header); 42 | } 43 | 44 | void SaveFileDlg::ConnectSignalandSlot() 45 | { 46 | connect(ui->checkall, &QCheckBox::clicked, this, &SaveFileDlg::slotClickCheckAllBox); 47 | connect(ui->savebydate, &QCheckBox::clicked,this, &SaveFileDlg::slotClickCheckSaveByDateBox); 48 | connect(ui->btnsave, &QPushButton::clicked, this, &SaveFileDlg::slotClickSaveButton); 49 | connect(ui->btnexit, &QPushButton::clicked, this, &SaveFileDlg::close); 50 | } 51 | 52 | void SaveFileDlg::slotClickCheckAllBox(bool ischeck) 53 | { 54 | for(int i=0; itableWidget->rowCount(); i++) 55 | { 56 | Qt::CheckState state = ischeck ? Qt::Checked : Qt::Unchecked; 57 | ui->tableWidget->item(i, 0)->setCheckState(state); 58 | } 59 | } 60 | 61 | void SaveFileDlg::slotClickCheckSaveByDateBox(bool ischeck) 62 | { 63 | m_bSaveByDate = ischeck; 64 | } 65 | 66 | void SaveFileDlg::slotClickSaveButton() 67 | { 68 | int i_row = ui->tableWidget->rowCount(); 69 | if(i_row > 0) 70 | { 71 | QVector vec_checked; 72 | for(int i=0; itableWidget->item(i, 0)->checkState() == Qt::Checked) 75 | { 76 | QString str_name = ui->tableWidget->item(i, 0)->text(); 77 | vec_checked.push_back(m_map_SampleTreeInfo[str_name]); 78 | } 79 | } 80 | 81 | if(vec_checked.empty()) 82 | { 83 | QMessageBox::warning(this, tr("Soap Typing"), "Please choose sample to save!"); 84 | return; 85 | } 86 | 87 | ui->checkall->setEnabled(false); 88 | ui->savebydate->setEnabled(false); 89 | ui->btnexit->setEnabled(false); 90 | ui->btnsave->setEnabled(false); 91 | saveFileT(vec_checked); 92 | close(); 93 | } 94 | } 95 | 96 | void SaveFileDlg::saveFileT(QVector &sampleInfos) 97 | { 98 | ui->status->setText("Waiting:.."); 99 | ui->progressBar->setRange(0, sampleInfos.size()); 100 | 101 | for(int i=0; iprogressBar->setValue(i+1); 105 | } 106 | 107 | ui->status->setText("Ready:"); 108 | return; 109 | } 110 | 111 | void SaveFileDlg::setTableDefaultData() 112 | { 113 | SoapTypingDB::GetInstance()->getSampleTreeDataFromSampleTable(m_map_SampleTreeInfo); 114 | 115 | ui->tableWidget->setRowCount(m_map_SampleTreeInfo.size()); //必须设置,且要放置到前面,否则不显示表格内容 116 | int i = 0; 117 | foreach(const SampleTreeInfo_t& info, m_map_SampleTreeInfo.values()) 118 | { 119 | QTableWidgetItem *item = new QTableWidgetItem; 120 | 121 | ui->tableWidget->setRowHeight(i, 20); 122 | item->setCheckState(Qt::Checked); 123 | item->setIcon(Core::GetInstance()->getIcon(info.analysisType, info.markType)); 124 | item->setText(info.sampleName); 125 | ui->tableWidget->setItem(i, 0, item); 126 | 127 | item = new QTableWidgetItem; 128 | item->setText(Core::GetInstance()->getAnalysisType(info.analysisType)); 129 | ui->tableWidget->setItem(i, 1, item); 130 | 131 | item = new QTableWidgetItem; 132 | item->setText(Core::GetInstance()->getMarkType(info.markType)); 133 | ui->tableWidget->setItem(i, 2, item); 134 | 135 | item = new QTableWidgetItem; 136 | item->setText("default"); 137 | ui->tableWidget->setItem(i, 3, item); 138 | i++; 139 | } 140 | 141 | } 142 | 143 | void SaveFileDlg::saveSampleT(bool isBydate, const SampleTreeInfo_t &sampleInfo) 144 | { 145 | QString dirPath; 146 | QString str_date(""); 147 | if (isBydate) 148 | { 149 | str_date = QDate::currentDate().toString("yyyyMMdd"); 150 | dirPath = QString("%1%2%3_%4").arg(RESULTPATH).arg(QDir::separator()).arg(sampleInfo.sampleName).arg(str_date); 151 | } 152 | else 153 | { 154 | dirPath = QString("%1%2%3").arg(RESULTPATH).arg(QDir::separator()).arg(sampleInfo.sampleName); 155 | } 156 | 157 | QDir dir0; 158 | dir0.mkpath(dirPath); 159 | 160 | QString listFileName = QString("%1%2list.txt").arg(dirPath).arg(QDir::separator()); 161 | QFile file(listFileName); 162 | if(file.exists()) 163 | { 164 | file.remove(); 165 | } 166 | file.open(QFile::WriteOnly); 167 | QTextStream stream(&file); 168 | QString outFile = QString("%1%2%3.txt").arg(dirPath).arg(QDir::separator()).arg(sampleInfo.sampleName); 169 | stream<<"AType:"<saveSample(sampleInfo.sampleName, outFile, str_date); 173 | 174 | for(int i=0; isaveFile(fileInfo.isGssp, fileInfo.fileName, outFile, dirPath, str_date); 182 | } 183 | else 184 | { 185 | stream<<"fileTable:"<saveFile(fileInfo.isGssp, fileInfo.fileName, outFile, dirPath, str_date); 187 | } 188 | 189 | } 190 | file.close(); 191 | } 192 | 193 | -------------------------------------------------------------------------------- /src/Dialog/savefiledlg.h: -------------------------------------------------------------------------------- 1 | #ifndef SAVEFILEDLG_H 2 | #define SAVEFILEDLG_H 3 | 4 | #include 5 | #include "all_base_struct.h" 6 | 7 | namespace Ui { 8 | class SaveFileDlg; 9 | } 10 | 11 | class SaveFileDlg : public QDialog 12 | { 13 | Q_OBJECT 14 | 15 | public: 16 | explicit SaveFileDlg(QWidget *parent = nullptr); 17 | ~SaveFileDlg(); 18 | public: 19 | static void saveSampleT(bool isBydate, const SampleTreeInfo_t &sampleInfo); 20 | private: 21 | void InitUI(); 22 | void ConnectSignalandSlot(); 23 | void setTableDefaultData(); 24 | void saveFileT(QVector &sampleInfos); 25 | 26 | 27 | private slots: 28 | void slotClickCheckAllBox(bool ischeck); 29 | void slotClickCheckSaveByDateBox(bool ischeck); 30 | void slotClickSaveButton(); 31 | 32 | private: 33 | Ui::SaveFileDlg *ui; 34 | bool m_bSaveByDate; 35 | QMap m_map_SampleTreeInfo; 36 | }; 37 | 38 | #endif // SAVEFILEDLG_H 39 | -------------------------------------------------------------------------------- /src/Dialog/savefiledlg.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | SaveFileDlg 4 | 5 | 6 | 7 | 0 8 | 0 9 | 616 10 | 439 11 | 12 | 13 | 14 | Save File 15 | 16 | 17 | 18 | :/png/images/about.png:/png/images/about.png 19 | 20 | 21 | 22 | 23 | 5 24 | 5 25 | 605 26 | 361 27 | 28 | 29 | 30 | 31 | 32 | 33 | 10 34 | 380 35 | 71 36 | 16 37 | 38 | 39 | 40 | check All 41 | 42 | 43 | true 44 | 45 | 46 | 47 | 48 | 49 | 100 50 | 380 51 | 101 52 | 16 53 | 54 | 55 | 56 | save by date 57 | 58 | 59 | 60 | 61 | 62 | 440 63 | 380 64 | 75 65 | 23 66 | 67 | 68 | 69 | Save 70 | 71 | 72 | 73 | 74 | 75 | 530 76 | 380 77 | 75 78 | 23 79 | 80 | 81 | 82 | Exit 83 | 84 | 85 | 86 | 87 | true 88 | 89 | 90 | 91 | 10 92 | 410 93 | 75 94 | 23 95 | 96 | 97 | 98 | Ready: 99 | 100 | 101 | 102 | 103 | 104 | 100 105 | 410 106 | 501 107 | 23 108 | 109 | 110 | 111 | 0 112 | 113 | 114 | false 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | -------------------------------------------------------------------------------- /src/Dialog/setdlg.cpp: -------------------------------------------------------------------------------- 1 | #include "setdlg.h" 2 | #include "ui_setdlg.h" 3 | #include "Core/core.h" 4 | 5 | SetDlg::SetDlg(QWidget *parent) : 6 | QDialog(parent), 7 | ui(new Ui::SetDlg) 8 | { 9 | ui->setupUi(this); 10 | ConnectSignalandSlot(); 11 | QString strig; 12 | Core::GetInstance()->GetConfig("Set/Ignore", strig); 13 | if(strig == "1") 14 | { 15 | ui->checkBox->setCheckState(Qt::Checked); 16 | } 17 | else 18 | { 19 | ui->checkBox->setCheckState(Qt::Unchecked); 20 | } 21 | } 22 | 23 | SetDlg::~SetDlg() 24 | { 25 | delete ui; 26 | } 27 | 28 | void SetDlg::ConnectSignalandSlot() 29 | { 30 | connect(ui->btnReset, &QPushButton::clicked, this, &SetDlg::slotClickResetButton); 31 | connect(ui->btnSave, &QPushButton::clicked, this, &SetDlg::slotClickSaveButton); 32 | connect(ui->btnExit, &QPushButton::clicked, this, &SetDlg::close); 33 | } 34 | 35 | void SetDlg::slotClickResetButton() 36 | { 37 | ui->checkBox->setCheckState(Qt::Checked); 38 | Core::GetInstance()->SetConfig("Set/Ignore", "1"); 39 | } 40 | 41 | void SetDlg::slotClickSaveButton() 42 | { 43 | if(ui->checkBox->isChecked()) 44 | { 45 | Core::GetInstance()->SetConfig("Set/Ignore", "1"); 46 | } 47 | else 48 | { 49 | Core::GetInstance()->SetConfig("Set/Ignore", "0"); 50 | } 51 | 52 | close(); 53 | } 54 | -------------------------------------------------------------------------------- /src/Dialog/setdlg.h: -------------------------------------------------------------------------------- 1 | #ifndef SETDLG_H 2 | #define SETDLG_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class SetDlg; 8 | } 9 | 10 | class SetDlg : public QDialog 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | explicit SetDlg(QWidget *parent = nullptr); 16 | ~SetDlg(); 17 | private: 18 | void ConnectSignalandSlot(); 19 | private slots: 20 | void slotClickResetButton(); 21 | void slotClickSaveButton(); 22 | private: 23 | Ui::SetDlg *ui; 24 | }; 25 | 26 | #endif // SETDLG_H 27 | -------------------------------------------------------------------------------- /src/Dialog/setdlg.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | SetDlg 4 | 5 | 6 | 7 | 0 8 | 0 9 | 300 10 | 200 11 | 12 | 13 | 14 | Dialog 15 | 16 | 17 | 18 | 19 | 10 20 | 20 21 | 181 22 | 21 23 | 24 | 25 | 26 | Ignore Indel Alleles : 27 | 28 | 29 | 30 | 31 | 32 | 260 33 | 20 34 | 21 35 | 16 36 | 37 | 38 | 39 | 40 | 41 | 42 | true 43 | 44 | 45 | 46 | 47 | 48 | 10 49 | 170 50 | 75 51 | 23 52 | 53 | 54 | 55 | Reset 56 | 57 | 58 | 59 | 60 | 61 | 110 62 | 170 63 | 75 64 | 23 65 | 66 | 67 | 68 | Save 69 | 70 | 71 | 72 | 73 | 74 | 210 75 | 170 76 | 75 77 | 23 78 | 79 | 80 | 81 | Exit 82 | 83 | 84 | 85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /src/Dialog/updatedatadlg.h: -------------------------------------------------------------------------------- 1 | #ifndef UPDATEDATADLG_H 2 | #define UPDATEDATADLG_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace Ui { 9 | class UpdateDataDlg; 10 | } 11 | 12 | class UpdateDataDlg : public QDialog 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | explicit UpdateDataDlg(QWidget *parent = nullptr); 18 | ~UpdateDataDlg(); 19 | private: 20 | void ConnectSignalandSlot(); 21 | bool isFileExists(const QString &file); 22 | void UpdateDatabase(); 23 | private slots: 24 | void slotOpenFileFlg(); 25 | void slotApply(); 26 | void slotClear(); 27 | void slotInsert(); 28 | void slotOpenDir(); 29 | private: 30 | Ui::UpdateDataDlg *ui; 31 | QString m_str_dir; 32 | }; 33 | 34 | class SeqLine 35 | { 36 | public: 37 | SeqLine(const QString &name); 38 | ~SeqLine(); 39 | void AppendSeqArry(char ch); 40 | void AppendSeq(const QByteArray &arry); 41 | QByteArray& GetSeqArry(); 42 | void InsertByType(int type, int pos, char ch); 43 | int CalcSeqInfo(QVector &vec_index); 44 | int GetSeqLineLenth(); 45 | void SetClassNumber(int number); 46 | int GetClassNumber(); 47 | int CalcExonIndex(QVector &vec_pos, int pos); 48 | QString& GetSeqLineName(); 49 | int GetStartindex(); 50 | int GetEndindex(); 51 | void SetIsRare(bool flag); 52 | bool GetIsRare(); 53 | bool GetIsIndel(); 54 | QMap& GetMapInfo(int type); 55 | private: 56 | bool m_isRare; 57 | bool m_isIndel; 58 | int m_classesNumber; 59 | 60 | int m_startindex; 61 | int m_endindex; 62 | int m_reallen; 63 | 64 | QByteArray m_seqArry; 65 | QString m_strName; 66 | QMap m_map_change; 67 | QMap m_map_inl; 68 | QMap m_map_del; 69 | }; 70 | 71 | #endif // UPDATEDATADLG_H 72 | -------------------------------------------------------------------------------- /src/Dialog/updatedatadlg.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | UpdateDataDlg 4 | 5 | 6 | 7 | 0 8 | 0 9 | 600 10 | 350 11 | 12 | 13 | 14 | SoapTyping 15 | 16 | 17 | 18 | :/png/images/about.png:/png/images/about.png 19 | 20 | 21 | 22 | 23 | 1 24 | 1 25 | 598 26 | 348 27 | 28 | 29 | 30 | 0 31 | 32 | 33 | 34 | Selective Update 35 | 36 | 37 | 38 | 39 | 10 40 | 20 41 | 81 42 | 25 43 | 44 | 45 | 46 | Gene File: 47 | 48 | 49 | 50 | 51 | 52 | 10 53 | 60 54 | 81 55 | 25 56 | 57 | 58 | 59 | Allele File: 60 | 61 | 62 | 63 | 64 | 65 | 10 66 | 100 67 | 71 68 | 25 69 | 70 | 71 | 72 | Gssp File: 73 | 74 | 75 | 76 | 77 | 78 | 10 79 | 140 80 | 101 81 | 25 82 | 83 | 84 | 85 | Lab Align File: 86 | 87 | 88 | 89 | 90 | 91 | 10 92 | 180 93 | 81 94 | 25 95 | 96 | 97 | 98 | Common File: 99 | 100 | 101 | 102 | 103 | 104 | 120 105 | 20 106 | 381 107 | 25 108 | 109 | 110 | 111 | 112 | 113 | 114 | 120 115 | 60 116 | 381 117 | 25 118 | 119 | 120 | 121 | 122 | 123 | 124 | 120 125 | 100 126 | 381 127 | 25 128 | 129 | 130 | 131 | 132 | 133 | 134 | 120 135 | 140 136 | 381 137 | 25 138 | 139 | 140 | 141 | 142 | 143 | 144 | 120 145 | 180 146 | 381 147 | 25 148 | 149 | 150 | 151 | 152 | 153 | 154 | 510 155 | 20 156 | 75 157 | 23 158 | 159 | 160 | 161 | Browse 162 | 163 | 164 | 165 | 166 | 167 | 510 168 | 60 169 | 75 170 | 23 171 | 172 | 173 | 174 | Browse 175 | 176 | 177 | 178 | 179 | 180 | 510 181 | 100 182 | 75 183 | 23 184 | 185 | 186 | 187 | Browse 188 | 189 | 190 | 191 | 192 | 193 | 510 194 | 140 195 | 75 196 | 23 197 | 198 | 199 | 200 | Browse 201 | 202 | 203 | 204 | 205 | 206 | 510 207 | 180 208 | 75 209 | 23 210 | 211 | 212 | 213 | Browse 214 | 215 | 216 | 217 | 218 | 219 | 430 220 | 290 221 | 75 222 | 23 223 | 224 | 225 | 226 | Apply 227 | 228 | 229 | 230 | 231 | 232 | 510 233 | 290 234 | 75 235 | 23 236 | 237 | 238 | 239 | Exit 240 | 241 | 242 | 243 | 244 | 245 | 10 246 | 220 247 | 81 248 | 25 249 | 250 | 251 | 252 | All Nuc File: 253 | 254 | 255 | 256 | 257 | 258 | 120 259 | 220 260 | 381 261 | 25 262 | 263 | 264 | 265 | 266 | 267 | 268 | 510 269 | 220 270 | 75 271 | 23 272 | 273 | 274 | 275 | Browse 276 | 277 | 278 | 279 | 280 | 281 | Insert GSSP 282 | 283 | 284 | 285 | 286 | 10 287 | 10 288 | 111 289 | 25 290 | 291 | 292 | 293 | GSSP Name: 294 | 295 | 296 | 297 | 298 | 299 | 210 300 | 10 301 | 111 302 | 25 303 | 304 | 305 | 306 | Gene Name: 307 | 308 | 309 | 310 | 311 | 312 | 400 313 | 10 314 | 111 315 | 25 316 | 317 | 318 | 319 | Exon Index[1,8] 320 | 321 | 322 | 323 | 324 | 325 | 8 326 | 40 327 | 185 328 | 25 329 | 330 | 331 | 332 | 333 | 334 | 335 | 203 336 | 40 337 | 185 338 | 25 339 | 340 | 341 | 342 | 343 | 344 | 345 | 398 346 | 40 347 | 185 348 | 25 349 | 350 | 351 | 352 | 353 | 354 | 355 | 8 356 | 110 357 | 185 358 | 25 359 | 360 | 361 | 362 | 363 | 364 | 365 | 398 366 | 110 367 | 185 368 | 25 369 | 370 | 371 | 372 | 373 | 374 | 375 | 10 376 | 80 377 | 111 378 | 25 379 | 380 | 381 | 382 | F or R(F/R): 383 | 384 | 385 | 386 | 387 | 388 | 400 389 | 80 390 | 111 391 | 25 392 | 393 | 394 | 395 | GSSP Bases: 396 | 397 | 398 | 399 | 400 | 401 | 203 402 | 110 403 | 185 404 | 25 405 | 406 | 407 | 408 | 409 | 410 | 411 | 210 412 | 80 413 | 111 414 | 25 415 | 416 | 417 | 418 | GSSP Position: 419 | 420 | 421 | 422 | 423 | 424 | 350 425 | 290 426 | 75 427 | 23 428 | 429 | 430 | 431 | Clear 432 | 433 | 434 | 435 | 436 | 437 | 430 438 | 290 439 | 75 440 | 23 441 | 442 | 443 | 444 | Insert 445 | 446 | 447 | 448 | 449 | 450 | 510 451 | 290 452 | 75 453 | 23 454 | 455 | 456 | 457 | Exit 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | -------------------------------------------------------------------------------- /src/Dialog/usercommentdlg.cpp: -------------------------------------------------------------------------------- 1 | #include "usercommentdlg.h" 2 | #include "ui_usercommentdlg.h" 3 | #include "DataBase/soaptypingdb.h" 4 | 5 | UserCommentDlg::UserCommentDlg(QWidget *parent) : 6 | QDialog(parent), 7 | ui(new Ui::UserCommentDlg) 8 | { 9 | ui->setupUi(this); 10 | 11 | connect(ui->btnSave, &QPushButton::clicked, this, &UserCommentDlg::slotSave); 12 | connect(ui->btnExit, &QPushButton::clicked, this, &UserCommentDlg::close); 13 | } 14 | 15 | UserCommentDlg::~UserCommentDlg() 16 | { 17 | delete ui; 18 | } 19 | 20 | void UserCommentDlg::setSampleName(const QString &sampleName) 21 | { 22 | m_str_SampleName = sampleName; 23 | ui->lineEdit->setText(m_str_SampleName); 24 | QString str_noteinfo; 25 | SoapTypingDB::GetInstance()->getSetNoteFromSampleTable(sampleName, str_noteinfo); 26 | if(!str_noteinfo.isEmpty()) 27 | { 28 | ui->textEdit->setText(str_noteinfo); 29 | } 30 | } 31 | 32 | void UserCommentDlg::slotSave() 33 | { 34 | SoapTypingDB::GetInstance()->updateSetNoteBySampleName(m_str_SampleName, ui->textEdit->toPlainText()); 35 | close(); 36 | } 37 | 38 | -------------------------------------------------------------------------------- /src/Dialog/usercommentdlg.h: -------------------------------------------------------------------------------- 1 | #ifndef USERCOMMENTDLG_H 2 | #define USERCOMMENTDLG_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class UserCommentDlg; 8 | } 9 | 10 | class UserCommentDlg : public QDialog 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | explicit UserCommentDlg(QWidget *parent = nullptr); 16 | ~UserCommentDlg(); 17 | void setSampleName(const QString &sampleName); 18 | 19 | private slots: 20 | void slotSave(); 21 | private: 22 | Ui::UserCommentDlg *ui; 23 | QString m_str_SampleName; 24 | }; 25 | 26 | #endif // USERCOMMENTDLG_H 27 | -------------------------------------------------------------------------------- /src/Dialog/usercommentdlg.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | UserCommentDlg 4 | 5 | 6 | 7 | 0 8 | 0 9 | 379 10 | 191 11 | 12 | 13 | 14 | Dialog 15 | 16 | 17 | 18 | 19 | 10 20 | 20 21 | 71 22 | 16 23 | 24 | 25 | 26 | Sample Name: 27 | 28 | 29 | 30 | 31 | 32 | 90 33 | 9 34 | 271 35 | 31 36 | 37 | 38 | 39 | 40 | 41 | 42 | 10 43 | 50 44 | 271 45 | 121 46 | 47 | 48 | 49 | 50 | 51 | 52 | 290 53 | 70 54 | 75 55 | 23 56 | 57 | 58 | 59 | Save 60 | 61 | 62 | 63 | 64 | 65 | 290 66 | 120 67 | 75 68 | 23 69 | 70 | 71 | 72 | Exit 73 | 74 | 75 | 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /src/HLA.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2018-07-27T08:51:59 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui sql concurrent 8 | 9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 10 | 11 | 12 | TARGET = soaptyping 13 | TEMPLATE = app 14 | 15 | # The following define makes your compiler emit warnings if you use 16 | # any feature of Qt which has been marked as deprecated (the exact warnings 17 | # depend on your compiler). Please consult the documentation of the 18 | # deprecated API in order to know how to port your code away from it. 19 | DEFINES += QT_DEPRECATED_WARNINGS 20 | 21 | # You can also make your code fail to compile if you use deprecated APIs. 22 | # In order to do so, uncomment the following line. 23 | # You can also select to disable deprecated APIs only up to a certain version of Qt. 24 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 25 | 26 | 27 | SOURCES += \ 28 | main.cpp \ 29 | Mainwindow/mainwindow.cpp \ 30 | Dialog/openfiledialog.cpp \ 31 | DataBase/soaptypingdb.cpp \ 32 | ThreadTask/analysisab1threadtask.cpp \ 33 | ThreadTask/analysissamplethreadtask.cpp \ 34 | Core/Ab1.cpp \ 35 | Core/fileTablebase.cpp \ 36 | Core/core.cpp \ 37 | Mainwindow/sampletreewidget.cpp \ 38 | Mainwindow/matchlistwidget.cpp \ 39 | Mainwindow/multipeakwidget.cpp \ 40 | Mainwindow/exonnavigatorwidget.cpp \ 41 | Mainwindow/basealigntablewidget.cpp \ 42 | Dialog/usercommentdlg.cpp \ 43 | Dialog/savefiledlg.cpp \ 44 | Dialog/gsspinfodlg.cpp \ 45 | Dialog/finaltypedlg.cpp \ 46 | Dialog/loadfiledlg.cpp \ 47 | Dialog/deletefiledlg.cpp \ 48 | Dialog/reportdlg.cpp \ 49 | Dialog/allelepairdlg.cpp \ 50 | Dialog/setdlg.cpp \ 51 | Dialog/exontimdlg.cpp \ 52 | Dialog/alignmentdlg.cpp \ 53 | log/log.cpp \ 54 | Dialog/updatedatadlg.cpp \ 55 | ThreadTask/fileprocessthreadtask.cpp 56 | 57 | HEADERS += \ 58 | Mainwindow/mainwindow.h \ 59 | Dialog/openfiledialog.h \ 60 | DataBase/soaptypingdb.h \ 61 | all_base_struct.h \ 62 | ThreadTask/analysisab1threadtask.h \ 63 | Core/Ab1.h \ 64 | Core/fileTablebase.h \ 65 | Core/core.h \ 66 | ThreadTask/analysissamplethreadtask.h \ 67 | Mainwindow/sampletreewidget.h \ 68 | Mainwindow/matchlistwidget.h \ 69 | Mainwindow/multipeakwidget.h \ 70 | Mainwindow/exonnavigatorwidget.h \ 71 | Mainwindow/basealigntablewidget.h \ 72 | Dialog/usercommentdlg.h \ 73 | Dialog/savefiledlg.h \ 74 | Dialog/gsspinfodlg.h \ 75 | Dialog/finaltypedlg.h \ 76 | Dialog/loadfiledlg.h \ 77 | Dialog/deletefiledlg.h \ 78 | Dialog/reportdlg.h \ 79 | Dialog/allelepairdlg.h \ 80 | Dialog/setdlg.h \ 81 | Dialog/exontimdlg.h \ 82 | Dialog/alignmentdlg.h \ 83 | log/log.h \ 84 | log/macro_define.h \ 85 | Dialog/updatedatadlg.h \ 86 | ThreadTask/fileprocessthreadtask.h 87 | 88 | 89 | FORMS += \ 90 | Mainwindow/mainwindow.ui \ 91 | Dialog/openfiledialog.ui \ 92 | Dialog/usercommentdlg.ui \ 93 | Dialog/savefiledlg.ui \ 94 | Dialog/gsspinfodlg.ui \ 95 | Dialog/finaltypedlg.ui \ 96 | Dialog/loadfiledlg.ui \ 97 | Dialog/deletefiledlg.ui \ 98 | Dialog/reportdlg.ui \ 99 | Dialog/allelepairdlg.ui \ 100 | Dialog/setdlg.ui \ 101 | Dialog/exontimdlg.ui \ 102 | Dialog/alignmentdlg.ui \ 103 | Dialog/updatedatadlg.ui 104 | RESOURCES += \ 105 | hla.qrc 106 | RC_FILE += SoapTyping.rc 107 | 108 | DISTFILES += \ 109 | 110 | mac:CONFIG -= app_bundle 111 | QMAKE_CXXFLAGS += -Wno-unused-parameter 112 | QMAKE_CXXFLAGS += -Wno-unused-variable 113 | -------------------------------------------------------------------------------- /src/Mainwindow/basealigntablewidget.h: -------------------------------------------------------------------------------- 1 | #ifndef BASEALIGNTABLEWIDGET_H 2 | #define BASEALIGNTABLEWIDGET_H 3 | 4 | #include 5 | #include "all_base_struct.h" 6 | 7 | class BaseAlignTableWidget:public QTableWidget 8 | { 9 | Q_OBJECT 10 | public: 11 | BaseAlignTableWidget(); 12 | ~BaseAlignTableWidget(); 13 | void SetAlignTableData(QString &str_samplename, QString &str_file, 14 | QString str_info, int col); 15 | void SetAllelePairData(QString &allele1, QString &allele2); 16 | void SetRefresh(bool refresh){m_bRefresh = refresh;} 17 | void ClearBaseAlignTable(); 18 | private: 19 | void InitUI(); 20 | void clearBaseAlignTableSampleItem(); 21 | void getTableHead(QStringList &head, int length, int start); 22 | void getTypeResult(char *result, char *pattern, char *alleleSeq1, char *alleleSeq2, 23 | QSet &misMatch, int alignStart); 24 | void getTypeAlignResult(char *result, char *pattern, char *alleleSeq1, char *alleleSeq2, QSet &misMatch, 25 | int alignStart1, int alignStart2); 26 | void updateTopTableViewGeometry(); 27 | void resizeEvent(QResizeEvent *event)Q_DECL_OVERRIDE; 28 | void slotsliderPressed(); 29 | void slotsliderReleased(); 30 | signals: 31 | void signalTypeMisMatchPosition(QSet &typeMisMatchPositions, int type); 32 | private: 33 | int m_iRowNum; 34 | int m_iColNum; 35 | bool m_bRefresh; //是否要求重新刷新界面 36 | QString m_str_file; 37 | QString m_str_info; 38 | int m_i_col; 39 | QString m_str_SampleName; 40 | QStringList m_sl_defaulthead; 41 | BaseAlignSampleInfo m_BaseAlignSampleInfo; 42 | QTableView *m_topTableView; 43 | }; 44 | 45 | #endif // BASEALIGNTABLEWIDGET_H 46 | -------------------------------------------------------------------------------- /src/Mainwindow/exonnavigatorwidget.h: -------------------------------------------------------------------------------- 1 | #ifndef EXONNAVIGATORWIDGET_H 2 | #define EXONNAVIGATORWIDGET_H 3 | 4 | #include 5 | #include "all_base_struct.h" 6 | #include 7 | 8 | typedef struct _tagExon 9 | { 10 | int i_exonstartpos; //导航条起始pos 11 | int i_exonendpos; //导航条结束pos 12 | int i_screenstartpos; //导航条起始x坐标 13 | int i_screenwidth; //导航条长度 14 | int i_exonindex; //导航条显示index 15 | }Exon; 16 | 17 | class ExonNavigatorWidget:public QWidget 18 | { 19 | Q_OBJECT 20 | public: 21 | ExonNavigatorWidget(QWidget *parent = nullptr); 22 | ~ExonNavigatorWidget(); 23 | void SetExonData(QString &str_sample, QString &str_gene); 24 | void SetSelectPos(int colnum, int &selectpos,int &exonstartpos, int &index); 25 | void setSelectFramePosition(int index, int &startpos, int &selectpos, int &exonstartpos); 26 | void SetSelectFramePos(int index, int colnum ,int &columnPos); 27 | void ActForward(); 28 | void ActBackward(); 29 | void SetTypeMisPos(QSet &typeMismatchPos); 30 | void SetRefresh(bool refresh){m_bRefresh = refresh;} 31 | void ClearExonNav(); 32 | private: 33 | void CalcExonData(); 34 | void paintEvent(QPaintEvent *event); 35 | void DrawExonArea(QPainter &paiter); 36 | void DrawSelectFrame(QPainter &paiter); 37 | void DrawExonPos(QPainter &paiter); 38 | void mousePressEvent(QMouseEvent *event); 39 | int PeakPosToScreenPos(int oldpos); 40 | int ScreenPosToPeakPos(int newpos); 41 | void resizeEvent(QResizeEvent *event); 42 | signals: 43 | //导航条起始pos,选中的峰图pos,选中的导航条起始pos,选中的导航条index 44 | void signalExonFocusPosition(int startpos,int selectpos,int exonstart, int index); 45 | private: 46 | bool m_bRefresh; 47 | int m_iwidth; 48 | int m_iheight; 49 | int m_itop1; 50 | int m_itop2; 51 | int m_itop3; 52 | int m_ih0; 53 | int m_ih1; 54 | int m_ih2; 55 | int m_ih3; 56 | int m_iSelectPeakPos; //当前选中的峰图位置 57 | int m_iMidgap; //碱基导航条中间间距 58 | int m_igap; //碱基导航条两端间距 59 | int m_isub_pos; //外显子x坐标,最大最小之差 60 | int m_iSelectindex; //当前选中的导航条index 61 | int m_iStartPeakpos; //起始峰图位置 62 | double m_dXscale; //计算每个碱基的间距 63 | QVector m_vec_Exon; //导航条信息 64 | QVector m_vecExonIndex; 65 | ExonNavigatorInfo m_Exoninfo; 66 | QString m_str_SampleName; 67 | QString m_str_GeneName; 68 | QMap m_map_mispos; //保存所有错配位置,自动排序 69 | QMap m_map_typemispos; //保存allele错配位置,自动排序 70 | QMap m_map_TotalMisPos; //保存m_map_mispos和m_map_typemispos的集合 71 | }; 72 | 73 | #endif // EXONNAVIGATORWIDGET_H 74 | -------------------------------------------------------------------------------- /src/Mainwindow/mainwindow.h: -------------------------------------------------------------------------------- 1 | #ifndef MAINWINDOW_H 2 | #define MAINWINDOW_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | namespace Ui { 11 | class MainWindow; 12 | } 13 | 14 | class SampleTreeWidget; 15 | class MatchListWidget; 16 | class MultiPeakWidget; 17 | class ExonNavigatorWidget; 18 | class BaseAlignTableWidget; 19 | class MainWindow : public QMainWindow 20 | { 21 | Q_OBJECT 22 | 23 | public: 24 | explicit MainWindow(QWidget *parent = 0); 25 | ~MainWindow(); 26 | void InitData(); 27 | private: 28 | void SetStatusbar(); //显示底部左侧状态栏信息 29 | void ConnectSignalandSlot(); //连接信号与槽函数 30 | void DisConnectSignalandSolt(); //断开信号与槽函数连接 31 | virtual void closeEvent(QCloseEvent *e); 32 | void InitUI(); 33 | 34 | public slots: 35 | void slotSampleTreeItemChanged(QTreeWidgetItem *item, int col); 36 | void slotExonFocusPosition(int startpos, int selectpos, int exonstartpos, int index); 37 | void slotAlignTableFocusPosition(QTableWidgetItem *item); 38 | void slotPeakFocusPosition(int index, int colnum, QPoint &pos); 39 | 40 | void slotShowSaveDlg(); 41 | void slotShowLoadFileDlg(); 42 | void slotShowOpenDlg(); 43 | void slotShowDeleteDlg(); 44 | void slotShowExportDlg(); 45 | 46 | void slotReset(); 47 | void slotMisPosForward(); 48 | void slotMisPosBackward(); 49 | void slotMarkAllSampleApproved(); 50 | void slotMarkAllSampleReviewed(); 51 | void slotAlignPair(); 52 | void slotAlignLab(); 53 | void slotUpdateDatabase(); 54 | void slotControl(); 55 | void slotSetExonTrim(); 56 | 57 | void slotyRangeRoomUp(); 58 | void slotyRangeRoomDown(); 59 | void slotyRoomUp(); 60 | void slotyRoomDown(); 61 | void slotxRoomUp(); 62 | void slotxRoomDown(); 63 | void slotResetRoom(); 64 | 65 | void slotApplyOne(); 66 | void slotApplyAll(); 67 | void slotAnalyseLater(); 68 | void slotAnalyseNow(); 69 | void slotanalyse(); 70 | 71 | void slotAbout(); 72 | void slotHelp(); 73 | 74 | void slotAllelePairChanged(QString &, QString &); 75 | void slotTypeMisMatchPostion(QSet &typeMismatchPos, int type); 76 | void slotShowStatusBarMsg(const QString &msg); 77 | 78 | void slotChangeDB(const QString &str_samplename); 79 | void slotChangeDBByFile(QVector &vec_samplename); 80 | 81 | void slotClearAll();//清空当前显示信息 82 | 83 | void slotPeakAct(int type); 84 | void slotChangePeak(QString &str_file); 85 | private: 86 | Ui::MainWindow *ui; 87 | SampleTreeWidget *m_pSampleTreeWidget; 88 | MatchListWidget *m_pMatchListWidget; 89 | MultiPeakWidget *m_pMultiPeakWidget; 90 | ExonNavigatorWidget *m_pExonNavigatorWidget; 91 | BaseAlignTableWidget *m_pBaseAlignTableWidget; 92 | QScrollArea *m_pPeak_area; 93 | QString m_str_SelectFile; //保存样品列表选中的文件名称 94 | QString m_str_SelectSample; //保存样品列表选中的样品名称 95 | QTreeWidgetItem *m_pSelectItem; //保存样品列表选中的item 96 | QString m_str_GeneVer; //保存基因表的版本号 97 | bool m_bChangeDB; 98 | }; 99 | 100 | class Tipbox : public QMessageBox 101 | { 102 | Q_OBJECT 103 | public: 104 | explicit Tipbox(QWidget *parent = nullptr); 105 | ~Tipbox(); 106 | void doTask(const QString &str_samplename); 107 | }; 108 | 109 | #endif // MAINWINDOW_H 110 | -------------------------------------------------------------------------------- /src/Mainwindow/matchlistwidget.h: -------------------------------------------------------------------------------- 1 | #ifndef MATCHLISTWIDGET_H 2 | #define MATCHLISTWIDGET_H 3 | 4 | #include 5 | #include "all_base_struct.h" 6 | 7 | class MatchListWidget: public QTableWidget 8 | { 9 | Q_OBJECT 10 | public: 11 | MatchListWidget(QWidget *parent=0); 12 | ~MatchListWidget(); 13 | void SetTableData(const QString &str_sample, const QString &str_file, 14 | const QString &str_info, int col); 15 | QStringList & GetMatchList(); 16 | void SetRefresh(bool refresh){m_bRefresh = refresh;} 17 | void ClearTable(); 18 | void setAllelePairData(); 19 | private: 20 | void InitUI(); 21 | void CreateRightMenu(); 22 | void ConnectSignalandSlot(); 23 | void contextMenuEvent(QContextMenuEvent *event); 24 | void setGssp(); 25 | bool processGssp(const QVector &allelePairs, const QString &sampleName, QVector &result); 26 | // void findUsefulGssp(const char *seq11, const char *seq12, const char *seq21, const char *seq22, 27 | // int exonStart, int exonEnd, QVector &gsspTables, 28 | // QStringList &gssps, QStringList &infos); 29 | 30 | private slots: 31 | void slotClickIndelItem(QTableWidgetItem* itemNow); 32 | void slotRowChanged(QTableWidgetItem* itemNow); 33 | 34 | void slotShowGsspZCode(); 35 | void slotSetFinalType(); 36 | void slotMergeType(); 37 | signals: 38 | void signalIndelPostion(int pos); 39 | void signalAllelePair(QString &, QString &); 40 | void signalChangeDB(const QString &str_samplename); 41 | private: 42 | bool m_bRefresh; 43 | int m_iOldRow; //上次选中的行数 44 | int m_iRowCount;//总行数 45 | int m_iCol; 46 | QString m_str_file; 47 | QString m_str_SampleName; 48 | QMenu *m_pRightMenu; 49 | QAction *m_pActShowGSSPZCode; 50 | QAction *m_pActSetFinalType; 51 | QAction *m_pActMergeType; 52 | QVector m_vec_gsspInfo; 53 | QStringList m_strlist_result; 54 | }; 55 | 56 | #endif // MATCHLISTWIDGET_H 57 | -------------------------------------------------------------------------------- /src/Mainwindow/multipeakwidget.h: -------------------------------------------------------------------------------- 1 | #ifndef MULTIPEAKWIDGET_H 2 | #define MULTIPEAKWIDGET_H 3 | 4 | #include 5 | #include "Core/fileTablebase.h" 6 | #include 7 | 8 | typedef struct _tagGeneLetter 9 | { 10 | char type; 11 | char oldtype; 12 | int qual; 13 | int a_signal; 14 | int t_signal; 15 | int g_signal; 16 | int c_signal; 17 | QPoint pos; 18 | }GeneLetter; 19 | 20 | class PeakLine 21 | { 22 | public: 23 | PeakLine(long size); 24 | ~PeakLine(); 25 | int getSize(); 26 | void SetBasePoint(char type, double x, double y); 27 | QPolygonF& GetBasePoint(char type); 28 | void AddGeneLetter(GeneLetter &geneletter); 29 | QVector& GetGeneLetter(); 30 | 31 | void SetFileName(QString &str); 32 | QString& GetFileName(); 33 | 34 | void SetAlignPos(int start, int end); 35 | void GetAlignPos(int start, int end); 36 | void GetExonPos(int &start, int &end); 37 | void SetExcludePos(int left, int right); 38 | void GetExcludePos(int &left, int &right); 39 | 40 | void SetOffset(int offset); 41 | int GetOffset(); 42 | 43 | void SetGssp(bool isGssp); 44 | bool GetGssp(); 45 | 46 | void setAvgWidth(float width); 47 | float getAvgWidth(); 48 | 49 | void setAvgSignal(float signal); 50 | float getAvgSignal(); 51 | 52 | void setPeakYSetp(int y); 53 | int getPeakYStep(); 54 | 55 | void setPeakHeight(int height); 56 | int getPeakHeight(); 57 | 58 | void setXLeft(int x); 59 | int getXLeft(); 60 | 61 | void setXAlignStart(int pos); 62 | int getXAlignStart(); 63 | private: 64 | bool m_bGssp; 65 | int m_left_exclude; 66 | int m_right_exclude; 67 | int m_iAlignStart; 68 | int m_iAlignEnd; 69 | 70 | int m_y_step; //y轴间距 71 | int m_iPeakHeight; //峰图实际高度 72 | 73 | int m_x_left; //保存左边距离exon的长度 74 | 75 | long m_lsize; 76 | long m_loffset; 77 | float m_f_avgwidth; 78 | float m_f_avgsignal; 79 | QString m_strFileName; 80 | QPolygonF m_vec_baseA; 81 | QPolygonF m_vec_baseT; 82 | QPolygonF m_vec_baseG; 83 | QPolygonF m_vec_baseC; 84 | QVector m_vec_GeneLetter; 85 | //QVector m_vec_del; 86 | int m_x_AlignStart; //左对齐的坐标 87 | }; 88 | 89 | 90 | 91 | class MultiPeakWidget:public QWidget 92 | { 93 | Q_OBJECT 94 | 95 | public: 96 | MultiPeakWidget(QWidget *parent = nullptr); 97 | ~MultiPeakWidget(); 98 | void SetPeakData(const QString &str_samplename, int index, const QString &str_file); 99 | void SetSelectPos(int exon_pos,int x=0);//exon_pos 导航条外显子下标(起点为1) 100 | void AdjustPeakHeight(int height); 101 | void AdjustPeakY(int y); 102 | void AdjustPeakX(int x); 103 | void RestorePeak(); 104 | void SetRefresh(bool refresh){m_bRefresh = refresh;} 105 | void ClearMultiPeak(); 106 | private: 107 | void CreateRightMenu(); 108 | void ConnectSignalandSlot(); 109 | void paintEvent(QPaintEvent *event); 110 | void DrawPeakLines(QPainter *pter); 111 | void DrawHLines(QPainter *pter); 112 | void DrawPeakHead(QPainter *pter); 113 | void DrawBasePosition(QPainter *pter); 114 | void DrawSelectFrame(QPainter *pter); 115 | void DrawExcludeArea(QPainter *pter); 116 | void GetBaseColor(QPainter *pter, const QChar &base); 117 | void contextMenuEvent(QContextMenuEvent *event); 118 | void mousePressEvent(QMouseEvent *event); 119 | void keyPressEvent(QKeyEvent *event); 120 | void SetPeakLineData(); 121 | void CalcPeakLineData(int exon_pos); //exon_pos 导航条外显子下标 122 | void ExcludeArea(int type); //type:1代表左排除,2代表右排除,3代表恢复 123 | void loadFontFromFile(); 124 | public slots: 125 | void slotApplyOne(); 126 | void slotApplyAll(); 127 | void slotAnalyseLater(); 128 | void slotAnalyseNow(); 129 | void slotActanalyze(); 130 | void slotInsertBaseN(); 131 | void slotMeargeBase(); 132 | void slotRemoveBase(); 133 | private slots: 134 | void slotDelteThisFile(); 135 | void slotActApplyOne(); 136 | void slotActApplyAll(); 137 | void slotActanalyzeLater(); 138 | void slotActanalyzeNow(); 139 | void slotHighLightLeftPart(); 140 | void slotHighLightRightPart(); 141 | void slotResetExclude(); 142 | void slotActInsertBaseN(); 143 | void slotActMeargeBase(); 144 | void slotActRemoveBase(); 145 | int searchCap(int m_index_Select); 146 | 147 | signals: 148 | //index:当前导航条index colnum:选中的位置和left_exclude的差值 149 | void signalPeakFocusPosition(int index, int colnum, QPoint &pos); 150 | void signalChangeDB(const QString &str_samplename); 151 | // void signalActApplyOne(); 152 | // void signalActApplyAll(); 153 | // void signalActanalyzeLater(); 154 | void signalPeakAct(int type); 155 | void signalSendStatusBarMsg(QString &msg); 156 | void signalChangeDBByFile(QVector &vec_samplename); 157 | void SignalChangePeak(QString &str_file); 158 | private: 159 | QVector m_vec_filetable; 160 | bool m_bRefresh; 161 | bool m_bApplyOne; //true调整单个峰图,false调整所有峰图 162 | bool m_bEditOne; //true单个编辑后立即分析,false多个编辑后分析 163 | int m_x_step; //x轴间距 164 | QPoint m_select_pos; //选中碱基的位置 165 | bool m_bIsSelect; //是否选中了一个碱基 166 | int m_index_Select; //选中碱基的下标 167 | int m_index_PeakLine; //当前选中的峰图下标 168 | long m_l_xSize; //x轴的长度 169 | int m_iPeakHeightTotal; //所有峰图的高度之和 170 | QString m_str_SampleName;//样品名称 171 | int m_index_Exon; //碱基index 172 | int m_maxleft; //记录左边界最大值 173 | int m_start_exon; 174 | int m_end_exon; 175 | int m_x_index; //记录以startexon为起点 176 | QVector> m_vec_Peakline; 177 | QString m_str_fontName; 178 | QMenu *m_pRightMenu; 179 | QAction *m_pActDelete; 180 | QAction *m_pActInsertBaseN; 181 | QAction *m_pActRemoveBase; 182 | QAction *m_pActMeargeBase; 183 | QAction *m_pActApplyOne; 184 | QAction *m_pActApplyAll; 185 | QAction *m_pActanalyzeLater; 186 | QAction *m_pActanalyzeNow; 187 | QAction *m_pActanalyze; 188 | QAction *m_pActExcludeLeft; 189 | QAction *m_pActExcludeRight; 190 | QAction *m_pActResetExclude; 191 | }; 192 | 193 | #endif // MULTIPEAKWIDGET_H 194 | -------------------------------------------------------------------------------- /src/Mainwindow/sampletreewidget.h: -------------------------------------------------------------------------------- 1 | #ifndef SAMPLETREEWIDGET_H 2 | #define SAMPLETREEWIDGET_H 3 | 4 | #include 5 | #include 6 | #include "all_base_struct.h" 7 | 8 | class SampleTreeWidget:public QTreeWidget 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | SampleTreeWidget(QWidget *parent = 0); 14 | ~SampleTreeWidget(); 15 | void SetTreeData(); 16 | void SetSelectItem(int index, const QString &str_sample); 17 | void SetSelectItemByName(const QString &str_sample, const QString &str_file); 18 | void RefreshSelectSample(const QString &str_sample); 19 | private: 20 | void InitUI(); 21 | void CreateRightMenu(); 22 | void ConnectSignalandSlot(); 23 | void markSampleType(int markType); 24 | void markSampleTypeAndClear(int markType); 25 | void contextMenuEvent(QContextMenuEvent *event); 26 | 27 | signals: 28 | void signalChangeDBByFile(QVector &vec_samplename); 29 | void signalClearAll(); 30 | private slots: 31 | void slotQuickSaveAndClear(); 32 | void slotQuickSave(); 33 | void slotSaveByDate(); 34 | void slotDelete(); 35 | 36 | void slotUserComments(); 37 | void slotDeleteSelectedItem(); 38 | void slotCopyName(); 39 | 40 | void slotMarkPendingReview(); 41 | void slotMarkReviewed(); 42 | void slotMarkApproved(); 43 | void slotUnlock(); 44 | 45 | void slotMarkPendingAndClear(); 46 | void slotMarkReviewedAndClear(); 47 | void slotMarkApprovedAndClear(); 48 | private: 49 | QMap m_map_SampleTreeInfo; 50 | QMenu *m_pRightMenu; 51 | QAction *m_pActSaveAndClear; 52 | QAction *m_pActQuickSave; 53 | QAction *m_pActSaveByDate; 54 | QAction *m_pActDelete; 55 | QAction *m_pActUserComments; 56 | QAction *m_pActDelSelItem; 57 | QAction *m_pActMarkPendingReview; 58 | QAction *m_pActMarkReviewed; 59 | QAction *m_pActMarkApproved; 60 | QAction *m_pActUnlock; 61 | QAction *m_pActMarkPendingAndClear; 62 | QAction *m_pActMarkReviewedAndClear; 63 | QAction *m_pActMarkApprovedAndClear; 64 | QAction *m_pActCopy; 65 | QTreeWidgetItem *m_pSelByRightItem; //右键选中的item 66 | }; 67 | 68 | #endif // SAMPLETREEWIDGET_H 69 | -------------------------------------------------------------------------------- /src/SoapTyping.rc: -------------------------------------------------------------------------------- 1 | IDI_ICON1 ICON DISCARDABLE "logo.ico" -------------------------------------------------------------------------------- /src/ThreadTask/analysisab1threadtask.cpp: -------------------------------------------------------------------------------- 1 | #include "analysisab1threadtask.h" 2 | #include 3 | #include 4 | #include "Core/Ab1.h" 5 | #include "Core/core.h" 6 | #include "all_base_struct.h" 7 | #include "DataBase/soaptypingdb.h" 8 | 9 | AnalysisAB1ThreadTask::AnalysisAB1ThreadTask(Ab1FileTableBase *pfiletable):m_pFiletable(pfiletable) 10 | { 11 | 12 | } 13 | 14 | AnalysisAB1ThreadTask::~AnalysisAB1ThreadTask() 15 | { 16 | if(m_pFiletable) 17 | { 18 | delete m_pFiletable; 19 | m_pFiletable = nullptr; 20 | } 21 | } 22 | 23 | void AnalysisAB1ThreadTask::run() 24 | { 25 | Ab1 ab1(m_pFiletable->getFilePath()); 26 | if(!ab1.IsAb1File()) 27 | { 28 | return; 29 | } 30 | if(!ab1.AnalysisFile()) 31 | { 32 | return; 33 | } 34 | ab1.getFWO(); 35 | 36 | int i_basenum = ab1.getNumBase(); 37 | m_pFiletable->setBaseNumber(i_basenum); 38 | int i_signalnum = ab1.getNumTraceData(); 39 | m_pFiletable->setSignalNumber(i_signalnum); 40 | float f_basewidth = ab1.getBaseSpace(); 41 | m_pFiletable->setAverageBaseWidth(f_basewidth); 42 | bool b_isgood = ab1.isAb1Good(); 43 | m_pFiletable->setIsGood(b_isgood); 44 | 45 | int i_base_pos_offset = ab1.getBasePosOffset(); 46 | int i_base_offset = ab1.getBaseOffset(); 47 | int i_qual_offset = ab1.getQualOffset(); 48 | 49 | char *orignal_seq = (char*)malloc(sizeof(char)*i_basenum+1); 50 | int *quality = (int*)malloc(sizeof(int)*i_basenum); 51 | int *base_positions = (int*)malloc(sizeof(int)*i_basenum); 52 | Baseo* base = (Baseo*)malloc(sizeof(Baseo)*i_basenum); 53 | Baseo* baseG = (Baseo*)malloc(sizeof(Baseo)*i_signalnum); 54 | Baseo* baseA = (Baseo*)malloc(sizeof(Baseo)*i_signalnum); 55 | Baseo* baseT = (Baseo*)malloc(sizeof(Baseo)*i_signalnum); 56 | Baseo* baseC = (Baseo*)malloc(sizeof(Baseo)*i_signalnum); 57 | 58 | ab1.getBaseSeq(i_base_offset, i_basenum, orignal_seq); 59 | int i_maxQuality = 0; 60 | ab1.getBaseQual(i_qual_offset, i_basenum, quality, i_maxQuality); 61 | m_pFiletable->setMaxQuality(i_maxQuality); 62 | ab1.getBasePosition(i_base_pos_offset, i_basenum, base_positions); 63 | 64 | long l_trace_offsets[4] = {0}; 65 | ab1.getTraceDataOffset(l_trace_offsets); 66 | int i_maxSignal = 0; 67 | ab1.getTraceData(baseG, baseA, baseT, baseC, l_trace_offsets, i_signalnum, i_maxSignal); 68 | m_pFiletable->setMaxSignal(i_maxSignal); 69 | ab1.getBaseData(base, i_basenum, quality, orignal_seq, base_positions, baseG, baseA, baseT, baseC); 70 | if(!m_pFiletable->getIsGssp()) 71 | { 72 | ab1.getPeak(baseG, baseA, baseT, baseC, base, base_positions, i_basenum); 73 | float avgsignal =ab1.signalRatio(baseG, baseA, baseT, baseC, base, base_positions, i_basenum); 74 | m_pFiletable->setAvgsignal(avgsignal); 75 | } 76 | 77 | QChar c_ROrF = m_pFiletable->getROrF(); 78 | if (c_ROrF == 'R') 79 | { 80 | base = ab1.reverseComplement(base, i_basenum, i_signalnum, 1); 81 | baseG = ab1.reverseComplement(baseG, i_basenum, i_signalnum, 0); 82 | baseA = ab1.reverseComplement(baseA, i_basenum, i_signalnum, 0); 83 | baseT = ab1.reverseComplement(baseT, i_basenum, i_signalnum, 0); 84 | baseC = ab1.reverseComplement(baseC, i_basenum, i_signalnum, 0); 85 | } 86 | 87 | QStringList basePostion_t, baseQuality_t; 88 | for (int i = 0; i < i_basenum; i++) 89 | { 90 | basePostion_t << QString::number(base[i].pos); 91 | baseQuality_t << QString::number(quality[i]); 92 | } 93 | m_pFiletable->setBasePostion(basePostion_t.join(":")); 94 | m_pFiletable->setBaseQuality(baseQuality_t.join(":")); 95 | 96 | 97 | QStringList baseASignal_t, baseGSignal_t, baseTSignal_t, baseCSignal_t; 98 | 99 | if(c_ROrF == 'F') 100 | { 101 | for (int i = 0; i < i_signalnum; i++) 102 | { 103 | baseGSignal_t << QString::number(baseG[i].signal); 104 | baseASignal_t << QString::number(baseA[i].signal); 105 | baseTSignal_t << QString::number(baseT[i].signal); 106 | baseCSignal_t << QString::number(baseC[i].signal); 107 | } 108 | } 109 | else 110 | { 111 | for (int i = 0; i < i_signalnum; i++) 112 | { 113 | baseCSignal_t << QString::number(baseG[i].signal); 114 | baseTSignal_t << QString::number(baseA[i].signal); 115 | baseASignal_t << QString::number(baseT[i].signal); 116 | baseGSignal_t << QString::number(baseC[i].signal); 117 | } 118 | } 119 | 120 | m_pFiletable->setBaseGSignal(baseGSignal_t.join(":")); 121 | m_pFiletable->setBaseASignal(baseASignal_t.join(":")); 122 | m_pFiletable->setBaseTSignal(baseTSignal_t.join(":")); 123 | m_pFiletable->setBaseCSignal(baseCSignal_t.join(":")); 124 | 125 | QByteArray tmpbuf; 126 | for (int i = 0; i < i_basenum; i++) 127 | { 128 | tmpbuf.append(base[i].basetype); 129 | } 130 | m_pFiletable->setBaseSequence(tmpbuf); 131 | 132 | ExonInfoS exonInfos; 133 | SoapTypingDB::GetInstance()->GetExonInfo(m_pFiletable->getGeneName(), m_pFiletable->getExonIndex(), exonInfos); 134 | m_pFiletable->setExonStartPos(exonInfos.exonStartPos); 135 | m_pFiletable->setExonEndPos(exonInfos.exonEndPos); 136 | 137 | 138 | FileAlignNew file_align_new; 139 | file_align_new.consensus = exonInfos.consensusSeq.data();//从数据库表GeneTable获取的一段序列,起始位置是exonStartPos和exonEndPos 140 | file_align_new.raw_seq = m_pFiletable->getBaseSequence().data();//从文件获取的经过计算的原始序列(getBaseData()) 141 | file_align_new.consensus_start = exonInfos.exonStartPos; 142 | file_align_new.consensus_end = exonInfos.exonEndPos; 143 | file_align_new.exclude_left_num =0; 144 | file_align_new.exclude_right_num =0; 145 | 146 | if(!m_pFiletable->getIsGssp()) 147 | { 148 | QStringList pathlist = m_pFiletable->getFilePath().split("_"); 149 | if(pathlist[2] == "S117") 150 | { 151 | size_t len = strlen(file_align_new.raw_seq); 152 | file_align_new.exclude_right_num =abs((int)len - 270); 153 | } 154 | } 155 | 156 | 157 | FileAlignResult fileAlignResult; 158 | if(i_basenum >= 20) // 一些ab1文件里面碱基序列为空或很短 159 | { 160 | Core::GetInstance()->GetFileAlignResult(file_align_new, fileAlignResult, true); 161 | m_pFiletable->setUsefulSequence(fileAlignResult.sampleAlign);//保存的是consensus和raw_seq的最大公共子序列 162 | if(fileAlignResult.isUnDefined) 163 | { 164 | qDebug()<getFilePath()<<"isUnDefined"; 165 | } 166 | if(!m_pFiletable->getIsGssp()) 167 | { 168 | m_pFiletable->setAlignResult(fileAlignResult.isUnDefined); 169 | } 170 | else 171 | { 172 | if(fileAlignResult.isUnDefined) 173 | { 174 | m_pFiletable->setAlignResult(4); 175 | } 176 | else 177 | { 178 | m_pFiletable->setAlignResult(0); 179 | } 180 | } 181 | } 182 | else 183 | { 184 | if(!m_pFiletable->getIsGssp()) 185 | { 186 | m_pFiletable->setAlignResult(1); 187 | } 188 | else 189 | { 190 | m_pFiletable->setAlignResult(4); 191 | } 192 | } 193 | 194 | QStringList alignInfo_t; 195 | int i_ret = m_pFiletable->getAlignResult(); 196 | if(i_ret >0) 197 | { 198 | m_pFiletable->setAlignStartPos(i_basenum-1); 199 | m_pFiletable->setAlignEndPos(i_basenum-1); 200 | 201 | for (int i = 0; i < i_basenum; i++) 202 | { 203 | alignInfo_t << QString::number(-1); 204 | } 205 | } 206 | else 207 | { 208 | m_pFiletable->setAlignStartPos(fileAlignResult.leftLimit); 209 | m_pFiletable->setAlignEndPos(fileAlignResult.rightLimit); 210 | 211 | for (int i = 0; i < i_basenum; i++) 212 | { 213 | alignInfo_t << QString::number(fileAlignResult.baseMatchConsensusPos[i]); 214 | } 215 | 216 | if(!m_pFiletable->getIsGssp()) 217 | { 218 | QString str_query = QString("%1_%2_%3").arg(m_pFiletable->getGeneName()) 219 | .arg(m_pFiletable->getExonIndex()) 220 | .arg(m_pFiletable->getROrF()); 221 | int leftpos = 0,rightpos = 0; 222 | SoapTypingDB::GetInstance()->GetExcludePosition(str_query, leftpos, rightpos); 223 | m_pFiletable->setExcludeLeft(leftpos); //存放的是左排除的个数 224 | m_pFiletable->setExcludeRight(rightpos);//存放的是右排除的个数 225 | } 226 | } 227 | 228 | m_pFiletable->setAlignInfo(alignInfo_t.join(":")); 229 | if(!m_pFiletable->getIsGssp()) 230 | { 231 | SoapTypingDB::GetInstance()->InsertOneFileTable(*m_pFiletable); 232 | } 233 | else 234 | { 235 | SoapTypingDB::GetInstance()->insertOneGsspFileTable(*m_pFiletable); 236 | } 237 | 238 | free(orignal_seq); 239 | free(quality); 240 | free(base_positions); 241 | free(base); 242 | free(baseG); 243 | free(baseA); 244 | free(baseT); 245 | free(baseC); 246 | emit analysisfinished(); 247 | } 248 | -------------------------------------------------------------------------------- /src/ThreadTask/analysisab1threadtask.h: -------------------------------------------------------------------------------- 1 | #ifndef ANALYSISAB1THREADTASK_H 2 | #define ANALYSISAB1THREADTASK_H 3 | 4 | #include 5 | #include 6 | #include "Core/fileTablebase.h" 7 | 8 | class AnalysisAB1ThreadTask:public QObject,public QRunnable 9 | { 10 | Q_OBJECT 11 | public: 12 | AnalysisAB1ThreadTask(Ab1FileTableBase *pfiletable); 13 | ~AnalysisAB1ThreadTask(); 14 | virtual void run(); 15 | signals: 16 | void analysisfinished(); 17 | private: 18 | Ab1FileTableBase *m_pFiletable; 19 | }; 20 | 21 | #endif // ANALYSISTHREADTASK_H 22 | -------------------------------------------------------------------------------- /src/ThreadTask/analysissamplethreadtask.h: -------------------------------------------------------------------------------- 1 | #ifndef ANALYSISSAMPLETHREADTASK_H 2 | #define ANALYSISSAMPLETHREADTASK_H 3 | 4 | #include 5 | #include 6 | #include "all_base_struct.h" 7 | 8 | class AnalysisSampleThreadTask:public QObject,public QRunnable 9 | { 10 | Q_OBJECT 11 | public: 12 | AnalysisSampleThreadTask(const QString &str_sample); 13 | ~AnalysisSampleThreadTask(); 14 | virtual void run(); 15 | // void analysisSample(SampleInfo &sampleInfo, ExonInfo &exonInfo, 16 | // QVector& fileInfos, QVector& gsspFileInfos); 17 | signals: 18 | void analysisfinished(); 19 | private: 20 | int comparePatternWithAllele(char *patternSeq, char *consensusSeq, const QString &geneName, 21 | int exonStartPos, int minExonIndex, int maxExonIndex, 22 | QVector &typeResult, QSet &sheildAlleles); 23 | int compareGsspWithAlleles(const QByteArray &gsspName, const char *gsspSequence, const QString &geneName, 24 | int exonStartPos, QString &typeResult, QSet &zeroResult); 25 | void analysisSample(SampleInfo &sampleInfo, ExonInfo &exonInfo, 26 | QVector& fileInfos, QVector& gsspFileInfos); 27 | private: 28 | QString m_sample; 29 | }; 30 | 31 | #endif // ANALYSISSAMPLETHREADTASK_H 32 | -------------------------------------------------------------------------------- /src/ThreadTask/fileprocessthreadtask.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/ThreadTask/fileprocessthreadtask.cpp -------------------------------------------------------------------------------- /src/ThreadTask/fileprocessthreadtask.h: -------------------------------------------------------------------------------- 1 | #ifndef FILEPROCESSTHREADTASK_H 2 | #define FILEPROCESSTHREADTASK_H 3 | 4 | #include 5 | #include 6 | #include "all_base_struct.h" 7 | 8 | class fileprocessthreadtask:public QObject,public QRunnable 9 | { 10 | Q_OBJECT 11 | public: 12 | fileprocessthreadtask(const QStringList &filePathList); 13 | ~fileprocessthreadtask(); 14 | virtual void run(); 15 | void getFileInfoData(); 16 | signals: 17 | void processone(const OpenFileTable &info); 18 | private: 19 | void FilePathProcess(const QString &filePath, OpenFileTable &info); 20 | private: 21 | QStringList m_strlist; 22 | QMap m_map_ExonAndRF; 23 | QMap m_map_CommonGssp; 24 | }; 25 | 26 | #endif // FILEPROCESSTHREADTASK_H 27 | -------------------------------------------------------------------------------- /src/all_base_struct.h: -------------------------------------------------------------------------------- 1 | #ifndef ALL_BASE_STRUCT_H 2 | #define ALL_BASE_STRUCT_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | enum MarkType 11 | { 12 | OWNED = 0, 13 | PENDING, 14 | REVIEWED, 15 | APPROVED 16 | }; 17 | enum AnalysisType 18 | { 19 | MATCHTOTAL = 0, 20 | MATCHRARE, 21 | MATCHBAD, 22 | MISMATCH, 23 | UNMATCH 24 | }; 25 | 26 | struct ExonAndRF 27 | { 28 | QString exonIndex; //外显子序号 29 | QString rOrF; //正序or反序 30 | }; 31 | 32 | struct ExonInfoS 33 | { 34 | int exonStartPos; //外显子开始位置 35 | int exonEndPos; //外显子结束位置 36 | QByteArray consensusSeq; //一致性序列 37 | }; 38 | 39 | struct ExonInfo 40 | { 41 | int minExonIndex; 42 | int maxExonIndex; 43 | int exonStartPosition; 44 | int exonEndPostion; 45 | ExonInfo() 46 | { 47 | minExonIndex = 100; 48 | maxExonIndex = 0; 49 | exonStartPosition = 2000; 50 | exonEndPostion = -1; 51 | } 52 | }; 53 | 54 | typedef struct 55 | { 56 | int leftLimit; //原始序列匹配的起始位置(等同于left_cut) 57 | int rightLimit; //原始序列匹配的结束位置(等同于原始序列总长度-right_cut) 58 | int *baseMatchConsensusPos; //原始序列长度的数组,从leftLimit到rightLimit保存匹配一致序列的位置(从数据库查询的裁剪起始位置) 59 | char *sampleAlign;//对数组sample_alignment进行处理,如果是.替换成-,然后依次复制到sampleAlign数组 60 | int isUnDefined; 61 | } FileAlignResult; 62 | 63 | typedef struct 64 | { 65 | int exclude_left_num; //左边剔除的个数 66 | int exclude_right_num; //右边剔除的个数 67 | int consensus_start; //从数据库查询的,裁剪起始位置 68 | int consensus_end; //从数据库查询的,裁剪结束位置 69 | char *consensus; //从数据库查询的,经过裁剪的一致性序列 70 | char *raw_seq; //从ab文件获取的原始序列 71 | } FileAlignNew; 72 | 73 | typedef struct 74 | { 75 | bool is_match; //是否匹配 76 | int left_cut; //左边剔除的个数 77 | int right_cut; //右边剔除的个数 78 | QByteArray consensus_alignment; //从数据库查询的,经过裁剪的一致性序列 79 | QByteArray sample_alignment; //从ab文件获取的原始序列,经过最长公共字符序列匹配,以及边界优化得到的序列 80 | }FileAlignResultNew; 81 | 82 | typedef struct 83 | { 84 | char *r1; 85 | char *r2; 86 | int errors; 87 | int start1; 88 | int start2; 89 | int stop1; 90 | int stop2; 91 | 92 | void clear() 93 | { 94 | if(r1!=NULL) 95 | { 96 | free(r1); 97 | r1=NULL; 98 | } 99 | if(r2!=NULL) 100 | { 101 | free(r2); 102 | r2=NULL; 103 | } 104 | errors = 0; 105 | start1 = 0; 106 | start2 = 0; 107 | stop1 = 0; 108 | stop2 = 0; 109 | } 110 | } align; 111 | 112 | struct FileInfo 113 | { 114 | int exonStartPos; 115 | int exonEndPos; 116 | int isGood; 117 | int isUnMatch; 118 | QByteArray fileName; 119 | QByteArray geneName; 120 | QByteArray rOrF; 121 | QByteArray gsspName; 122 | QByteArray sequence; 123 | QSet editPostion; 124 | }; 125 | 126 | struct SampleInfo 127 | { 128 | QString sampleName; 129 | QString geneName; 130 | int analysisType; 131 | int minExonIndex; 132 | int maxExonIndex; 133 | int exonStartPos; 134 | int exonEndPos; 135 | QByteArray consensusSequence; 136 | QByteArray forwardSequence; 137 | QByteArray reverseSequence; 138 | QByteArray patternSequence; 139 | QString mismatchBetweenPC; 140 | QString mismatchBetweenFR; 141 | QString mmismatchBetweenFR; 142 | QString editPostion; 143 | QString typeResult; 144 | QString combinedResult; 145 | }; 146 | 147 | struct AlleleInfo 148 | { 149 | QString alleleName; 150 | QByteArray alleleSequence; 151 | QString isRare; 152 | int isIndel; 153 | QString starInfo; 154 | }; 155 | 156 | struct PairStartEnd 157 | { 158 | int startIndex; 159 | int endIndex; 160 | }; 161 | 162 | struct GsspAlleleInfo 163 | { 164 | QString alleleName; 165 | QByteArray alleleSequence; 166 | }; 167 | 168 | typedef struct FileTreeInfo 169 | { 170 | bool isGssp; 171 | int isGood; 172 | int analysisType; 173 | int exonIndex; 174 | QString rOrF; 175 | QString gsspName; 176 | QString fileName; 177 | FileTreeInfo() 178 | { 179 | isGssp = false; 180 | isGood = 0; 181 | analysisType = 0; 182 | exonIndex = 0; 183 | rOrF = ""; 184 | gsspName = ""; 185 | fileName = ""; 186 | } 187 | }FileTreeInfo_t; 188 | 189 | struct SampleTreeInfo_t 190 | { 191 | int analysisType; 192 | int markType; 193 | QString sampleName; 194 | QString geneName; 195 | QVector treeinfo; 196 | }; 197 | 198 | struct ExonNavigatorInfo 199 | { 200 | int minExonIndex; 201 | int maxExonIndex; 202 | QVector vec_pcMis;//样品简并序列和一致性序列不兼容 203 | QVector vec_frMis; //正反序列不兼容 204 | QVector vec_frUnEqual; //正反序列兼容但不同 205 | QVector vec_editPos;//编辑过的碱基 206 | }; 207 | 208 | struct BaseAlignGsspInfo 209 | { 210 | int gsspFileAlignStartPos; 211 | QString gsspName; 212 | int gsspPostion; 213 | QString gsspSeq; 214 | QString gsspFileSeq; 215 | }; 216 | 217 | struct BaseAlignSampleInfo 218 | { 219 | int alignStartPos; 220 | int alignEndPos; 221 | QString consensusSeq; 222 | QString forwardSeq; 223 | QString reverseSeq; 224 | QString patternSeq; 225 | QSet pcMisMatchPostion; 226 | QSet frMisMatchPostion; 227 | QSet editPostion; 228 | QMap gsspInfoMap; 229 | void clear() 230 | { 231 | alignStartPos = 0; 232 | alignEndPos = 0; 233 | consensusSeq.resize(0); 234 | forwardSeq.resize(0); 235 | reverseSeq.resize(0); 236 | patternSeq.resize(0); 237 | pcMisMatchPostion.clear(); 238 | frMisMatchPostion.clear(); 239 | editPostion.clear(); 240 | gsspInfoMap.clear(); 241 | } 242 | }; 243 | 244 | struct IndelInfo 245 | { 246 | int isIndel; 247 | int indelPostion; 248 | QString indelInfo; 249 | }; 250 | 251 | struct AllelePair 252 | { 253 | QString allele1; 254 | QString allele2; 255 | }; 256 | 257 | struct GsspTable 258 | { 259 | QString gsspKey; 260 | QString gsspName; 261 | QString geneName; 262 | int exonIndex; 263 | QString rOrF; 264 | int position; 265 | QByteArray base; 266 | }; 267 | 268 | struct ExonTrimTable 269 | { 270 | QString etKey; 271 | QString geneName; 272 | QString exonIndex; 273 | QString fOrR; 274 | QString exonStart; 275 | QString exonEnd; 276 | QString excludeLeft; 277 | QString excludeRight; 278 | }; 279 | 280 | struct GeneTable 281 | { 282 | QString geneName; 283 | QString geneSequence; 284 | int exonCount; 285 | QString exonPostionIndex; 286 | QString geneClasses; 287 | QString availableExon; 288 | QString version; 289 | }; 290 | 291 | struct AlleleTable 292 | { 293 | QString alleleName; 294 | QString alleleSequence; 295 | QString geneName; 296 | int isRare; 297 | int isIndel; 298 | int classesNumber; 299 | int indelPosition; 300 | QString indelInfo; 301 | QString noStar; 302 | }; 303 | 304 | struct LabAlignTable 305 | { 306 | QString alleleName; 307 | QString alleleSequence; 308 | QString geneName; 309 | QString misPosition; 310 | }; 311 | 312 | struct CommonGsspTable 313 | { 314 | QString gsspName; 315 | QString geneName; 316 | QString exonIndex; 317 | QString fOrR; 318 | }; 319 | 320 | 321 | typedef struct _tagOpenFileTable 322 | { 323 | bool right; 324 | QString sampleName; 325 | QString geneName; 326 | QString gsspName; 327 | QString fileName; 328 | QString exonIndex; 329 | QString rOrF; 330 | QString filePath; 331 | }OpenFileTable; 332 | Q_DECLARE_METATYPE(OpenFileTable); 333 | 334 | 335 | #endif // ALL_BASE_STRUCT_H 336 | 337 | -------------------------------------------------------------------------------- /src/font/msyh.ttc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/font/msyh.ttc -------------------------------------------------------------------------------- /src/hla.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | images/about.png 4 | images/alignlab.png 5 | images/alignpair.png 6 | images/apply.png 7 | images/backward.png 8 | images/branch-end.png 9 | images/branch-more.png 10 | images/control.png 11 | images/deleteall.png 12 | images/filetree00.png 13 | images/filetree01.png 14 | images/filetree02.png 15 | images/filetree03.png 16 | images/filetree04.png 17 | images/filetree10.png 18 | images/filetree11.png 19 | images/filetree12.png 20 | images/filetree13.png 21 | images/filetree14.png 22 | images/filetree20.png 23 | images/filetree21.png 24 | images/filetree22.png 25 | images/filetree23.png 26 | images/filetree24.png 27 | images/filetree30.png 28 | images/filetree31.png 29 | images/filetree32.png 30 | images/filetree33.png 31 | images/filetree34.png 32 | images/filetreeFile0.png 33 | images/filetreeFile1.png 34 | images/filetreeFile2.png 35 | images/forward.png 36 | images/logo.png 37 | images/logo1.png 38 | images/markfinishedall.png 39 | images/marksuccessfulall.png 40 | images/minus.png 41 | images/opennewfile.png 42 | images/openoldfile.png 43 | images/plus.png 44 | images/putdown-.png 45 | images/putdown-bg.png 46 | images/putleft-.png 47 | images/putleft-bg.png 48 | images/putright-.png 49 | images/putright-bg.png 50 | images/putup-.png 51 | images/putup-bg.png 52 | images/report.png 53 | images/reset.png 54 | images/saveall.png 55 | images/updatedatabase.png 56 | images/vline.png 57 | images/zoomreset.png 58 | images/zoomxincrease.png 59 | images/zoomxreduce.png 60 | images/zoomyaxisincrease.png 61 | images/zoomyaxisreduce.png 62 | images/zoomyincrease.png 63 | images/zoomyreduce.png 64 | 65 | 66 | qss/qss 67 | 68 | 69 | -------------------------------------------------------------------------------- /src/images/about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/about.png -------------------------------------------------------------------------------- /src/images/alignlab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/alignlab.png -------------------------------------------------------------------------------- /src/images/alignpair.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/alignpair.png -------------------------------------------------------------------------------- /src/images/apply.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/apply.png -------------------------------------------------------------------------------- /src/images/backward.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/backward.png -------------------------------------------------------------------------------- /src/images/branch-end.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/branch-end.png -------------------------------------------------------------------------------- /src/images/branch-more.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/branch-more.png -------------------------------------------------------------------------------- /src/images/control.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/control.png -------------------------------------------------------------------------------- /src/images/deleteall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/deleteall.png -------------------------------------------------------------------------------- /src/images/filetree00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/filetree00.png -------------------------------------------------------------------------------- /src/images/filetree01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/filetree01.png -------------------------------------------------------------------------------- /src/images/filetree02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/filetree02.png -------------------------------------------------------------------------------- /src/images/filetree03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/filetree03.png -------------------------------------------------------------------------------- /src/images/filetree04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/filetree04.png -------------------------------------------------------------------------------- /src/images/filetree10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/filetree10.png -------------------------------------------------------------------------------- /src/images/filetree11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/filetree11.png -------------------------------------------------------------------------------- /src/images/filetree12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/filetree12.png -------------------------------------------------------------------------------- /src/images/filetree13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/filetree13.png -------------------------------------------------------------------------------- /src/images/filetree14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/filetree14.png -------------------------------------------------------------------------------- /src/images/filetree20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/filetree20.png -------------------------------------------------------------------------------- /src/images/filetree21.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/filetree21.png -------------------------------------------------------------------------------- /src/images/filetree22.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/filetree22.png -------------------------------------------------------------------------------- /src/images/filetree23.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/filetree23.png -------------------------------------------------------------------------------- /src/images/filetree24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/filetree24.png -------------------------------------------------------------------------------- /src/images/filetree30.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/filetree30.png -------------------------------------------------------------------------------- /src/images/filetree31.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/filetree31.png -------------------------------------------------------------------------------- /src/images/filetree32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/filetree32.png -------------------------------------------------------------------------------- /src/images/filetree33.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/filetree33.png -------------------------------------------------------------------------------- /src/images/filetree34.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/filetree34.png -------------------------------------------------------------------------------- /src/images/filetreeFile0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/filetreeFile0.png -------------------------------------------------------------------------------- /src/images/filetreeFile1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/filetreeFile1.png -------------------------------------------------------------------------------- /src/images/filetreeFile2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/filetreeFile2.png -------------------------------------------------------------------------------- /src/images/forward.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/forward.png -------------------------------------------------------------------------------- /src/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/logo.png -------------------------------------------------------------------------------- /src/images/logo1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/logo1.png -------------------------------------------------------------------------------- /src/images/markfinishedall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/markfinishedall.png -------------------------------------------------------------------------------- /src/images/marksuccessfulall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/marksuccessfulall.png -------------------------------------------------------------------------------- /src/images/minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/minus.png -------------------------------------------------------------------------------- /src/images/opennewfile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/opennewfile.png -------------------------------------------------------------------------------- /src/images/openoldfile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/openoldfile.png -------------------------------------------------------------------------------- /src/images/plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/plus.png -------------------------------------------------------------------------------- /src/images/putdown-.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/putdown-.png -------------------------------------------------------------------------------- /src/images/putdown-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/putdown-bg.png -------------------------------------------------------------------------------- /src/images/putleft-.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/putleft-.png -------------------------------------------------------------------------------- /src/images/putleft-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/putleft-bg.png -------------------------------------------------------------------------------- /src/images/putright-.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/putright-.png -------------------------------------------------------------------------------- /src/images/putright-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/putright-bg.png -------------------------------------------------------------------------------- /src/images/putup-.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/putup-.png -------------------------------------------------------------------------------- /src/images/putup-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/putup-bg.png -------------------------------------------------------------------------------- /src/images/report.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/report.png -------------------------------------------------------------------------------- /src/images/reset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/reset.png -------------------------------------------------------------------------------- /src/images/saveall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/saveall.png -------------------------------------------------------------------------------- /src/images/updatedatabase.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/updatedatabase.png -------------------------------------------------------------------------------- /src/images/vline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/vline.png -------------------------------------------------------------------------------- /src/images/zoomreset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/zoomreset.png -------------------------------------------------------------------------------- /src/images/zoomxincrease.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/zoomxincrease.png -------------------------------------------------------------------------------- /src/images/zoomxreduce.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/zoomxreduce.png -------------------------------------------------------------------------------- /src/images/zoomyaxisincrease.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/zoomyaxisincrease.png -------------------------------------------------------------------------------- /src/images/zoomyaxisreduce.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/zoomyaxisreduce.png -------------------------------------------------------------------------------- /src/images/zoomyincrease.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/zoomyincrease.png -------------------------------------------------------------------------------- /src/images/zoomyreduce.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/images/zoomyreduce.png -------------------------------------------------------------------------------- /src/log/log.cpp: -------------------------------------------------------------------------------- 1 | #include "log.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | Log_Writer INFO_W; 14 | __thread char Log_Writer::m_buffer[_LOG_BUFFSIZE]; 15 | 16 | QReadWriteLock g_lock; 17 | 18 | bool log_init(LogLevel l, const char* p_modulename, const char* p_logdir) 19 | { 20 | QDir dir; 21 | dir.mkpath(p_logdir); 22 | char _location_str[_LOG_PATH_LEN]={0}; 23 | time_t now; 24 | now = time(&now);; 25 | struct tm *vtm = localtime(&now); 26 | 27 | snprintf(_location_str, _LOG_PATH_LEN, "%s/%s-%04d%02d%02d%02d%02d%02d.log", p_logdir, p_modulename, 28 | vtm->tm_year+1900, vtm->tm_mon + 1, vtm->tm_mday, vtm->tm_hour, vtm->tm_min, vtm->tm_sec); 29 | INFO_W.loginit(l, _location_str); 30 | return true; 31 | } 32 | 33 | const char* Log_Writer::logLevelToString(LogLevel l) 34 | { 35 | switch ( l ) { 36 | case LL_DEBUG: 37 | return "DEBUG"; 38 | case LL_TRACE: 39 | return "TRACE"; 40 | case LL_NOTICE: 41 | return "NOTICE"; 42 | case LL_WARNING: 43 | return "WARN" ; 44 | case LL_ERROR: 45 | return "ERROR"; 46 | default: 47 | return "UNKNOWN"; 48 | } 49 | } 50 | 51 | bool Log_Writer::checklevel(LogLevel l) 52 | { 53 | if(l >= m_system_level) 54 | return true; 55 | else 56 | return false; 57 | } 58 | 59 | bool Log_Writer::loginit(LogLevel l, const char *filelocation, bool append, bool issync) 60 | { 61 | MACRO_RET(NULL != fp, false); 62 | m_system_level = l; 63 | m_isappend = append; 64 | m_issync = issync; 65 | if(strlen(filelocation) >= (sizeof(m_filelocation) -1)) 66 | { 67 | fprintf(stderr, "the path of log file is too long:%d limit:%d\n", strlen(filelocation), sizeof(m_filelocation) -1); 68 | exit(0); 69 | } 70 | //本地存储filelocation 以防止在栈上的非法调用调用 71 | strncpy(m_filelocation, filelocation, sizeof(m_filelocation)); 72 | m_filelocation[sizeof(m_filelocation) -1] = '\0'; 73 | 74 | if('\0' == m_filelocation[0]) 75 | { 76 | fp = stdout; 77 | fprintf(stderr, "now all the running-information are going to put to stderr\n"); 78 | return true; 79 | } 80 | 81 | fp = fopen(m_filelocation, append ? "a":"w"); 82 | if(fp == NULL) 83 | { 84 | fprintf(stderr, "cannot open log file,file location is %s\n", m_filelocation); 85 | exit(0); 86 | } 87 | //setvbuf (fp, io_cached_buf, _IOLBF, sizeof(io_cached_buf)); //buf set _IONBF _IOLBF _IOFBF 88 | setvbuf (fp, (char *)NULL, _IOLBF, 0); 89 | fprintf(stderr, "now all the running-information are going to the file %s\n", m_filelocation); 90 | return true; 91 | } 92 | 93 | int Log_Writer::premakestr(char* m_buffer, LogLevel l) 94 | { 95 | time_t now; 96 | now = time(&now);; 97 | struct tm *vtm = localtime(&now); 98 | return snprintf(m_buffer, _LOG_BUFFSIZE, "%s: %02d:%02d:%02d ", logLevelToString(l), 99 | vtm->tm_hour, vtm->tm_min, vtm->tm_sec); 100 | } 101 | 102 | bool Log_Writer::log(LogLevel l, char* logformat,...) 103 | { 104 | MACRO_RET(!checklevel(l), false); 105 | int _size; 106 | int prestrlen = 0; 107 | 108 | char * star = m_buffer; 109 | prestrlen = premakestr(star, l); 110 | star += prestrlen; 111 | 112 | va_list args; 113 | va_start(args, logformat); 114 | _size = vsnprintf(star, _LOG_BUFFSIZE - prestrlen, logformat, args); 115 | va_end(args); 116 | 117 | if(NULL == fp) 118 | fprintf(stderr, "%s", m_buffer); 119 | else 120 | _write(m_buffer, prestrlen + _size); 121 | return true; 122 | } 123 | 124 | bool Log_Writer::_write(char *_pbuffer, int len) 125 | { 126 | if(0 != access(m_filelocation, W_OK)) 127 | { 128 | QWriteLocker locker(&g_lock); 129 | //锁内校验 access 看是否在等待锁过程中被其他线程loginit了 避免多线程多次close 和init 130 | if(0 != access(m_filelocation, W_OK)) 131 | { 132 | logclose(); 133 | loginit(m_system_level, m_filelocation, m_isappend, m_issync); 134 | } 135 | } 136 | 137 | if(1 == fwrite(_pbuffer, len, 1, fp)) //only write 1 item 138 | { 139 | if(m_issync) 140 | fflush(fp); 141 | *_pbuffer='\0'; 142 | } 143 | else 144 | { 145 | int x = errno; 146 | fprintf(stderr, "Failed to write to logfile. errno:%s message:%s", strerror(x), _pbuffer); 147 | return false; 148 | } 149 | return true; 150 | } 151 | 152 | LogLevel Log_Writer::get_level() 153 | { 154 | return m_system_level; 155 | } 156 | 157 | bool Log_Writer::logclose() 158 | { 159 | if(fp == NULL) 160 | return false; 161 | fflush(fp); 162 | fclose(fp); 163 | fp = NULL; 164 | return true; 165 | } 166 | 167 | 168 | 169 | -------------------------------------------------------------------------------- /src/log/log.h: -------------------------------------------------------------------------------- 1 | #ifndef _MACRO_LogModule 2 | #define _MACRO_LogModule 3 | #include 4 | #include "macro_define.h" 5 | 6 | /* 每个线程的buffer size*/ 7 | #define _LOG_BUFFSIZE 1024*1024*4 8 | /* 当前进程的 Stream IO buffer size*/ 9 | #define _SYS_BUFFSIZE 1024*1024*8 10 | /* log 文件字符串路径最大长度*/ 11 | #define _LOG_PATH_LEN 250 12 | /* 日志对应的模块名*/ 13 | #define _LOG_MODULE_LEN 32 14 | 15 | typedef enum LogLevel { 16 | LL_DEBUG = 1, 17 | LL_TRACE = 2, 18 | LL_NOTICE = 3, 19 | LL_WARNING = 4, 20 | LL_ERROR = 5, 21 | }LogLevel; 22 | 23 | /** 24 | * Log_Writer 日志类 25 | */ 26 | class Log_Writer 27 | { 28 | public: 29 | Log_Writer() 30 | { 31 | m_system_level = LL_NOTICE; 32 | fp = NULL; 33 | m_issync = false; 34 | m_isappend = true; 35 | m_filelocation[0] ='\0'; 36 | } 37 | ~Log_Writer(){ 38 | logclose(); 39 | } 40 | bool loginit(LogLevel l, const char *filelocation, bool append = true, bool issync = true); 41 | bool log(LogLevel l,char *logformat,...); 42 | LogLevel get_level(); 43 | bool logclose(); 44 | private: 45 | const char* logLevelToString(LogLevel l); 46 | bool checklevel(LogLevel l); 47 | int premakestr(char* m_buffer, LogLevel l); 48 | bool _write(char *_pbuffer, int len); 49 | private: 50 | enum LogLevel m_system_level; 51 | FILE* fp; 52 | bool m_issync; 53 | bool m_isappend; 54 | char m_filelocation[_LOG_PATH_LEN]; 55 | static __thread char m_buffer[_LOG_BUFFSIZE]; 56 | //The __thread specifier may be applied to any global, file-scoped static, function-scoped static, 57 | //or static data member of a class. It may not be applied to block-scoped automatic or non-static data member 58 | //in the log scence,It's safe!!!! 59 | //一言以蔽之,此场景不用担心__thread带来资源leak,同时也不用担心多个Log_Writer会干扰, 60 | //因为一个线程同一时间只有一个Log_Writer在干活,干完之后m_buffer就reset了 61 | //所以即便一个线程用户多个Log_Write串行(因为一个线程内的运行态只有串行) 也是线程安全的!!! 62 | }; 63 | 64 | extern Log_Writer WARN_W; 65 | extern Log_Writer INFO_W; 66 | 67 | /** 68 | * LogLevel 日志级别 69 | * p_modulename 模块名 如mysql 70 | * p_logdir 日志输出目录 71 | * */ 72 | bool log_init(LogLevel l, const char* p_modulename, const char* p_logdir); 73 | #endif 74 | -------------------------------------------------------------------------------- /src/log/macro_define.h: -------------------------------------------------------------------------------- 1 | #ifndef _MACRO_DEFINE_H 2 | #define _MACRO_DEFINE_H 3 | //============basic=================== 4 | 5 | #define LOG_ERROR(log_fmt, ...) \ 6 | do{ \ 7 | INFO_W.log(LL_ERROR, "[%s:%d][%s] " log_fmt "\n", \ 8 | __FILE__, __LINE__, __FUNCTION__, __VA_ARGS__); \ 9 | } while (0) 10 | 11 | #define LOG_WARN(log_fmt, ...) \ 12 | do{ \ 13 | INFO_W.log(LL_WARNING, "[%s:%d][%s] " log_fmt "\n", \ 14 | __FILE__, __LINE__, __FUNCTION__, __VA_ARGS__); \ 15 | } while (0) 16 | 17 | #define LOG_NOTICE(log_fmt, ...) \ 18 | do{ \ 19 | INFO_W.log(LL_NOTICE, "[%s:%d][%s] " log_fmt "\n", \ 20 | __FILE__, __LINE__, __FUNCTION__, __VA_ARGS__); \ 21 | } while (0) 22 | 23 | #define LOG_TRACE(log_fmt, ...) \ 24 | do{ \ 25 | INFO_W.log(LL_TRACE, "[%s:%d][%s] " log_fmt "\n", \ 26 | __FILE__, __LINE__, __FUNCTION__, __VA_ARGS__); \ 27 | } while (0) 28 | 29 | #define LOG_DEBUG(log_fmt, ...) \ 30 | do{ \ 31 | INFO_W.log(LL_DEBUG, "[%s:%d][%s] " log_fmt "\n", \ 32 | __FILE__, __LINE__, __FUNCTION__, __VA_ARGS__); \ 33 | } while (0) 34 | 35 | //============extend=================== 36 | #define MACRO_RET(condition, return_val) {\ 37 | if (condition) {\ 38 | return return_val;\ 39 | }\ 40 | } 41 | 42 | #define MACRO_WARN(condition, log_fmt, ...) {\ 43 | if (condition) {\ 44 | LOG_WARN( log_fmt, __VA_ARGS__);\ 45 | }\ 46 | } 47 | 48 | #define MACRO_WARN_RET(condition, return_val, log_fmt, ...) {\ 49 | if ((condition)) {\ 50 | LOG_WARN( log_fmt, __VA_ARGS__);\ 51 | return return_val;\ 52 | }\ 53 | } 54 | #endif 55 | -------------------------------------------------------------------------------- /src/logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BGI-flexlab/SOAPTyping/c301841344fff53adb68a1701332e72c04a25ee1/src/logo.ico -------------------------------------------------------------------------------- /src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "Mainwindow/mainwindow.h" 2 | #include 3 | #include 4 | #include 5 | #include "log/log.h" 6 | 7 | #include 8 | #include 9 | void myMessageOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg) 10 | { 11 | if (type < QtDebugMsg) 12 | return; 13 | static char s_types[5][6] = {"DEBUG", "WARN ", "ERROR", "FATAL", "INFO "}; 14 | const char* szType = "DEBUG"; 15 | if (type < 5) { 16 | szType = s_types[(int)type]; 17 | } 18 | 19 | QString strlog = QString::asprintf("[%s][%s] %s\n", 20 | QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss.zzz").toLocal8Bit().data(), 21 | szType, 22 | msg.toLocal8Bit().data()); 23 | 24 | 25 | static FILE* s_fp = NULL; 26 | if (s_fp) { 27 | fseek(s_fp, 0, SEEK_END); 28 | if (ftell(s_fp) > (2 << 20)) { 29 | fclose(s_fp); 30 | s_fp = NULL; 31 | } 32 | } 33 | 34 | if (!s_fp) { 35 | QString strLogfile = "log/qt_"; 36 | strLogfile.append(QDateTime::currentDateTime().toString("yyyyMMddhhmmss")); 37 | strLogfile.append(".log"); 38 | s_fp = fopen(strLogfile.toLocal8Bit().data(), "w"); 39 | } 40 | 41 | if (s_fp) { 42 | fputs(strlog.toLocal8Bit().data(), s_fp); 43 | } 44 | } 45 | 46 | int main(int argc, char *argv[]) 47 | { 48 | //qInstallMessageHandler(myMessageOutput); 49 | QApplication a(argc, argv); 50 | 51 | QFile qssF(":/qss/qss"); 52 | if(qssF.open(QFile::ReadOnly)) 53 | { 54 | QTextStream stream(&qssF); 55 | QString sss = stream.readAll(); 56 | a.setStyleSheet(sss); 57 | } 58 | qssF.close(); 59 | log_init(LL_DEBUG,"test","./log"); 60 | 61 | MainWindow w; 62 | w.InitData(); 63 | w.show(); 64 | 65 | LOG_DEBUG("%s","SOAPTyping end"); 66 | return a.exec(); 67 | } 68 | -------------------------------------------------------------------------------- /src/qss/qss: -------------------------------------------------------------------------------- 1 | QProgressBar 2 | { 3 | text-align:center; 4 | } 5 | 6 | QTableView::item:selected{ 7 | color:black; 8 | background:rgba(255,255,0,127); 9 | } 10 | 11 | QTableWidget QHeaderView::section 12 | { 13 | background-color:white; 14 | color:rgb(77,77,77); 15 | font-size:16px; 16 | font-weight:bold; 17 | border: 1px solid #E6E6E6; 18 | } 19 | 20 | QTreeWidget::item:selected{ 21 | color:black; 22 | background:rgba(100%,100%,0%,50%); 23 | border:1px solid #D3D3D3; 24 | } 25 | 26 | QLabel#statusbarright{ 27 | font-size:16px; 28 | color:#8b8b8b; 29 | } 30 | 31 | --------------------------------------------------------------------------------