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 |
|
|
|
|
| 62.5% |
Uncovered Elements: 15 (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 |
|
|
|
|
| 59.5% |
Uncovered Elements: 15 (37) |
Complexity: 8 |
Complexity Density: 0.35 |
|
55 |
9 |
public PDBEntry associatePdbWithSeq(String choice, DataSourceType file,... |
56 |
|
SequenceI sequence, boolean prompt, |
57 |
|
StructureSelectionManagerProvider ssmp, TFType tft, |
58 |
|
String paeFilename, boolean doXferSettings) |
59 |
|
{ |
60 |
9 |
PDBEntry entry = new PDBEntry(); |
61 |
9 |
StructureFile pdbfile = StructureSelectionManager |
62 |
|
.getStructureSelectionManager(ssmp) |
63 |
|
.setMapping(false, new SequenceI[] |
64 |
|
{ sequence }, null, choice, file, tft, paeFilename, |
65 |
|
doXferSettings); |
66 |
9 |
if (pdbfile == null) |
67 |
|
{ |
68 |
|
|
69 |
0 |
return null; |
70 |
|
} |
71 |
9 |
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 |
9 |
entry.setId(pdbfile.getId()); |
93 |
|
} |
94 |
9 |
entry.setType(PDBEntry.Type.FILE); |
95 |
|
|
96 |
9 |
if (pdbfile != null) |
97 |
|
{ |
98 |
9 |
entry.setFile(choice); |
99 |
9 |
sequence.getDatasetSequence().addPDBId(entry); |
100 |
9 |
entry.setStructureFile(pdbfile); |
101 |
9 |
StructureSelectionManager.getStructureSelectionManager(ssmp) |
102 |
|
.registerPDBEntry(entry); |
103 |
|
} |
104 |
9 |
if (tft != null) |
105 |
9 |
entry.setProperty("TFType", tft.name()); |
106 |
9 |
if (paeFilename != null) |
107 |
6 |
entry.setProperty("PAEFile", paeFilename); |
108 |
9 |
return entry; |
109 |
|
} |
110 |
|
} |