You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ChemCompGroupFactory cache not being reset properly #313
This issue is related to the closed issue #145, about a problem with singletons in the structure module. The fix145 made sure that the cache is reset if the ChemCompProvider is set (changed).
However there is another problem: when the method setLoadChemCompInfo() of the FileParsingParameters is set, neither the cache is cleaned or the ChemCompProvider is changed in the ChemCompGroupFactory. That generated unexpected results if the ChemCompProvider was set previously and the parameters are changed afterwards.
The fix will need to reset the ChemCompProvider if the parameters are changed, i.e. every time setLoadChemCompInfo() is called.
After revising the code with @josemduarte we realized that the real problem was a bug in PDBFileReader that was setting the static variables of ChemCompGroupFactory inconsistently. This bug has been fixed, and the other parts of the code behave the same way.
This is closely related to issue #169, because the user has to specify the ChemCompProvider he/she needs, independently of the parser used. Because it is a static variable, the same default will apply to MMCiff and PDB parsers.
Just a note on that: it seems that as @andreasprlic says in #169, the PDB parser sets the ChemCompProvider intentionally so that it is faster and more streamlined (versus the more correct but slower mmCIF parser). That in principle is fine, but before the patches above, the ChemCompProvider was setting the singleton and affecting the whole JVM globally. So that affected all parsers and would result in unexpected side effects.
With these patches, in order to produce the "quick and dirty" PDB parsing behaviour that we had before, the user would need to explicitly set it like this:
Regarding the Test created for https://redmine.open-bio.org/issues/3334, it does not apply anymore because the value of the variable loadChemCompInfo does not change the static ChemCompProvider, which is valid for the whole JVM. The user needs to change the Provider explicitly as @josemduarte explained.
Activity
Fix biojava#313 reset the ChemCompProvider after FileParsing params c…
lafita commentedon Aug 4, 2015
After revising the code with @josemduarte we realized that the real problem was a bug in
PDBFileReaderthat was setting the static variables ofChemCompGroupFactoryinconsistently. This bug has been fixed, and the other parts of the code behave the same way.This is closely related to issue #169, because the user has to specify the
ChemCompProviderhe/she needs, independently of the parser used. Because it is a static variable, the same default will apply to MMCiff and PDB parsers.Undo some changes regarding biojava#313
Do not store empty ChemComp in the cache - no need to reset it
josemduarte commentedon Aug 4, 2015
Just a note on that: it seems that as @andreasprlic says in #169, the PDB parser sets the
ChemCompProviderintentionally so that it is faster and more streamlined (versus the more correct but slower mmCIF parser). That in principle is fine, but before the patches above, theChemCompProviderwas setting the singleton and affecting the whole JVM globally. So that affected all parsers and would result in unexpected side effects.With these patches, in order to produce the "quick and dirty" PDB parsing behaviour that we had before, the user would need to explicitly set it like this:
So we should clarify that in documentation, but otherwise the functionality we had before would still be available.
lafita commentedon Aug 4, 2015
Regarding the Test created for https://redmine.open-bio.org/issues/3334, it does not apply anymore because the value of the variable loadChemCompInfo does not change the static ChemCompProvider, which is valid for the whole JVM. The user needs to change the Provider explicitly as @josemduarte explained.
Adapt some tests to biojava#313 changes
andreasprlic commentedon Aug 4, 2015
Can we keep the
ReducedChemCompProviderthe default provider, unless the user specifies a different one?