| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
|
| 17 |
|
|
| 18 |
|
|
| 19 |
|
|
| 20 |
|
|
| 21 |
|
package jalview.gui; |
| 22 |
|
|
| 23 |
|
import jalview.api.StructureSelectionManagerProvider; |
| 24 |
|
import jalview.datamodel.PDBEntry; |
| 25 |
|
import jalview.datamodel.SequenceI; |
| 26 |
|
import jalview.io.DataSourceType; |
| 27 |
|
import jalview.io.StructureFile; |
| 28 |
|
import jalview.structure.StructureImportSettings.TFType; |
| 29 |
|
import jalview.structure.StructureSelectionManager; |
| 30 |
|
import jalview.util.MessageManager; |
| 31 |
|
|
| 32 |
|
|
| 33 |
|
|
| 34 |
|
|
| 35 |
|
@author |
| 36 |
|
|
| 37 |
|
|
| |
|
| 65% |
Uncovered Elements: 14 (40) |
Complexity: 9 |
Complexity Density: 0.38 |
|
| 38 |
|
public class AssociatePdbFileWithSeq |
| 39 |
|
{ |
| 40 |
|
|
| 41 |
|
|
| 42 |
|
|
| 43 |
|
|
| 44 |
|
@param |
| 45 |
|
@param |
| 46 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 47 |
3 |
public PDBEntry associatePdbWithSeq(String choice, DataSourceType file,... |
| 48 |
|
SequenceI sequence, boolean prompt, |
| 49 |
|
StructureSelectionManagerProvider ssmp) |
| 50 |
|
{ |
| 51 |
3 |
return associatePdbWithSeq(choice, file, sequence, prompt, ssmp, |
| 52 |
|
TFType.DEFAULT, null, false); |
| 53 |
|
} |
| 54 |
|
|
| |
|
| 62.2% |
Uncovered Elements: 14 (37) |
Complexity: 8 |
Complexity Density: 0.35 |
|
| 55 |
55 |
public PDBEntry associatePdbWithSeq(String choice, DataSourceType file,... |
| 56 |
|
SequenceI sequence, boolean prompt, |
| 57 |
|
StructureSelectionManagerProvider ssmp, TFType tft, |
| 58 |
|
String paeFilename, boolean doXferSettings) |
| 59 |
|
{ |
| 60 |
55 |
PDBEntry entry = new PDBEntry(); |
| 61 |
55 |
StructureFile pdbfile = StructureSelectionManager |
| 62 |
|
.getStructureSelectionManager(ssmp) |
| 63 |
|
.setMapping(false, new SequenceI[] |
| 64 |
|
{ sequence }, null, choice, file, tft, paeFilename, |
| 65 |
|
doXferSettings); |
| 66 |
55 |
if (pdbfile == null) |
| 67 |
|
{ |
| 68 |
|
|
| 69 |
0 |
return null; |
| 70 |
|
} |
| 71 |
55 |
if (pdbfile.getId() == null) |
| 72 |
|
{ |
| 73 |
0 |
String reply = null; |
| 74 |
|
|
| 75 |
0 |
if (prompt) |
| 76 |
|
{ |
| 77 |
0 |
reply = JvOptionPane.showInternalInputDialog(Desktop.desktop, |
| 78 |
|
MessageManager |
| 79 |
|
.getString("label.couldnt_find_pdb_id_in_file"), |
| 80 |
|
MessageManager.getString("label.no_pdb_id_in_file"), |
| 81 |
|
JvOptionPane.QUESTION_MESSAGE); |
| 82 |
|
} |
| 83 |
0 |
if (reply == null) |
| 84 |
|
{ |
| 85 |
0 |
return null; |
| 86 |
|
} |
| 87 |
|
|
| 88 |
0 |
entry.setId(reply); |
| 89 |
|
} |
| 90 |
|
else |
| 91 |
|
{ |
| 92 |
55 |
entry.setId(pdbfile.getId()); |
| 93 |
|
} |
| 94 |
55 |
entry.setType(PDBEntry.Type.FILE); |
| 95 |
|
|
| 96 |
55 |
if (pdbfile != null) |
| 97 |
|
{ |
| 98 |
55 |
entry.setFile(choice); |
| 99 |
55 |
sequence.getDatasetSequence().addPDBId(entry); |
| 100 |
55 |
entry.setStructureFile(pdbfile); |
| 101 |
55 |
StructureSelectionManager.getStructureSelectionManager(ssmp) |
| 102 |
|
.registerPDBEntry(entry); |
| 103 |
|
} |
| 104 |
55 |
if (tft != null) |
| 105 |
37 |
entry.setProperty("TFType", tft.name()); |
| 106 |
55 |
if (paeFilename != null) |
| 107 |
36 |
entry.setProperty("PAEFile", paeFilename); |
| 108 |
55 |
return entry; |
| 109 |
|
} |
| 110 |
|
} |