| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent b3d6fba commit 13716a3
6 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -82,9 +82,6 @@ public class AlignmentGui extends JFrame{ | |||
| 82 | 82 | JProgressBar progress; | |
| 83 | 83 | ||
| 84 | 84 | ||
| 85 | - private DBSearchGUI dbsearch; | ||
| 86 | - | ||
| 87 | - | ||
| 88 | 85 | public static void main(String[] args){ | |
| 89 | 86 | ||
| 90 | 87 | AlignmentGui.getInstance(); | |
@@ -163,10 +160,6 @@ protected AlignmentGui() { | |||
| 163 | 160 | ||
| 164 | 161 | masterPane.addTab("Pairwise Comparison", vBox); | |
| 165 | 162 | ||
| 166 | - dbsearch = new DBSearchGUI(); | ||
| 167 | - | ||
| 168 | - masterPane.addTab("Database Search",dbsearch); | ||
| 169 | - | ||
| 170 | 163 | //JPanel dir = tab1.getPDBDirPanel(pdbDir); | |
| 171 | 164 | ||
| 172 | 165 | Box vBoxMain = Box.createVerticalBox(); | |
@@ -278,8 +271,6 @@ public void actionPerformed(ActionEvent evt) { | |||
| 278 | 271 | int selectedIndex = masterPane.getSelectedIndex(); | |
| 279 | 272 | if (selectedIndex == 0) | |
| 280 | 273 | calcAlignment(); | |
| 281 | - else if ( selectedIndex == 1) | ||
| 282 | - calcDBSearch(); | ||
| 283 | 274 | else { | |
| 284 | 275 | System.err.println("Unknown TAB: " + selectedIndex); | |
| 285 | 276 | } | |
@@ -408,110 +399,6 @@ private void calcAlignment() { | |||
| 408 | 399 | ||
| 409 | 400 | } | |
| 410 | 401 | ||
| 411 | - | ||
| 412 | - private void calcDBSearch() { | ||
| 413 | - | ||
| 414 | - JTabbedPane tabPane = dbsearch.getTabPane(); | ||
| 415 | - System.out.println("run DB search " + tabPane.getSelectedIndex()); | ||
| 416 | - | ||
| 417 | - Structure s = null; | ||
| 418 | - boolean domainSplit = dbsearch.isDomainSplit(); | ||
| 419 | - | ||
| 420 | - StructurePairSelector tab = null; | ||
| 421 | - int pos = tabPane.getSelectedIndex(); | ||
| 422 | - | ||
| 423 | - if (pos == 0 ){ | ||
| 424 | - | ||
| 425 | - tab = dbsearch.getSelectPDBPanel(); | ||
| 426 | - | ||
| 427 | - } else if (pos == 1){ | ||
| 428 | - | ||
| 429 | - tab = dbsearch.getScopSelectPanel(); | ||
| 430 | - | ||
| 431 | - | ||
| 432 | - } else if (pos == 2){ | ||
| 433 | - | ||
| 434 | - tab = dbsearch.getPDBUploadPanel(); | ||
| 435 | - | ||
| 436 | - } | ||
| 437 | - | ||
| 438 | - try { | ||
| 439 | - | ||
| 440 | - s = tab.getStructure1(); | ||
| 441 | - | ||
| 442 | - if ( s == null) { | ||
| 443 | - JOptionPane.showMessageDialog(null,"please select structure 1"); | ||
| 444 | - return ; | ||
| 445 | - } | ||
| 446 | - | ||
| 447 | - } catch (Exception e){ | ||
| 448 | - e.printStackTrace(); | ||
| 449 | - } | ||
| 450 | - | ||
| 451 | - String name1 = s.getName(); | ||
| 452 | - if ( name1 == null || name1.equals("")) | ||
| 453 | - name1 = s.getPDBCode(); | ||
| 454 | - | ||
| 455 | - | ||
| 456 | - | ||
| 457 | - System.out.println("name1 in alig gui:" + name1); | ||
| 458 | - String file = dbsearch.getOutFileLocation(); | ||
| 459 | - if ( file == null || file.equals("") ){ | ||
| 460 | - JOptionPane.showMessageDialog(null,"Please select a directory to contain the DB search results."); | ||
| 461 | - return; | ||
| 462 | - } | ||
| 463 | - File outFile = new File(file); | ||
| 464 | - if( !outFile.exists() ) { | ||
| 465 | - outFile.mkdirs(); | ||
| 466 | - } | ||
| 467 | - if( !outFile.isDirectory() || !outFile.canWrite()) { | ||
| 468 | - JOptionPane.showMessageDialog(null,"Unable to write to "+outFile.getAbsolutePath()); | ||
| 469 | - return; | ||
| 470 | - } | ||
| 471 | - | ||
| 472 | - UserConfiguration config = WebStartMain.getWebStartConfig(); | ||
| 473 | - | ||
| 474 | - int totalNrCPUs = Runtime.getRuntime().availableProcessors(); | ||
| 475 | - | ||
| 476 | - int useNrCPUs = 1; | ||
| 477 | - if ( totalNrCPUs > 1){ | ||
| 478 | - Object[] options = new Integer[totalNrCPUs]; | ||
| 479 | - int posX = 0; | ||
| 480 | - for ( int i = totalNrCPUs; i> 0 ; i--){ | ||
| 481 | - options[posX] = i; | ||
| 482 | - posX++; | ||
| 483 | - } | ||
| 484 | - int n = JOptionPane.showOptionDialog(null, | ||
| 485 | - "How many would you like to use for the calculations?", | ||
| 486 | - "We detected " + totalNrCPUs + " processors on your system.", | ||
| 487 | - JOptionPane.OK_CANCEL_OPTION, | ||
| 488 | - JOptionPane.QUESTION_MESSAGE, | ||
| 489 | - null, | ||
| 490 | - options, | ||
| 491 | - options[0]); | ||
| 492 | - | ||
| 493 | - if ( n < 0) | ||
| 494 | - return; | ||
| 495 | - useNrCPUs = (Integer) options[n]; | ||
| 496 | - System.out.println("will use " + useNrCPUs + " CPUs." ); | ||
| 497 | - } | ||
| 498 | - System.out.println("using domainSplit data"); | ||
| 499 | - alicalc = new AlignmentCalcDB(this, s, name1,config,file, domainSplit); | ||
| 500 | - alicalc.setNrCPUs(useNrCPUs); | ||
| 501 | - abortB.setEnabled(true); | ||
| 502 | - progress.setIndeterminate(true); | ||
| 503 | - ProgressThreadDrawer drawer = new ProgressThreadDrawer(progress); | ||
| 504 | - drawer.start(); | ||
| 505 | - | ||
| 506 | - Thread t = new Thread(alicalc); | ||
| 507 | - t.start(); | ||
| 508 | - } | ||
| 509 | - | ||
| 510 | - | ||
| 511 | - public DBSearchGUI getDBSearch(){ | ||
| 512 | - return dbsearch; | ||
| 513 | - } | ||
| 514 | - | ||
| 515 | 402 | public void notifyCalcFinished(){ | |
| 516 | 403 | abortB.setEnabled(false); | |
| 517 | 404 | thread = null; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments