Commit d4b0bba
committed
Add substantially new unified class for identify structures: StructureIdentifier
This unifies various prior methods for identifying a structure from a string, which was
previously spread over AtomCache methods and StructureTools/StructureIO utilities. It
includes PDB IDs, residue range specifications, URLs, SCOP/CATH/PDP domains, and files.
Major Classes:
* StructureIdentifier is an interface for methods which know how to load a structure from
some resource and reduce it to the requested substructure. The most important property
is the identifier, which can be an arbitrary string.
* SubstructureIdentifier is considered the canonical way to specify a structure and
is the major implementation for chain and residue level substructures. All identifiers
can be converted to a SubstructureIdentifier.
* StructureName is suitable for wrapping user-supplied identifiers, and it dispatches the
request to a more specific class based on a guess as to the type (PDB, URL, file, etc).
StructureIdentifiers can represent arbitrary strings (e.g. domain IDs). These are converted
(possibly through some relatively slow process like downloading and parsing a file) into
standard-format SubstructureIdentifier instances, which should be easier to serialize and
recreate.
Detailed changes:
* Substantially changes StructureIdentifier, which existed but wasn't used anywhere.
* Remove getPdbId() method, since not globally relevant. It's still present in most
implementations, and can always be accessed via toCanonical().getPdbId()
* AtomCache
* Accept chain indices ("4HHB.0") with a warning if there was not
already a chain with that ID.
This commit rebases and squashes pre-4.1 development from sbliven's fix81 branch
culminating in 007ea6e. For posterity, the original commit messages are listed below.
Some changes may be omitted or modified when resolving the rebase.
Commit messages (oldest to youngest):
---
Major changes to StructureIdentifier (biojava#81)
Redefines StructureIdentifier as something which transforms a structure.
This will replace all of the disjoint places where strings are parsed
into various structures and ranges and identifiers.
---
More work on using StructureIdentifiers
* Add AtomCache.getStructure(StructureIdentifier) method, and change
other methods to use it
* Implement StructureName and other StructureIdentifiers
* Remove the 'A:+1-+5' range syntax from StructureTools. It was stupid.
* Remove string parsing from lots of places and replace with
StructureIdentifiers
* Fix lots of tests
---
Adding support for models in SubstructureIdentifier
---
More improvements for StructureIdentifiers
* Accept chain indices ("4HHB.0") with a warning if there was not
already a chain with that ID.
* Fixing bugs in StructureName due to differences with
SubstructureIdentifier
* Removing StructureName.compareTo method, since they aren't well
ordered
* Changing more AtomCache methods to use StructureIdentifiers
* Test fixes
---
Fixing bugs with loading structures from files and urls
These are now valid StructureName values. They are implemented using the
PassthroughIdentifier, which makes AtomCache responsible for fetching
the right structure.
---
Implementing PDP identifiers in StructureName
PDP parsing doesn't have good test coverage, but my basic checks work.
---
Last test fix.
All (existing) tests now pass.
---
Fix some AtomCache synchronization.
---
Modifying StructureIdentifier interface
- Add loadStructure() method
- Remove getPdbId() method, since not globally relevant. It's still
present in most implementations, and can always be accessed via
toCanonical().getPdbId()
- In AtomCache, rename protected loadStructureByPdbId to public
getStructureForPdbId() to bypass StructureIdentifier parsing
---
Fix bug loading PDP structures
---1 parent 37bdc1e commit d4b0bba
File tree
29 files changed
+1510
-838
lines changed- biojava-integrationtest/src/test/java/org/biojava/nbio/structure/test
- cath
- biojava-structure/src
- main/java/org/biojava/nbio/structure
- align
- client
- multiple/util
- util
- cath
- domain
- io
- scop
- test/java/org/biojava/nbio/structure
29 files changed
+1510
-838
lines changedLines changed: 7 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| 129 | + | |
129 | 130 | | |
130 | 131 | | |
131 | 132 | | |
| |||
230 | 231 | | |
231 | 232 | | |
232 | 233 | | |
233 | | - | |
234 | | - | |
| 234 | + | |
| 235 | + | |
235 | 236 | | |
236 | 237 | | |
237 | 238 | | |
238 | | - | |
239 | | - | |
| 239 | + | |
| 240 | + | |
240 | 241 | | |
241 | 242 | | |
242 | 243 | | |
| |||
319 | 320 | | |
320 | 321 | | |
321 | 322 | | |
| 323 | + | |
322 | 324 | | |
323 | 325 | | |
324 | 326 | | |
| |||
379 | 381 | | |
380 | 382 | | |
381 | 383 | | |
| 384 | + | |
382 | 385 | | |
383 | 386 | | |
384 | 387 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
168 | 177 | | |
169 | 178 | | |
170 | 179 | | |
| |||
Lines changed: 6 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | | - | |
28 | | - | |
29 | 28 | | |
30 | 29 | | |
31 | 30 | | |
32 | 31 | | |
| 32 | + | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | 37 | | |
40 | 38 | | |
41 | 39 | | |
42 | 40 | | |
43 | | - | |
| 41 | + | |
44 | 42 | | |
| 43 | + | |
45 | 44 | | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
| 45 | + | |
56 | 46 | | |
57 | | - | |
58 | 47 | | |
Lines changed: 46 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
160 | | - | |
| 160 | + | |
161 | 161 | | |
162 | 162 | | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
163 | 166 | | |
164 | 167 | | |
165 | 168 | | |
| |||
Lines changed: 40 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
34 | 38 | | |
35 | 39 | | |
36 | 40 | | |
| |||
58 | 62 | | |
59 | 63 | | |
60 | 64 | | |
61 | | - | |
62 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
63 | 83 | | |
64 | 84 | | |
65 | 85 | | |
| |||
71 | 91 | | |
72 | 92 | | |
73 | 93 | | |
74 | | - | |
75 | 94 | | |
76 | | - | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
77 | 102 | | |
| 103 | + | |
78 | 104 | | |
79 | 105 | | |
80 | 106 | | |
81 | | - | |
82 | 107 | | |
83 | 108 | | |
84 | 109 | | |
85 | | - | |
| 110 | + | |
86 | 111 | | |
87 | 112 | | |
88 | 113 | | |
89 | 114 | | |
90 | 115 | | |
91 | 116 | | |
92 | 117 | | |
| 118 | + | |
93 | 119 | | |
94 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
95 | 129 | | |
96 | 130 | | |
97 | 131 | | |
| |||
Lines changed: 53 additions & 45 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
27 | 30 | | |
28 | 31 | | |
29 | | - | |
30 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
31 | 42 | | |
| 43 | + | |
32 | 44 | | |
33 | 45 | | |
34 | 46 | | |
35 | 47 | | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
| 48 | + | |
| 49 | + | |
63 | 50 | | |
64 | 51 | | |
65 | | - | |
| 52 | + | |
| 53 | + | |
66 | 54 | | |
67 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
68 | 67 | | |
69 | | - | |
| 68 | + | |
70 | 69 | | |
71 | 70 | | |
72 | | - | |
73 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
74 | 78 | | |
75 | | - | |
76 | | - | |
| 79 | + | |
| 80 | + | |
77 | 81 | | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
84 | 92 | | |
85 | | - | |
86 | | - | |
| 93 | + | |
| 94 | + | |
87 | 95 | | |
0 commit comments