Skip to content

Commit

Permalink
Removed the use of crossComparisonView and active in config
Browse files Browse the repository at this point in the history
  • Loading branch information
yuanzhou committed Apr 12, 2016
1 parent ddd9355 commit b259d7d
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 154 deletions.
16 changes: 3 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,21 +79,15 @@ var data = {
"xAxis": [
{
"groupId": "9606",
"groupName": "Homo sapiens",
"crossComparisonView": false,
"active": true
"groupName": "Homo sapiens"
},
{
"groupId": "10090",
"groupName": "Mus musculus",
"crossComparisonView": true,
"active": true
"groupName": "Mus musculus"
},
{
"groupId": "7955",
"groupName": "Danio rerio",
"crossComparisonView": true,
"active": true
"groupName": "Danio rerio"
}
],
"yAxis": [
Expand Down Expand Up @@ -317,10 +311,6 @@ This URL should be pointed to the OWLSim URL server associated with your install

It is a Javascript object that contains all the target and source data to be rendered in the grid.

This option allows you to specify the set of target groups (i.e., species) that will be visible throughout Phenogrid. There are two parameters which allow you to control whether a target group is displayed as a default in the multi-target comparison view, `crossComparisonView` and whether it should be active, `active = true`, and thus fully visible within phenogrid. If `crossComparisonView = true`, for example, the target group will be visible as a default within the multi-target comparison view. For example, by default the following targets will be visible upon loading phenogrid (active must be set to true):

The `active` parameter can override other parameters, but activating or deactivating a target group. For example, if the `active = false`, then the target group is not active within phenogrid and is not shown in comparison nor is it a selectable option from the menu. This is useful, if you not longer want that target group to be displayed within phenogrid and would like to retain the target group reference within the list. For example, the following are not active and will not be visible within phenogrid:

### `selectedSort` string | optional

The different ways that the sources (e.g., phenotypes) can be sorted. The sources that are shown on the left side of the grid may be sorted using one of three methods.
Expand Down
70 changes: 23 additions & 47 deletions dist/phenogrid-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -2047,7 +2047,7 @@ var images = require('./images.json');
selectedCalculation: 0, // index 0 is Similarity by default. (0 - Similarity, 1 - Ratio (q), 2 - Uniqueness, 3- Ratio (t))
selectedSort: "Frequency", // sort method of sources: "Alphabetic", "Frequency and Rarity", "Frequency"
messaging: {
misconfig: 'Please fix your config to enable at least one target group.',
misconfig: 'Please fix your config to have at least one target group.',
gridSkeletonDataError: 'No phenotypes to compare.',
noAssociatedGenotype: 'This gene has no associated genotypes.',
noSimSearchMatchForExpandedGenotype: 'No matches found between the provided phenotypes and expanded genotypes.',
Expand Down Expand Up @@ -2176,14 +2176,6 @@ var images = require('./images.json');
// this.options overwrites this.configoptions overwrites this.config overwrites this.internalOptions
this.state = $.extend({}, this.internalOptions, this.config, this.configoptions, this.options);

// There are two parameters which allow you to control whether a target group is displayed
// as a default in the multi-target comparison view, crossComparisonView and whether it should be active, active = true,
// and thus fully visible within phenogrid. If crossComparisonView = true, for example,
// the target group will be visible as a default within the multi-target comparison view.
// The active parameter can override other parameters, but activating or deactivating a target group.
// For example, if the active = false, then the target group is not active within phenogrid and is not shown in comparison
// nor is it a selectable option from the menu. This is useful, if you not longer want that target group to be
// displayed within phenogrid and would like to retain the target group reference within the list. - MD
// taxon is used by dataLoader to specify 'target_species' in query URL - Joe
this.state.targetGroupList = [];

Expand Down Expand Up @@ -2224,7 +2216,6 @@ var images = require('./images.json');
this._initGridSkeletonDataForVendor();
} else {
// Load data from compare API for geneList
// in compare mode, there's no crossComparisonView - Joe
if (this.state.owlSimFunction === 'compare' && this.state.geneList.length !== 0) {
this._initCompare();
} else if (this.state.owlSimFunction === 'search' && this.state.targetSpecies !== '') {
Expand Down Expand Up @@ -2255,12 +2246,12 @@ var images = require('./images.json');
_initGridSkeletonData: function() {
// Compose the target group list based on gridSkeletonData.xAxis
for (var j = 0; j < this.state.gridSkeletonData.xAxis.length; j++) {
// E.g., {groupName: "Homo sapiens", groupId: "9606", crossComparisonView: true, active: true}
// E.g., {groupName: "Homo sapiens", groupId: "9606"}
this.state.targetGroupList.push(this.state.gridSkeletonData.xAxis[j]);
}

// load the target targetGroup list based on the active flag
this._parseTargetGroupList(false);
// load the target targetGroup list
this._parseTargetGroupList();

// initialize data processing class for simsearch query
this.state.dataLoader = new DataLoader(this.state.serverURL, this.state.simSearchQuery);
Expand All @@ -2275,11 +2266,11 @@ var images = require('./images.json');
// overwrite the this.state.targetGroupList with only 'compare'
// this 'compare' is used in dataLoader.loadCompareData() and dataManager.buildMatrix() too - Joe
this.state.targetGroupList = [
{groupName: "compare", groupId: "compare", crossComparisonView: true, active: true}
{groupName: "compare", groupId: "compare"}
];

// load the target targetGroup list based on the active flag
this._parseTargetGroupList(false);
// load the target targetGroup list
this._parseTargetGroupList();

// initialize data processing class for compare query
this.state.dataLoader = new DataLoader(this.state.serverURL, this.state.compareQuery);
Expand All @@ -2296,22 +2287,22 @@ var images = require('./images.json');
// overwrite the this.state.targetGroupList by enabling Homo sapiens, Mus musculus, and Danio rerio - Joe
this.state.targetGroupList = [
// Because only the three group are supported in monarch analyze/phenotypes page at this point - Joe
{groupName: "Homo sapiens", groupId: "9606", crossComparisonView: true, active: true},
{groupName: "Mus musculus", groupId: "10090", crossComparisonView: true, active: true},
{groupName: "Danio rerio", groupId: "7955", crossComparisonView: true, active: true},
// Disabled group
{groupName: "Drosophila melanogaster", groupId: "7227", crossComparisonView: false, active: false},
{groupName: "Caenorhabditis elegans", groupId: "6239", crossComparisonView: false, active: false},
{groupName: "UDPICS", groupId: "UDPICS", crossComparisonView: false, active: false}
{groupName: "Homo sapiens", groupId: "9606"},
{groupName: "Mus musculus", groupId: "10090"},
{groupName: "Danio rerio", groupId: "7955"}
// Disabled groups
//{groupName: "Drosophila melanogaster", groupId: "7227"},
//{groupName: "Caenorhabditis elegans", groupId: "6239"},
//{groupName: "UDPICS", groupId: "UDPICS"}
];

// load the target targetGroup list based on the active flag
this._parseTargetGroupList(false);
// load the target targetGroup list
this._parseTargetGroupList();
} else {
// when single group is selected (taxon is passed in via this.state.targetSpecies)
// load just the one selected from the dropdown menu - Joe
if (this.state.targetGroupList[idx].groupId === this.state.targetSpecies) {
this._parseTargetGroupList(true);
this._parseTargetGroupList();
}
}

Expand All @@ -2326,12 +2317,12 @@ var images = require('./images.json');
_initGridSkeletonDataForVendor: function() {
// Compose the target group list based on gridSkeletonData.xAxis
for (var j = 0; j < this.state.gridSkeletonData.xAxis.length; j++) {
// E.g., {groupName: "Homo sapiens", groupId: "9606", crossComparisonView: true, active: true}
// E.g., {groupName: "Homo sapiens", groupId: "9606"}
this.state.targetGroupList.push(this.state.gridSkeletonData.xAxis[j]);
}

// load the target targetGroup list based on the active flag
this._parseTargetGroupList(false);
// load the target targetGroup list
this._parseTargetGroupList();

// initialize data processing class for compare query
this.state.dataLoader = new DataLoader(this.state.serverURL, this.state.compareQuery);
Expand All @@ -2349,25 +2340,10 @@ var images = require('./images.json');
},

// when not work with monarch's analyze/phenotypes page
// this can be single group mode or cross comparison mode depends on the config
// load the default selected target targetGroup list based on the active flag in config,
// has nothing to do with the monarch's analyze phenotypes page - Joe
_parseTargetGroupList: function(forSingleTargetGroup) {
_parseTargetGroupList: function() {
for (var idx in this.state.targetGroupList) {
if (forSingleTargetGroup === true) {
this.state.initialTargetGroupLoadList.push(this.state.targetGroupList[idx]);
this.state.selectedCompareTargetGroup.push(this.state.targetGroupList[idx]);
} else {
// for active targetGroup pre-load them
if (this.state.targetGroupList[idx].active) {
this.state.initialTargetGroupLoadList.push(this.state.targetGroupList[idx]);
}
// should they be shown in the comparison view
// crossComparisonView matters only when active = true - Joe
if (this.state.targetGroupList[idx].active && this.state.targetGroupList[idx].crossComparisonView) {
this.state.selectedCompareTargetGroup.push(this.state.targetGroupList[idx]);
}
}
this.state.initialTargetGroupLoadList.push(this.state.targetGroupList[idx]);
this.state.selectedCompareTargetGroup.push(this.state.targetGroupList[idx]);
}

// Then we init the flag obj for group target item (genotype) expansion
Expand Down
8 changes: 0 additions & 8 deletions impc.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
{
"groupId": "IMPC1",
"groupName": "Group 1",
"crossComparisonView": true,
"active": true,
"entities": [
{
"id": "11042111",
Expand Down Expand Up @@ -212,8 +210,6 @@
{
"groupId": "IMPC2",
"groupName": "Group 2",
"crossComparisonView": true,
"active": true,
"entities": [
{
"id": "11042",
Expand Down Expand Up @@ -1090,8 +1086,6 @@
{
"groupId": "IMPC3",
"groupName": "Group 3",
"crossComparisonView": true,
"active": true,
"entities": [
{
"id": "1042",
Expand Down Expand Up @@ -2161,8 +2155,6 @@
{
"groupId": "IMPC",
"groupName": "Mus musculus model",
"crossComparisonView": true,
"active": true,
"entities": [
{
"id": "11042111",
Expand Down
52 changes: 13 additions & 39 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -207,21 +207,15 @@
"xAxis": [
{
"groupId": "9606",
"groupName": "Homo sapiens",
"crossComparisonView": true,
"active": true
"groupName": "Homo sapiens"
},
{
"groupId": "10090",
"groupName": "Mus musculus",
"crossComparisonView": true,
"active": true
"groupName": "Mus musculus"
},
{
"groupId": "7955",
"groupName": "Danio rerio",
"crossComparisonView": true,
"active": true
"groupName": "Danio rerio"
}
],
"yAxis": yAxis
Expand All @@ -244,21 +238,15 @@
"xAxis": [
{
"groupId": "9606",
"groupName": "Homo sapiens",
"crossComparisonView": true,
"active": true
"groupName": "Homo sapiens"
},
{
"groupId": "10090",
"groupName": "Mus musculus",
"crossComparisonView": true,
"active": true
"groupName": "Mus musculus"
},
{
"groupId": "7955",
"groupName": "Danio rerio",
"crossComparisonView": false,
"active": false
"groupName": "Danio rerio"
}
],
"yAxis": yAxis
Expand All @@ -276,21 +264,15 @@
"xAxis": [
{
"groupId": "9606",
"groupName": "Homo sapiens",
"crossComparisonView": false,
"active": true
"groupName": "Homo sapiens"
},
{
"groupId": "10090",
"groupName": "Mus musculus",
"crossComparisonView": false,
"active": true
"groupName": "Mus musculus"
},
{
"groupId": "7955",
"groupName": "Danio rerio",
"crossComparisonView": false,
"active": true
"groupName": "Danio rerio"
}
],
"yAxis": [
Expand All @@ -312,27 +294,19 @@
"xAxis": [
{
"groupId": "9606",
"groupName": "Homo sapiens",
"crossComparisonView": true,
"active": true
"groupName": "Homo sapiens"
},
{
"groupId": "10090",
"groupName": "Mus musculus",
"crossComparisonView": true,
"active": true
"groupName": "Mus musculus"
},
{
"groupId": "7955",
"groupName": "Danio rerio",
"crossComparisonView": true,
"active": true
"groupName": "Danio rerio"
},
{
"groupId": "7227",
"groupName": "Drosophila melanogaster",
"crossComparisonView": true,
"active": true
"groupName": "Drosophila melanogaster"
}
],
"yAxis": yAxis
Expand Down
Loading

0 comments on commit b259d7d

Please sign in to comment.