| 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 |
|
|
| 36 |
|
@author |
| 37 |
|
|
| 38 |
|
|
| |
|
| 75% |
Uncovered Elements: 8 (32) |
Complexity: 9 |
Complexity Density: 0.47 |
|
| 39 |
|
public class AssociatePdbFileWithSeq |
| 40 |
|
{ |
| 41 |
|
|
| |
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 42 |
0 |
private AssociatePdbFileWithSeq()... |
| 43 |
|
{ |
| 44 |
|
|
| 45 |
|
} |
| 46 |
|
|
| 47 |
|
|
| 48 |
|
|
| 49 |
|
|
| 50 |
|
|
| 51 |
|
@param |
| 52 |
|
|
| 53 |
|
@param |
| 54 |
|
|
| 55 |
|
@param |
| 56 |
|
|
| 57 |
|
@param |
| 58 |
|
|
| 59 |
|
|
| 60 |
|
@return |
| 61 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 62 |
3 |
public static PDBEntry associatePdbWithSeq(String fileName,... |
| 63 |
|
DataSourceType type, SequenceI sequence, boolean prompt) |
| 64 |
|
{ |
| 65 |
3 |
return associatePdbWithSeq(fileName, type, sequence, prompt, Desktop.getInstance(), |
| 66 |
|
TFType.DEFAULT, null, false); |
| 67 |
|
} |
| |
|
| 75% |
Uncovered Elements: 7 (28) |
Complexity: 7 |
Complexity Density: 0.39 |
|
| 68 |
70 |
public static PDBEntry associatePdbWithSeq(String fileName, DataSourceType type,... |
| 69 |
|
SequenceI sequence, boolean prompt, |
| 70 |
|
StructureSelectionManagerProvider ssmp, TFType tft, |
| 71 |
|
String paeFilename, boolean doXferSettings) |
| 72 |
|
{ |
| 73 |
70 |
PDBEntry entry = new PDBEntry(); |
| 74 |
|
|
| 75 |
70 |
StructureFile pdbfile = StructureSelectionManager |
| 76 |
|
.getStructureSelectionManager(ssmp) |
| 77 |
|
.setMapping(false, new SequenceI[] |
| 78 |
|
{ sequence }, null, fileName, type, tft, paeFilename, |
| 79 |
|
doXferSettings); |
| 80 |
70 |
if (pdbfile == null) |
| 81 |
|
{ |
| 82 |
|
|
| 83 |
0 |
return null; |
| 84 |
|
} |
| 85 |
70 |
String id = pdbfile.getId(); |
| 86 |
? |
if (id == null && (id = (prompt |
| 87 |
|
? JvOptionPane.showInternalInputDialog(Desktop.getDesktopPane(), |
| 88 |
|
MessageManager |
| 89 |
|
.getString("label.couldnt_find_pdb_id_in_file"), |
| 90 |
|
MessageManager.getString("label.no_pdb_id_in_file"), |
| 91 |
|
JvOptionPane.QUESTION_MESSAGE) |
| 92 |
|
: null)) == null) |
| 93 |
|
{ |
| 94 |
0 |
return null; |
| 95 |
|
} |
| 96 |
70 |
entry.setId(id); |
| 97 |
70 |
entry.setType(PDBEntry.Type.FILE); |
| 98 |
70 |
entry.setFile(fileName); |
| 99 |
70 |
sequence.getDatasetSequence().addPDBId(entry); |
| 100 |
70 |
entry.setStructureFile(pdbfile); |
| 101 |
70 |
StructureSelectionManager.getStructureSelectionManager(ssmp) |
| 102 |
|
.registerPDBEntry(entry); |
| 103 |
70 |
if (tft != null) |
| 104 |
54 |
entry.setTempFacType(tft); |
| 105 |
70 |
if (paeFilename != null) |
| 106 |
32 |
entry.setPAEFile(paeFilename); |
| 107 |
70 |
return entry; |
| 108 |
|
} |
| 109 |
|
} |