Skip to content
Snippets Groups Projects
Commit 9d3466e0 authored by juanf's avatar juanf
Browse files

SSDM-175: additional features for Bodenmiller's antibody panel

SVN: 31382
parent 70425586
No related branches found
No related tags found
No related merge requests found
...@@ -312,6 +312,38 @@ function ServerFacade(openbisServer) { ...@@ -312,6 +312,38 @@ function ServerFacade(openbisServer) {
}); });
} }
this.searchWithTypeAndLinks = function(sampleType, sampleCode, callbackFunction)
{
var matchClauses = [ {"@type":"AttributeMatchClause",
fieldType : "ATTRIBUTE",
attribute : "TYPE",
desiredValue : sampleType
}
]
if(sampleCode){
matchClauses.push(
{
"@type":"AttributeMatchClause",
fieldType : "ATTRIBUTE",
attribute : "CODE",
desiredValue : sampleCode
}
);
}
var sampleCriteria =
{
matchClauses : matchClauses,
operator : "MATCH_ALL_CLAUSES"
};
var localReference = this;
this.openbisServer.searchForSamplesWithFetchOptions(sampleCriteria, ["PROPERTIES", "ANCESTORS", "DESCENDANTS"], function(data) {
callbackFunction(localReference.getInitializedSamples(data.result));
});
}
this.searchWithType = function(sampleType, sampleCode, callbackFunction) this.searchWithType = function(sampleType, sampleCode, callbackFunction)
{ {
var matchClauses = [ {"@type":"AttributeMatchClause", var matchClauses = [ {"@type":"AttributeMatchClause",
......
...@@ -33,7 +33,7 @@ function DilutionWidget(containerId, serverFacade) { ...@@ -33,7 +33,7 @@ function DilutionWidget(containerId, serverFacade) {
$("#"+this._containerId).append("Loading data for Dilution Widget."); $("#"+this._containerId).append("Loading data for Dilution Widget.");
var _this = this; var _this = this;
//Load all proteins //Load all proteins
this._serverFacade.searchWithType("PROTEIN", null, function(data) { this._serverFacade.searchWithTypeAndLinks("PROTEIN", null, function(data) {
_this._allProteins = data; _this._allProteins = data;
//First repaint after all initializations //First repaint after all initializations
...@@ -55,9 +55,26 @@ function DilutionWidget(containerId, serverFacade) { ...@@ -55,9 +55,26 @@ function DilutionWidget(containerId, serverFacade) {
$component.attr('data-row-number', rowNumber); $component.attr('data-row-number', rowNumber);
//Get proteins for row
var proteins = [];
var _this = this;
this._allProteins.forEach(function(protein) {
protein.children.forEach(function(clone) {
clone.children.forEach(function(lot) {
lot.children.forEach(function(conjugatedClone) {
var metalMass = conjugatedClone.properties["METAL_MASS"];
var predefinedMass = _this._predefinedMass[rowNumber] + "";
if(predefinedMass === metalMass) {
proteins.push(protein);
}
});
});
});
});
//
$component.append($("<option>").attr('value', '').attr('selected', '').text('')); $component.append($("<option>").attr('value', '').attr('selected', '').text(''));
for(var i = 0; i < this._allProteins.length; i++) { for(var i = 0; i < proteins.length; i++) {
$component.append($("<option>").attr('value',this._allProteins[i].permId).text(this._allProteins[i].properties["PROTEIN_NAME"])); $component.append($("<option>").attr('value',proteins[i].permId).text(proteins[i].properties["PROTEIN_NAME"]));
} }
var _this = this; var _this = this;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment