Skip to content
This repository has been archived by the owner on Oct 28, 2022. It is now read-only.

proposed sequence annotation API #246

Merged
merged 1 commit into from
Mar 30, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions src/main/resources/avro/common.avdl
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,70 @@ record Path {
array<Segment> segments = [];
}

/**
An abstraction for referring to a genomic region, in relation to some already
known reference. This will require some significant rework as we move to graph
coordinates.
*/
// TODO: Add support for paths through the graph.
record Region {
/**
The starting point of the region. For the moment the base-pair included in
the region, on the 5' end of the oriented region.
*/
Position start;

/**
The length, in base pairs
*/
long length;
}

/**
An ontology term describing an attribute. (e.g. the phenotype attribute
'polydactyly' from HPO)
*/

record OntologyTerm {
/**
The source of the onotology term.
(e.g. `Ontology for Biomedical Investigation`)
*/
string ontologySource;

/**
The ID defined by the external onotology source.
(e.g. `http://purl.obolibrary.org/obo/OBI_0001271`)
*/
string id;

/** The name of the onotology term. (e.g. `RNA-seq assay`) */
union { null, string } name = null;
}

/**
Identifier from a public database
*/
record ExternalIdentifier {
/**
The source of the identifier.
(e.g. `Ensembl`)
*/
string database;

/**
The ID defined by the external database.
(e.g. `ENST00000000000`)
*/
string identifier;

/**
The version of the object or the database
(e.g. `78`)
*/
string version;
}

/**
An enum for the different types of CIGAR alignment operations that exist.
Used wherever CIGAR alignments are used. The different enumerated values
Expand Down
23 changes: 1 addition & 22 deletions src/main/resources/avro/metadata.avdl
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,7 @@ This protocol defines metadata used in the other GA4GH protocols.
protocol Metadata {

import idl "common.avdl";

/**
An ontology term describing an attribute. (e.g. the phenotype attribute
'polydactyly' from HPO)
*/

record OntologyTerm {
/**
The source of the onotology term.
(e.g. `Ontology for Biomedical Investigation`)
*/
string ontologySource;

/**
The ID defined by the external onotology source.
(e.g. `http://purl.obolibrary.org/obo/OBI_0001271`)
*/
string id;

/** The name of the onotology term. (e.g. `RNA-seq assay`) */
union { null, string } name = null;
}
import idl "ontologies.avdl";

/**
An individual (or subject) typically corresponds to an individual
Expand Down
2 changes: 0 additions & 2 deletions src/main/resources/avro/methods.avdl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,4 @@ error GAException {
int errorCode = -1;
}



}
26 changes: 26 additions & 0 deletions src/main/resources/avro/ontologies.avdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
@namespace("org.ga4gh.models")
/**
Protocol that defines types associated with ontologies.
*/
protocol Ontologies {
/**
An ontology term describing an attribute. (e.g. the phenotype attribute
'polydactyly' from HPO)
*/
record OntologyTerm {
/**
The source of the onotology term.
(e.g. `Ontology for Biomedical Investigation`)
*/
string ontologySource;

/**
The ID defined by the external onotology source.
(e.g. `http://purl.obolibrary.org/obo/OBI_0001271`)
*/
string id;

/** The name of the onotology term. (e.g. `RNA-seq assay`) */
union { null, string } name = null;
}
}
97 changes: 97 additions & 0 deletions src/main/resources/avro/sequenceAnnotationmethods.avdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
@namespace("org.ga4gh.methods")

protocol SequenceAnnotationMethods {

import idl "common.avdl";
import idl "methods.avdl";
import idl "sequenceAnnotations.avdl";

// FIXME: wiggle methods not defined.

/****************** /features/search *********************/

/**
This request maps to the body of `POST /features/search` as JSON.
*/
record SearchFeaturesRequest {
/**
The annotation sets to search within. Either `featureSetIds` or
`parentIds` must be non-empty.
*/
array<string> featureSetIds = [];

/**
Restricts the search to direct children of the given parent `feature`
IDs. Either `featureSetIds` or `parentIds` must be non-empty.
*/
array<string> parentIds = [];

/**
If specified, this query matches only annotations which overlap this path.
*/
union { null, org.ga4gh.models.Path } range = null;

// TODO: Fix this field. Clarify semantics around how OntologyTerm matching works, or
// change the Ontology term field on the feature.
/**
If specified, this query matches only annotations which match one of the
provided feature types.
*/
array<org.ga4gh.models.OntologyTerm> features = [];

/**
Specifies the maximum number of results to return in a single page.
If unspecified, a system default will be used.
*/
union { null, int } pageSize = null;

/**
The continuation token, which is used to page through large result sets.
To get the next page of results, set this parameter to the value of
`nextPageToken` from the previous response.
*/
union { null, string } pageToken = null;
}

/** This is the response from `POST /features/search` expressed as JSON. */
record SearchFeaturesResponse {
/**
The list of matching annotations, sorted by start position. Annotations which
share a start position are returned in a deterministic order.
*/
array<org.ga4gh.models.Feature> features = [];

/**
The continuation token, which is used to page through large result sets.
Provide this value in a subsequent request to return the next page of
results. This field will be empty if there aren't any additional results.
*/
union { null, string } nextPageToken = null;
}

/**
Gets a list of `Feature` matching the search criteria.

`POST /features/search` must accept a JSON version of
`SearchFeaturesRequest` as the post body and will return a JSON version of
`SearchFeaturesResponse`.
*/
SearchFeaturesResponse searchFeatures(
/** This request maps to the body of `POST /features/search` as JSON. */
SearchFeaturesRequest request) throws GAException;


/**************** /feature/{id} *******************/
/**
Gets a `org.ga4gh.models.Feature` by ID.
`GET /feature/{id}` will return a JSON version of `Feature`.
*/
org.ga4gh.models.Feature getFeature(
/**
The ID of the `Feature`.
*/
string id) throws GAException;

}

// TODO: AnnotationSet methods.
Loading