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 |
|
|
|
|
| 0% |
Uncovered Elements: 40 (40) |
Complexity: 9 |
Complexity Density: 0.38 |
|
38 |
|
public class AssociatePdbFileWithSeq |
39 |
|
{ |
40 |
|
|
41 |
|
|
42 |
|
|
43 |
|
|
44 |
|
@param |
45 |
|
@param |
46 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
47 |
0 |
public PDBEntry associatePdbWithSeq(String choice, DataSourceType file,... |
48 |
|
SequenceI sequence, boolean prompt, |
49 |
|
StructureSelectionManagerProvider ssmp) |
50 |
|
{ |
51 |
0 |
return associatePdbWithSeq(choice, file, sequence, prompt, ssmp, |
52 |
|
TFType.DEFAULT, null, false); |
53 |
|
} |
54 |
|
|
|
|
| 0% |
Uncovered Elements: 37 (37) |
Complexity: 8 |
Complexity Density: 0.35 |
|
55 |
0 |
public PDBEntry associatePdbWithSeq(String choice, DataSourceType file,... |
56 |
|
SequenceI sequence, boolean prompt, |
57 |
|
StructureSelectionManagerProvider ssmp, TFType tft, |
58 |
|
String paeFilename, boolean doXferSettings) |
59 |
|
{ |
60 |
0 |
PDBEntry entry = new PDBEntry(); |
61 |
0 |
StructureFile pdbfile = StructureSelectionManager |
62 |
|
.getStructureSelectionManager(ssmp) |
63 |
|
.setMapping(false, new SequenceI[] |
64 |
|
{ sequence }, null, choice, file, tft, paeFilename, |
65 |
|
doXferSettings); |
66 |
0 |
if (pdbfile == null) |
67 |
|
{ |
68 |
|
|
69 |
0 |
return null; |
70 |
|
} |
71 |
0 |
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 |
0 |
entry.setId(pdbfile.getId()); |
93 |
|
} |
94 |
0 |
entry.setType(PDBEntry.Type.FILE); |
95 |
|
|
96 |
0 |
if (pdbfile != null) |
97 |
|
{ |
98 |
0 |
entry.setFile(choice); |
99 |
0 |
sequence.getDatasetSequence().addPDBId(entry); |
100 |
0 |
entry.setStructureFile(pdbfile); |
101 |
0 |
StructureSelectionManager.getStructureSelectionManager(ssmp) |
102 |
|
.registerPDBEntry(entry); |
103 |
|
} |
104 |
0 |
if (tft != null) |
105 |
0 |
entry.setProperty("TFType", tft.name()); |
106 |
0 |
if (paeFilename != null) |
107 |
0 |
entry.setProperty("PAEFile", paeFilename); |
108 |
0 |
return entry; |
109 |
|
} |
110 |
|
} |