Skip to content

Switch Jmol interaction to use MMTF - #570

Merged
josemduarte merged 1 commit into
biojava:masterfrom
sbliven:jmol-mmtf
Sep 1, 2016
Merged

josemduarte merged 1 commit into
biojava:masterfrom
sbliven:jmol-mmtf

Conversation

@sbliven

@sbliven sbliven commented Aug 30, 2016

Copy link
Copy Markdown
Member

MMTF write support is much better than mmCIF. I'm assuming it will be faster as well.

}
}).start();
viewer.openReader(null, in);
} catch (IOException e) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about throwing the exception? In the end of the day this will only produce a blank jmol screen (and a message in the logs), but a user will not be able to know if there was a problem in the loading. If we throw it then a user can catch it down the line and act upon it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is that the interesting exception is the one from writeToOutputStream, and that has to run in its own thread if I want to use pipes like this, so it can't throw an exception.

The other IOExceptions would indicate a broken pipe to Jmol, which would very likely be from program termination anyways. Trying to throw an IOException here requires adding the exception to maybe a dozen other functions that call this, some of which don't make much sense.

I guess I could write the MMTF to a byte[] and then pass it to jmol (avoiding creating a new thread).

I guess ultimately I caught the exceptions here because they seemed very unlikely to result from user input (assuming the MMTF encoder doesn't have bugs).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the explanation, that makes sense now.

I guess ultimately I caught the exceptions here because they seemed very unlikely to result from user input (assuming the MMTF encoder doesn't have bugs).

Well in theory if the structure is "malformed" in some way the encoder should throw an exception saying it doesn't like it. In real life I'm not sure if such a "malformation" is a possibility.

@josemduarte

Copy link
Copy Markdown
Contributor

Nice thanks a lot! This would finally solve #201 right?

@sbliven

sbliven commented Aug 31, 2016

Copy link
Copy Markdown
Member Author

Actually, #201 was already solved by PR #569, which switched from PDB to mmCIF.

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