Closed AdrianBZG closed 6 years ago
Potential classes:
Most important attributes: we can assume that the ones given by Summary are the most important ones for each class.
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
HumanMine - Genes class: makes sense to use the fields Organism name, Gene name, and Gene symbol for the faceted search.
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.
@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.
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!
@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:
Mus musculus ... X Homo sapiens ... Y ... and so on
Thanks!
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?
@yochannah Of course! Thank you very much 😄
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);
});
it returns something like this:
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
@yochannah Perfect! Thanks 👍
@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!
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.
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!
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
looks good now
Searching data on HumanMine (issue #3 required)