Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
cmungall committed Apr 24, 2017
1 parent cef898d commit 95b5405
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 55 deletions.
24 changes: 24 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Copyright (c) 2015, Gene Ontology Consortium (http://geneontology.org)
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the Gene Ontology Consortium nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2 changes: 1 addition & 1 deletion ontobio/golr/golr_associations.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Convenience wrapper for golr_query.py
In general you should use the GolrAssociationQuery object directly. This module provide convenience non-OO functions that typically compose the creation of a GolrAssociationQuery object followed by the exec() method.
In general you should use the `GolrAssociationQuery` object directly. This module provide convenience non-OO functions that typically compose the creation of a GolrAssociationQuery object followed by the `exec` method.
"""
import logging
Expand Down
96 changes: 49 additions & 47 deletions ontobio/golr/golr_query.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""
A query wrapper for a Golr instance
---
Intended to work with:
Expand Down Expand Up @@ -213,6 +212,55 @@ class GolrAssociationQuery():
"""
A Query object providing a higher level of abstraction over either GO or Monarch Solr indexes
Fields
------
All of these can be set when creating a new object
fetch_objects : bool
we frequently want a list of distinct association objects (in
the RDF sense). for example, when querying for all phenotype
associations for a gene, it is convenient to get a list of
distinct phenotype terms. Although this can be obtained by
iterating over the list of associations, it can be expensive
to obtain all associations.
Results are in the 'objects' field
fetch_subjects : bool
This is the analog of the fetch_objects field. Note that due
to an inherent asymmetry by which the list of subjects can be
very large (e.g. all genes in all species for "metabolic
process" or "metabolic phenotype") it's necessary to combine
this with subject_category and subject_taxon filters
Results are in the 'subjects' field
slim : List
a list of either class ids (or in future subset ids), used to
map up (slim) objects in associations. This will populate
an additional 'slim' field in each association object corresponding
to the slimmed-up value(s) from the direct objects.
If fetch_objects is passed, this will be populated with slimmed IDs.
evidence: String
Evidence class from ECO. Inference is used.
exclude_automatic_assertions : bool
If true, then any annotations with evidence of ECO:0000501 (IEA) or
subclasses will be excluded.
use_compact_associations : bool
If true, then the associations list will be false, instead
compact_associations contains a more compact representation
consisting of objects with (subject, relation and objects)
"""
def __init__(self,
Expand Down Expand Up @@ -258,52 +306,6 @@ def __init__(self,

"""Fetch a set of association objects based on a query.
Arguments
---------
fetch_objects : bool
we frequently want a list of distinct association objects (in
the RDF sense). for example, when querying for all phenotype
associations for a gene, it is convenient to get a list of
distinct phenotype terms. Although this can be obtained by
iterating over the list of associations, it can be expensive
to obtain all associations.
Results are in the 'objects' field
fetch_subjects : bool
This is the analog of the fetch_objects field. Note that due
to an inherent asymmetry by which the list of subjects can be
very large (e.g. all genes in all species for "metabolic
process" or "metabolic phenotype") it's necessary to combine
this with subject_category and subject_taxon filters
Results are in the 'subjects' field
slim : List
a list of either class ids (or in future subset ids), used to
map up (slim) objects in associations. This will populate
an additional 'slim' field in each association object corresponding
to the slimmed-up value(s) from the direct objects.
If fetch_objects is passed, this will be populated with slimmed IDs.
evidence: String
Evidence class from ECO. Inference is used.
exclude_automatic_assertions : bool
If true, then any annotations with evidence of ECO:0000501 (IEA) or
subclasses will be excluded.
use_compact_associations : bool
If true, then the associations list will be false, instead
compact_associations contains a more compact representation
consisting of objects with (subject, relation and objects)
"""
self.subject_category=subject_category
Expand Down
14 changes: 7 additions & 7 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
prefixcommons>=0.0
pip>=9.0.1
wheel>0.25.0
pysolr>=3.6.0
networkx>=1.11
matplotlib>=0.0
sparqlwrapper>0.0
scipy>=0.0
pysolr=3.6.0
networkx=1.11
matplotlib=2.0.0
SPARQLWrapper=1.8.0
scipy=0.19.0
jsonpickle>=0.0
jsonpath_rw>=0.0
pytest>=0.0
pytest_logging>=0.0
pydotplus>=0.0
cachier>=0.1.26
plotly>0.0
cachier=1.1.8
plotly=2.0.7

0 comments on commit 95b5405

Please sign in to comment.