Skip to content

StructureIO.getStructure(pdbId) fails if a file with pdb id present in working dir #398

@josemduarte

Description

@josemduarte

Following pull request #376 there is an issue with how the structure identifier string is detected to be a file. If a file happens to be present in working dir with a name coinciding with a PDB id, then StructureIO.getStructure(pdbId) tries to read the file instead of going to the actual PDB id. We've just seen this (unlikely) issue happening in real life and it was very confusing.

A better behavior would be to try first if the string matches a pdb id and only if it doesn't try to see if a file with that name is present.

I've added a test to demonstrate the issue here: josemduarte/biojava@f4a86f2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBugs and bugfixes

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions