Comments (14)
Thanks! That's very helpful and works for me.
Since the 'term' and 'typedef' stanzas are structurally very similar, at least in obo, I personally probably would have created a base class from which both the 'Term' class and a similar 'Typedef' class inherit. That would allow catching the remaining properties of the typedefs, such as comments, definitions etc.
None of this, however, is crucial for me now, and might also just be my personal use case. So just go ahead and make a release if you like. Thanks again!
from pronto.
Actually they are extracted from OBO files, and used to instantiate new relationships. They are not however accessible from the Ontology
they were extracted from, which would be a nice feature.
from pronto.
As a test:
>>> import pronto
>>> mondo = pronto.Ontology('http://purl.obolibrary.org/obo/mondo.obo')
>>> mondo['MONDO:0000065'].relations
{Relationship('disease_arises_from_feature'): [<MONDO:0005015: diabetes mellitus (disease)>],
Relationship('is_a'): [<MONDO:0005385 {source="DC:0000281"}: >,
<MONDO:0020573: genetic predisposition to disease>]}
(disease_arises_from_feature
is typedefed in the mondo.obo
file).
from pronto.
from pronto.
Hi Vladimir,
I was talking about this, but I didn't think about the exported OBO, and indeed it will contain no typedefs, which is a problem.
What I think I'll do is adding a typedefs
attribute to Ontology
instances, containing only the typedefs defined in the ontology file. I will then be able to serialized only the referenced typedefs when exporting.
I don't think this will be too complicated to do, so I'll try to work on it this week-end.
from pronto.
from pronto.
It parses them but do not hold them in ontology objects, only as Relationship
instances.
The Turtle parser will probably take more time since I'm not familiar with the format or the available parser libraries.
Exporting ontologies to JSON is already possible, though, using the Ontology.json
property ! 😉 Although it's more of a dump of the internal data representation, and does not follow a specific JSON ontology format (such as obojson).
from pronto.
from pronto.
It's listed on the Ontology reference (http://pronto.readthedocs.io/en/latest/pronto/pronto.Ontology.html#pronto.Ontology.json), but the documentation is not explanatory at all 😊
Basically the JSON should contain all terms referenced by accession, as well as metadata.
from pronto.
from pronto.
Hi there,
I just stumbled over the same issue. Have you managed to have a look at it yet?
I'm using Pronto to import data from ontology files into a database and basically can't establish relationships between terms before adding the corresponding typedefs to the database.
If you don't have the time, I can also offer to have a look at it myself and open a pull request. Let me know.
Cheers,
Christoph
from pronto.
@puethe: I added a typedef
attribute to Ontology
instances, and added a obo
property to the Relationship
class so now exporting an ontology to obo
format will export the [Typedef]
stanzas, and you'll be able to access the typedefs declared in an ontology.
Could you test the master branch a bit to tell me if you need anything before I make a release ?
from pronto.
@puethe : I really wish I had more time to put into this library ! 😉
from pronto.
Fixed in release 0.11.0
.
from pronto.
Related Issues (20)
- Obtain ontology subgraph
- NotImplementedWarning: cannot process plain `owl:AnnotationProperty` cls(self).parse_from(_handle) # type: ignore HOT 1
- cell ontology cl.obo error HOT 1
- ValueError: could not find a parser to parse 'http://purl.obolibrary.org/obo/doid/obo/ext.owl' when parsing human disease ontology HOT 2
- Update requirements for NetworkX HOT 3
- Is there a way to `term.remove_synonym("something")` ? HOT 2
- ValueError: could not find owl:Ontology element HOT 2
- Potential bug | ValueError: identifier already in use when loading MONDO ontology HOT 1
- Feature Request: Support for Python 3.12 HOT 1
- Impossible getting synonym type HOT 4
- Unable to create Pronto object since 2.5.6 (synonyms change)
- How to get cross-references descriptions? HOT 1
- Pronto fails to load OPMI by inferring wrong encoding
- Error processing OWL HOT 1
- Conda installation not downloading latest version and not working with latest version
- Support dangling classes
- isa: DANGLING:123 causes parse error HOT 2
- How to access property_value tags?
- Move to conda-forge
- `ValueError: undeclared synonym type` with version 2.5.7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pronto.