AdrianBZG / InterMine-Data-Browser-Tool

InterMine Data Browser: a tool for exploring semi-homogeneous biological datasets
http://data-browser.apps.intermine.org/
Other
4 stars 38 forks source link

Searching data on HumanMine (issue #3 required) #8

Closed AdrianBZG closed 6 years ago

AdrianBZG commented 6 years ago

Searching data on HumanMine (issue #3 required)

AdrianBZG commented 6 years ago

Potential classes:

AdrianBZG commented 6 years ago

Most important attributes: we can assume that the ones given by Summary are the most important ones for each class.

yochannah commented 6 years ago

To fetch summary fields using im.js, you just need to create a service, then run fetchSummaryFields() on the service object, like this:

      var service = new imjs.Service({
         root: 'http://www.flymine.org/flymine/service'
     });
      service.fetchSummaryFields().then(function(response) {
        console.log(response)
      });

Working demo: http://jsbin.com/vipujej/edit?html,console

AdrianBZG commented 6 years ago

Whitelist for classes: https://github.com/intermine/bluegenes/blob/44777459217c51bfbac24fde6a26d818dfdb1122/src/cljc/bluegenes/whitelist.cljc#L3

AdrianBZG commented 6 years ago

HumanMine - Genes class: makes sense to use the fields Organism name, Gene name, and Gene symbol for the faceted search.

AdrianBZG commented 6 years ago

HumanMine - Proteins class: makes sense to use the field Organism name for the faceted search. Primary identifier and primary accession seem to be unique, so it doesn't make sense to use them as a filter.

AdrianBZG commented 6 years ago

@yochannah About my latest two comments to this issue, what do you think? With faceted search I mean, for instance, the boxes at the left that you can see in https://dcc.icgc.org/search.

yochannah commented 6 years ago

Hmmm, there isn't any easy way to tell this from the model. For Genes - name and symbol mostly unique, so they probably don't need be sidebar filters. Organism will always be interesting as a filter. I'll ask the team on monday morning if there are any other facets that they think might be interesting!

AdrianBZG commented 6 years ago

@yochannah Thanks! Also, do you know a way (using IMjs maybe), to query for the number of elements per value on a certain attribute of a class? Basically, what I want is what you can see in the following screenshot:

image

Mus musculus ... X Homo sapiens ... Y ... and so on

Thanks!

yochannah commented 6 years ago

given any single query you can request a count of results like this: https://codepen.io/yochannah/pen/YLBGwa?editors=1012 but I'm not sure if that's what imtables is doing in the screenshot - it might be doing something a little bit smarter that doesn't require multiple http requests. I'll try to have a look when I'm at work tomorrow (pm, probably, since we have a team meeting in the morning) if you can wait 'til then?

AdrianBZG commented 6 years ago

@yochannah Of course! Thank you very much 😄

yochannah commented 6 years ago

I was right! It took some sleuthing, but here you go: https://codepen.io/yochannah/pen/MGLqyY?editors=1010

var service = new imjs.Service({
  root: "https://yeastmine.yeastgenome.org/yeastmine/service"
});
var query = {
  from: "Gene",
  select: ["primaryIdentifier"],
  model: {name : "genomic"}
};

var q = new imjs.Query(query,service);

q.summarize("Gene.homologues.homologue.organism.shortName")
  .then(function(response) {
  console.log(response);
});
yochannah commented 6 years ago

it returns something like this: image

yochannah commented 6 years ago

The docs aren't always the most useful, but here is the reference for the summarise method: http://alexkalderimis.github.io/imjs/classes/Query.html#summarise-instance

AdrianBZG commented 6 years ago

@yochannah Perfect! Thanks 👍

AdrianBZG commented 6 years ago

@yochannah One question, if you take a look at the right side bar in http://im-browser-prototype.herokuapp.com/, and click on Organism short names for instance, it displays each organism and the number of instances with that organism (currently is just a placeholder). My main concern is the following:

Thanks!

yochannah commented 6 years ago

Looking good! I think we like top 5 elements for organism, but probably we don't need gene name as a filter on the left.

AdrianBZG commented 6 years ago

Hi @yochannah , the filter by organism name is working, if you have some time can you please check it and tell me if I can close this issue?

http://im-browser-prototype.herokuapp.com

Thanks!

yochannah commented 6 years ago

The way the left filter works is great! it should probably be more integrated with the pie chart though - see https://github.com/AdrianBZG/InterMine-Data-Browser-Tool/issues/24

yochannah commented 6 years ago

looks good now