legumeinfo / microservices

A collection of microservices developed and maintained by the Legume Information System
https://legumeinfo.org/
Apache License 2.0
3 stars 2 forks source link

Linkout methods for collections #604

Open StevenCannon-USDA opened 1 year ago

StevenCannon-USDA commented 1 year ago

I would like to request additional linkout methods to generate links to data collections at the Mines and at the Datastore. This would be be used at least for queries for genetic (qtl and gwas) studies (for which @That-Thing has web component implementations, sans linkouts).

Possibly these could be handled under a single method - but the parameters are not identical. For example InterMine has "qtlstudy" and the Data Store has "qtl". Note my (likely very suboptimal) use of "MINE_DATA_TYPE" and "DATA_TYPE". A mine wouldn't need to know the species, but the Data Store does. So, at least initially, I'll suggest two separate methods -- one linking to mine pages and one to the Datastore.

collection_linkouts:
  MINE_DATA_TYPE: gwas
  GENUS: glycine
  COLLECTION_NAME: mixed.gwas.Cao_Li_2017
  Returns: https://mines.legumeinfo.org/glycinemine/gwas:mixed.gwas.Cao_Li_2017

  MINE_DATA_TYPE: qtlstudy
  GENUS: glycine
  COLLECTION_NAME: 0518BW-8_x_0734BW-1.qtl.Oyoo_Benitez_2011
  Returns: https://mines.legumeinfo.org/glycinemine/qtlstudy:0518BW-8_x_0734BW-1.qtl.Oyoo_Benitez_2011

  -
    method: GET
    href: https://mines.legumeinfo.org/glycinemine/{DATA_TYPE}:{COLLECTION_NAME}
    text: "View {COLLECTION_NAME} in LegumeMine"

datastore_linkouts:
  DATA_TYPE: gwas
  GENUS: Glycine
  SPECIES: max
  COLLECTION_NAME: mixed.gwas.Cao_Li_2017
  Returns: https://data.legumeinfo.org/Glycine/max/gwas/mixed.gwas.Cao_Li_2017

  DATA_TYPE: qtl
  COLLECTION_NAME: 0518BW-8_x_0734BW-1.qtl.Oyoo_Benitez_2011
  Returns: https://data.legumeinfo.org/Glycine/max/qtl/0518BW-8_x_0734BW-1.qtl.Oyoo_Benitez_2011

  -
    method: GET
    href: https://data.legumeinfo.org/{GENUS}/{SPECIES}/{DATA_TYPE}/{COLLECTION_NAME}
    text: "View {COLLECTION_NAME} in the LIS/SoyBase/PeanutBase Data Store"

@alancleary @adf-ncgr @sammyjava @That-Thing @ctcncgr

alancleary commented 1 year ago

I think adding gwas and qtlstudy endpoints to the linkouts microservice would be the way to go here. This service is owned by @adf-ncgr so it's ultimately up to him.

sammyjava commented 1 year ago

It's a little odd to call it "linkouts" when it's a well-defined single mine link per object, like for a GWAS mixed.gwas.Cao_Li_2017 in GlycineMine. But I don't feel strongly about how it's implemented.

Seems to me to make more sense to generate the mine link using a function in web-components using the syntax you provided:

    parameters: { mine, class, collection }
    href: https://mines.legumeinfo.org/{lower(mine)}/{lower(class)}:{collection}
    text: "View {class} {collection} in {mine}"

Example input:

{
"mine": "GlycineMine",
"class": "GWAS",
"collection": "mixed.gwas.Cao_Li_2017",
}

returns output:

{
"url": "https://mines.legumeinfo.org/glycinemine/gwas:mixed.gwas.Cao_Li_2017",
"text": "View GWAS collection mixed.gwas.Cao_Li_2017 in GlycineMine",
}
adf-ncgr commented 1 year ago

@sammyjava that's an interesting alternative approach, and might be perfectly suitable; I also don't have strong opinions here, although I could imagine there being other links for some of these datatypes (e.g. GWAS and qtlstudy could both link into ZZBrowse, at least in theory; and this might need to be specified on a per-collection basis since some collections might not be loaded there for one reason or another). FWIW, since LINKOUT services use the datastore-metadata structure, they ought to be able to specify a datastore link for a collection without any additional info needed (I think). I think I probably lean towards extending the suite of services, along the lines @alancleary indicated, if only to have a consistent way of doing such things.

StevenCannon-USDA commented 1 year ago

I don't have an opinion about the merits - which seem to be about relative levels of simplicity and consistency in the two approaches. However, I WOULD like to get a method in place - and search tools into production! (Gene search still isn't.) In the interest in moving things forward, I'll recommend for @That-Thing to try extending the linkouts code per Alan's suggestion ("adding gwas and qtlstudy endpoints to the linkouts microservice"). If there are difficulties and it looks like plain, direct links make more sense (along the lines of @sammyjava's suggestion), then that will be fine with me.

adf-ncgr commented 1 year ago

Sounds good to me. And agreed that getting search tools into production ASAP should be a priority...