-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Specify version of CV to use? #8
Comments
I seem to have made this difficult to manipulate directly. When instantiating a writer, you can pass in a list of In the meantime, to avoid updating the CV, you can configure the OBO cache by calling My intention (rather, what I do in my own applications and do not document anywhere) was that during installation/update, a program using The pymzML repository maintains a historical list of psi-ms.obo releases, if you're looking for a specific version and the source repository history is too muddy. |
Sorry for the delay in getting back to this. The version at 36ddbcf now supports this behavior properly: import psims
from psims.mzml import MzMLWriter
cvs = [
psims.xml.CV("PSI-MS", 'PSI-MS', "4.1.42",
"https://raw.githubusercontent.com/HUPO-PSI/psi-ms-CV/master/psi-ms.obo")
]
...
with MzMLWriter(path, vocabularies=cvs) as f:
f.controlled_vocabularies()
... This will render as: <?xml version='1.0' encoding='utf-8'?>
<indexedmzML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://psi.hupo.org/ms/mzml" xsi:schemaLocation="http://psi.hupo.org/ms/mzml http://psidev.info/files/ms/mzML/xsd/mzML1.1.2_idx.xsd">
<mzML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://psi.hupo.org/ms/mzml" xsi:schemaLocation="http://psi.hupo.org/ms/mzml http://psidev.info/files/ms/mzML/xsd/mzML1.1.0.xsd" version="1.1.0">
<cvList count="2">
<cv URI="https://raw.githubusercontent.com/HUPO-PSI/psi-ms-CV/master/psi-ms.obo" fullName="PSI-MS" id="PSI-MS" version="4.1.42"/>
<cv URI="http://ontologies.berkeleybop.org/uo.obo" fullName="UNIT-ONTOLOGY" id="UO" version="releases/2019-04-01"/>
</cvList> You can specify a custom URI to load the vocabulary's obo file from, and it will be requested when the CV has to be loaded. If you specify a custom version over a URI, it will simply be rendered in the XML file, having no bearing on the version loaded, as there is no protocol in place for requesting a specific version by URI. |
@bretttully Congratulations on the press on your pre-print on |
My unit tests fail each time the CV obo versions change, is there any way to control which version is used when calling
writer.controlled_vocabularies()
?e.g.
The text was updated successfully, but these errors were encountered: