Skip to content

Conversation

@josemduarte
Copy link
Contributor

Essentially the same as #1021 but truncating the large file

sbliven and others added 6 commits February 2, 2022 10:07
Fix NullPointer if the structure identifier was missing
Currently `Structure` has 4 identifiers which may or may not be set
depending on the source, file format, and parsing method. These should
be revisited and harmonized in the future, but for now I just document
them in this test.

Summary of results:

| Format | With ID | Parse Method    | PdbId | Identifier | Name | StructureIdentifier |
|--------|---------|-----------------|-------|------------|------|---------------------|
| cif    | No      | fromInputStream | null  | ""         | ""   | null                |
| pdb    | No      | fromInputStream | null  | ""         | ""   | null                |
| cif    | No      | fromUrl         | null  | ""         | ""   | null                |
| cif    | No      | StructureIO     | null  | file:      | 5PTI | file:               |
| pdb    | No      | StructureIO     | null  | file:      | ""   | file:               |
| cif    | Yes     | fromInputStream | 5PTI  | ""         | ""   | null                |
| pdb    | Yes     | fromInputStream | 5PTI  | ""         | ""   | null                |
| cif    | Yes     | fromUrl         | 5PTI  | ""         | ""   | null                |
| cif    | Yes     | StructureIO     | 5PTI  | file:      | 5PTI | file:               |
| pdb    | Yes     | StructureIO     | 5PTI  | file:      | 5PTI | file:               |

- `getPdbId` reflects the ID parsed from the file
- Only StructureIO is setting the StructureIdentifier (by design, but
  indicates StructureIO should be used wherever possible)
- StructureIO does not set the name properly for PDB files. This should
  be fixed.
The core URLIdentifier bug was fixed in biojava#1020, but this improves the
test.

The parser changes are mostly for logging, and are there to indicate that
null PdbId is an expected situation rather than an error.
@josemduarte josemduarte merged commit 043eb40 into biojava:master Jan 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants