Skip to content

Fix313 - ChemCompProvider and ChemComp cache consistency - #314

Merged
lafita merged 8 commits into
biojava:masterfrom
lafita:fix313
Aug 5, 2015
Merged

lafita merged 8 commits into
biojava:masterfrom
lafita:fix313

Conversation

@lafita

@lafita lafita commented Aug 4, 2015

Copy link
Copy Markdown
Member

See issue #313.

This pull request solves issue 313 by forcing the user to specify which ChemCompProvider is used when parsing a PDB or MMCiff file. The cache is kept and increased while the JVM is running, so ChemComp downloaded and cached by the DownloadChemCompProvider can also be user later by the ReducedChemCompProvider. The cache is never reset in the same JVM.

@andreasprlic

Copy link
Copy Markdown
Member

I'd prefer to use ReducedChemCompProvider as the default, unless the user specifies differently. We should keep the code required to get going with BioJava to a minimum.

@josemduarte

Copy link
Copy Markdown
Contributor

That's a good point, it sounds logical that the ReducedChemCompProvider is the default one since it will give some minimal functionality that will work in any machine and with/without internet connection (in terms of code or complexity it is really not adding anything because it is all transparent to the user).

At the same time the DownloadChemCompProvider does a much better job in getting the right chemical descriptions for molecules and thus things work much better with it, so I think that's also a reason to keep that one by default.

So it's difficult to say what's the better default. We are going to try and check how the tests do when changing the default. That can give us some more clues of what things can go wrong.

@lafita

lafita commented Aug 5, 2015

Copy link
Copy Markdown
Member Author

I think that there was no problem before in using the ReducedChemCompProvider, because the method getRepresentativeAtomArray() was not correctly implemented (issue #309). After #312, where this is fixed, to correctly obtain the Atoms in the backbone of a structure we need the information of the modified aminoacids, which is only possible with the DownloadChemCompProvider.
If the ReducedChemCompProvider is set and the structure contains modified aminoacids, those won't be returned when calling getRepresentativeAtomArray().

I have tried to set the ReducedChemCompProvider as the default and run the tests. The only failures are when checking for array sizes after calling getRepresentativeAtomArray() on structures that have modified aminoacids. We have two options, either:

  1. We change the failing tests to use the DownloadChemCompProvider, or
  2. We modify the expected array lengths in the tests.

In any case we need to document in the getRepresentativeAtomArray() that modified aminoacids won't be returned as part of the backbone if the ReducedChemCompProvider is set and they were not cached before. I will do it now.

lafita added a commit that referenced this pull request Aug 5, 2015
lafita added a commit that referenced this pull request Aug 5, 2015
Fix313 - ChemCompProvider and ChemComp cache consistency
@lafita
lafita merged commit 4a6b682 into biojava:master Aug 5, 2015
@lafita
lafita deleted the fix313 branch August 7, 2015 07:01
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.

3 participants