biolink-api icon indicating copy to clipboard operation
biolink-api copied to clipboard

create route for Genome Features / Variants that aligns with current Apollo track / variant services

Open nathandunn opened this issue 6 years ago • 6 comments

  • align gene, etc. https://github.com/biolink/biolink-api/blob/master/biolink/datamodel/serializers.py#L177-L224 . to correspond to Apollo web-services output (which should correspond to JBrowse, as well)
  • add corresponding biolink api routes.
    • /biotentity/gene/{id}/features
    • /biotentity/gene/{location}/features (location has organism, chromosome, min / max)
    • /biotentity/variant/{id}/features
    • /biotentity/variant/{location}/features (location has organism, chromosome, min / max)
  • instead of Alliance and Monarch pointing to apollo, it points to the Monarch API against these routes

From a long ago discussion with @cmungall and a more recent discussion with @deepakunni3

I think it would have to come after this: https://github.com/biolink/biolink-api/issues/154 if it is related (maybe not).

nathandunn avatar Mar 22 '18 21:03 nathandunn

@nathandunn

Proposed endpoints:

  • /apollo/{organism}/{track_name}/gene/{id} - query based on gene uniquename

  • /apollo/{organism}/{track_name}/transcript/{id} - query based on transcript uniquename

  • /apollo/{organism}/{track_name}/variant/{id}- query based on variant name (perhaps rsID?). But this will be too prohibitive since querying for a variant by ID from a VCF can take a long time. If the variant is in Apollo's database then it can be an easy query.

  • /apollo/{organism}/{track_name}/feature/{id} - query based on a feature's uniquename (a more generic query)

  • /apollo/{organism}/{track_name}/{location}/genes - query based on location and get all genes that fall within that location

  • /apollo/{organism}/{track_name}/{location}/transcripts - query based on location and get all transcripts that fall within that location

  • /apollo/{organism}/{track_name}/{location}/variants - query based on location and get all variants that fall within that location

  • /apollo/{organism}/{track_name}/{location}/features - query based on location and get all Apollo features that fall within that location (a more generic query)

I am leaning to /apollo/ instead of /bioentity/ in the path to highlight what a call to these endpoints signify. Also, there are several calls in bioentity namespace that slightly overlaps in meaning but they query Monarch GOlr.

A separate apollo namespace might help in separating calls specific to an external instance, like Apollo.

EDIT: I just realized the Track Services endpoints in Apollo require organism and track names too.

deepakunni3 avatar Apr 05 '18 20:04 deepakunni3

@deepakunni3 I see. I'm wondering if we should call /apollo/ -> /genome-feature/. In theory anything could provide that end-point.

Otherwise, I think this is good. Also, how would you specify organism or can we assume global uniqueness?

nathandunn avatar Apr 05 '18 20:04 nathandunn

I just updated the above endpoints.

There is already a genome/features namespace. I'll check with @cmungall and see if we can add it there.

deepakunni3 avatar Apr 05 '18 21:04 deepakunni3

I think the original plan was to have me update those end-points to more closely reflect Apollo.

One additional thought is that I think you also need to have the track name, as well (or have it choose a default track if none are provided, or lookup tracks, etc.) as genes may be reproduced multiple times on differing tracks.

nathandunn avatar Apr 05 '18 21:04 nathandunn

@nathandunn Had a brief discussion with @cmungall

Yes, a configurable default set of tracks would make sense if no track name is provided. Also, we should add an endpoint in Apollo for getting all available tracks for an organism which biolink-api can use to query (i.e. look up tracks, like you suggested). Perhaps the response JSON from biolink-api can contain the track metadata to signify from which tracks a feature (or a set of features) originates from, for sake of provenance and filtering.

deepakunni3 avatar Apr 05 '18 21:04 deepakunni3

@deepakunni3 added the PR

nathandunn avatar Apr 05 '18 22:04 nathandunn