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

Commit

Permalink
Rolling methods back
Browse files Browse the repository at this point in the history
I'm going to make the `Sequence`/`Join` method changes later.
  • Loading branch information
adamnovak committed Mar 20, 2015
1 parent 2aaf07e commit 2b5c8a6
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 183 deletions.
195 changes: 14 additions & 181 deletions src/main/resources/avro/referencemethods.avdl
Original file line number Diff line number Diff line change
Expand Up @@ -116,18 +116,19 @@ record SearchReferencesRequest {
If present, return only references which belong to this reference set.
*/
union { null, string } referenceSetId = null;

/**
If nonempty, return only `Reference`s on `Sequence`s with IDs in the list.
*/
union { null, string } sequenceIds = [];

/**
If nonempty, return references which match any of the given `md5checksums`.
See `Reference::md5checksum` for details.
*/
array<string> md5checksums = [];

/**
If nonempty, return references that are joined onto references with one of the
specified IDs.
*/
array<string> parentReferenceIds = [];

/**
If nonempty, return references for which the accession
matches this string. Best to give a version number e.g. `GCF_000001405.26`.
Expand Down Expand Up @@ -260,98 +261,25 @@ ListReferenceBasesResponse getReferenceBases(
/** Additional request parameters to restrict the query. */
ListReferenceBasesRequest request) throws GAException;

/****************** /sequences/search *********************/
/**************** /sequence/{id} *******************/
/**
This request maps to the body of `POST /sequences/search` as JSON. Specifies a
number of filters, all of which must be satisfird by each result returned.
*/
record SearchSequencesRequest {
/**
If not null, return only `Sequence`s that appear in the indicated
`ReferenceSet`, or any included `ReferenceSet`s.
*/
union { null, string } referenceSetId = null;

/**
If not null, return only `Sequence`s that are part of the indicated
`VariantSet`
*/
union { null, string } variantSetId = null;

/**
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 /sequences/search` expressed as JSON.
*/
record SearchSequencesResponse {
/**
The list of matching `Sequence`s.
*/
array<org.ga4gh.models.Sequence> sequences = [];

/**
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 `Sequence`s that match the search criteria.
`POST /sequences/search` must accept a JSON version of `SearchSequencesRequest`
as the post body and will return a JSON version of `SearchSequencesResponse`.
*/
SearchSequencesResponse searchSequences(
/**
This request maps to the body of `POST /sequences/search` as
JSON.
*/
SearchSequencesRequest request) throws GAException;

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

/**************** /sequences/{id}/bases *******************/
/**
The query parameters for a request to `GET /sequences/{id}/bases`, for
The query parameters for a request to `GET /sequence/{id}`, for
example:
`GET /sequences/c95d4520-8c63-45f1-924d-6a9604a919fb/bases?start=100&end=200`
`GET /sequence/c95d4520-8c63-45f1-924d-6a9604a919fb?start=100&end=200`
*/
record GetSequenceBasesRequest {
/**
The start position (0-based) of this query. Defaults to 0.
Genomic positions are non-negative integers less than `Sequence` length.
Genomic positions are non-negative integers less than segment length.
Requests spanning the join of circular genomes are represented as
two requests one on each side of the join (position 0).
*/
long start = 0;

/**
The end position (0-based, exclusive) of this query. Defaults
to the length of this `Sequence`.
to the length of this `Segment`.
*/
union { null, long } end = null;

Expand All @@ -363,7 +291,7 @@ record GetSequenceBasesRequest {
union { null, string } pageToken = null;
}

/** The response from `GET /sequences/{id}/bases` expressed as JSON. */
/** The response from `GET /sequence/{id}` expressed as JSON. */
record GetSequenceBasesResponse {
/**
The offset position (0-based) of the returned string in the sequence. This
Expand All @@ -386,8 +314,8 @@ record GetSequenceBasesResponse {
}

/**
Lists bases by sequence ID and optional range. `GET /sequences/{id}/bases` will
return a JSON version of `GetSequenceBasesResponse`. Works for sequences with
Lists bases by sequence ID and optional range. `GET /sequence/{id}` will return
a JSON version of `GetSequenceBasesResponse`. Works for sequences with
associated `Reference`s, as well as novel sequences that come with
`VariantSet`s.
*/
Expand All @@ -397,99 +325,4 @@ GetSequenceBasesResponse getSequenceBases(
/** Additional request parameters to restrict the query. */
GetSequenceBasesRequest request) throws GAException;

/**************** /joins/search *******************/
/**
This request maps to the body of `POST /joins/search` as JSON. Specifies a
number of filters, all of which must be satisfird by each result returned.
*/
record SearchJoinsRequest {
/**
If present, return only `Join`s which belong to this reference set.
*/
union { null, string } referenceSetId = null;

/**
If present, return only `Join`s which belong to this variant set.
*/
union { null, string } variantSetId = null;

// TODO: Specify a proper sort of filter object instead of this. We want to be
// able to support a list of sequences, but also a single sequence and a
// range.

/**
If nonempty, return only `Join`s with at least one `Side` on one of these
sequences.
*/
array<string> sequenceIds = [];

/**
Must not contain more entries than `sequenceIds`.
Return only `Join`s with at least one `Side` on the corresponding sequence
in `sequenceIds` at this index in the sequence or later.
*/
array<long> starts = [];

/**
Must not contain more entries than `starts`.
Return only `Join`s with at least one `Side` on the corresponding sequence
in `sequenceIds` at or earlier than this many bases forward from the
corresponding entry in `starts`.
*/
array<long> lengths = [];

/**
Must not contain more entries than `sequenceIds`.
Return only `Join`s which join onto the corresponding sequence in
`sequenceIds`, in the interval specified by the corresponding entries in
`starts` and `lengths` (if present), to the strand specified by each entry in
`strands`.
*/
array<org.ga4gh.models.Strand> strands = [];

/**
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 /joins/search` expressed as JSON.
*/
record SearchJoinsResponse {
/** The list of matching joins. */
array<org.ga4gh.models.Join> joins = [];

/**
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 `Join` matching the search criteria.
`POST /joins/search` must accept a JSON version of
`SearchJoinsRequest` as the post body and will return a JSON
version of `SearchJoinsResponse`.
*/
SearchJoinsResponse searchJoins(
/**
This request maps to the body of `POST /joins/search`
as JSON.
*/
SearchJoinsRequest request) throws GAException;
}
86 changes: 84 additions & 2 deletions src/main/resources/avro/variantmethods.avdl
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,89 @@ SearchVariantSetsResponse searchVariantSets(
/** This request maps to the body of `POST /variantsets/search` as JSON. */
SearchVariantSetsRequest request) throws GAException;


/****************** /variantsets/{id}/sequences/search *********************/
/**
This request maps to the body of `POST /variantsets/{id}/sequences/search` as
JSON.
*/
record SearchVariantSetSequencesRequest {
/**
If nonempty, return `Segment`s describing novel sequences in the `VariantSet`
that are joined onto sequences with one of the specified IDs.
*/
array<string> parentIds = [];

/**
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 /variantsets/{id}/sequences/search` expressed as
JSON.
*/
record SearchVariantSetSequencesResponse {
/**
The list of `Segment`s for matching sequences from the novel sequence graph
for the `VariantSet`.
*/
array<org.ga4gh.models.Segment> segments = [];

/**
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 `Segment`s covering the sequences that match the search criteria.
`POST /variantsets/{id}/sequences/search` must accept a JSON version of
`SearchVariantSetSequencesRequest` as the post body and will return a JSON
version of `SearchVariantSetSequencesResponse`.
*/
SearchVariantSetSequencesResponse searchVariantSetSequences(
/**
The ID of the `VariantSet` which provides the novel sequences.
*/
string variantSetId,
/**
This request maps to the body of `POST variantsets/{id}/sequences/search` as
JSON.
*/
SearchVariantSetSequencesRequest request) throws GAException;

/***************** /variantsets/{id}/sequences/{id} *******************/
/**
Gets a `Segment` describing a novel sequence in a `VariantSet`, by sequence
ID.
`GET /variantsets/{id}/sequences/{id}` will return a JSON version of a `Segment`
covering the novel sequence with the given ID, and describing where it is
joined onto its parent sequences.
*/
org.ga4gh.models.Segment getVariantSetSequence(
/**
The ID of the `VariantSet` which provides the novel sequence.
*/
string variantSetId,
/**
The ID of the novel sequence to get a covering `Segment` for.
*/
string sequenceId) throws GAException;

/****************** /variants/search *********************/
/** This request maps to the body of `POST /variants/search` as JSON. */
record SearchVariantsRequest {
Expand Down Expand Up @@ -137,8 +220,7 @@ as the post body and will return a JSON version of `SearchVariantsResponse`.
SearchVariantsResponse searchVariants(
/** This request maps to the body of `POST /variants/search` as JSON. */
SearchVariantsRequest request) throws GAException;

/**************** /variants/{id} *******************/
/**************** /variants/{id} *******************/
/**
Gets a `Variant` by ID.
`GET /variants/{id}` will return a JSON version of `Variant`.
Expand Down

0 comments on commit 2b5c8a6

Please sign in to comment.