Skip to content
Snippets Groups Projects
Commit fd75a224 authored by felmer's avatar felmer
Browse files

SE-251 fixed bug concerning experiment identifier in protein details view,...

SE-251 fixed bug concerning experiment identifier in protein details view, implementation of section for indistinguishable protein in protein details view

SVN: 16223
parent dc0bc8d1
No related branches found
No related tags found
No related merge requests found
Showing
with 442 additions and 48 deletions
...@@ -59,6 +59,8 @@ public class Dict ...@@ -59,6 +59,8 @@ public class Dict
public static final String DATABASE_NAME_AND_VERSION = "database_name_and_version"; public static final String DATABASE_NAME_AND_VERSION = "database_name_and_version";
public static final String INDISTINGUISHABLE_PROTEINS = "indistinguishable_proteins";
public static final String SEQUENCE = "sequence"; public static final String SEQUENCE = "sequence";
public static final String SEQUENCES = "sequences"; public static final String SEQUENCES = "sequences";
...@@ -80,7 +82,6 @@ public class Dict ...@@ -80,7 +82,6 @@ public class Dict
// Protein Detail View // Protein Detail View
public static final String PROBABILITY = "protein_probability"; public static final String PROBABILITY = "protein_probability";
// SampleAbundance Browser // SampleAbundance Browser
public static final String ABUNDANCE = "abundance"; public static final String ABUNDANCE = "abundance";
...@@ -95,4 +96,5 @@ public class Dict ...@@ -95,4 +96,5 @@ public class Dict
public static final String COPY_DATA_SETS_MESSAGE = "copy_data_sets_message"; public static final String COPY_DATA_SETS_MESSAGE = "copy_data_sets_message";
public static final String COPY_DATA_SETS_DATA_SET_TYPE_FIELD = "copy_data_sets_data_set_type_field"; public static final String COPY_DATA_SETS_DATA_SET_TYPE_FIELD = "copy_data_sets_data_set_type_field";
} }
...@@ -67,7 +67,7 @@ public class ExperimentViewer extends GenericExperimentViewer ...@@ -67,7 +67,7 @@ public class ExperimentViewer extends GenericExperimentViewer
protected IDisposableComponent createDisposableContent() protected IDisposableComponent createDisposableContent()
{ {
return ProteinByExperimentBrowserGrid.create(specificViewContext, return ProteinByExperimentBrowserGrid.create(specificViewContext,
experimentType, experimentId); experimentType, experiment);
} }
}; };
section.setDisplayID(DisplayTypeIDGenerator.PROTEIN_SECTION, displyIdSuffix); section.setDisplayID(DisplayTypeIDGenerator.PROTEIN_SECTION, displyIdSuffix);
......
...@@ -38,8 +38,8 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.model.NonH ...@@ -38,8 +38,8 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.model.NonH
import ch.systemsx.cisd.openbis.generic.client.web.client.application.model.VocabularyTermModel; import ch.systemsx.cisd.openbis.generic.client.web.client.application.model.VocabularyTermModel;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.field.VocabularyTermSelectionWidget; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.field.VocabularyTermSelectionWidget;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.IDataRefreshCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.widget.IDataRefreshCallback;
import ch.systemsx.cisd.openbis.generic.shared.basic.IIdAndCodeHolder;
import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Experiment;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Vocabulary; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Vocabulary;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.VocabularyTerm; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.VocabularyTerm;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.IPhosphoNetXClientServiceAsync; import ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.IPhosphoNetXClientServiceAsync;
...@@ -160,15 +160,15 @@ class ProteinByExperimentBrowerToolBar extends ToolBar ...@@ -160,15 +160,15 @@ class ProteinByExperimentBrowerToolBar extends ToolBar
private ProteinByExperimentBrowserGrid browserGrid; private ProteinByExperimentBrowserGrid browserGrid;
private IIdAndCodeHolder experimentId; private Experiment experiment;
private ProteinSummaryGrid summaryGrid; private ProteinSummaryGrid summaryGrid;
ProteinByExperimentBrowerToolBar(IViewContext<IPhosphoNetXClientServiceAsync> viewContext, ProteinByExperimentBrowerToolBar(IViewContext<IPhosphoNetXClientServiceAsync> viewContext,
IIdAndCodeHolder experimentId) Experiment experiment)
{ {
this.viewContext = viewContext; this.viewContext = viewContext;
this.experimentId = experimentId; this.experiment = experiment;
setBorders(true); setBorders(true);
// WORKAROUND to get all elements in the toolbar present independent of the original width // WORKAROUND to get all elements in the toolbar present independent of the original width
// of the parent // of the parent
...@@ -275,9 +275,9 @@ class ProteinByExperimentBrowerToolBar extends ToolBar ...@@ -275,9 +275,9 @@ class ProteinByExperimentBrowerToolBar extends ToolBar
return comboBox; return comboBox;
} }
IIdAndCodeHolder getExperimentOrNull() Experiment getExperimentOrNull()
{ {
return experimentId; return experiment;
} }
void setBrowserGrid(ProteinByExperimentBrowserGrid browserGrid) void setBrowserGrid(ProteinByExperimentBrowserGrid browserGrid)
...@@ -292,9 +292,9 @@ class ProteinByExperimentBrowerToolBar extends ToolBar ...@@ -292,9 +292,9 @@ class ProteinByExperimentBrowerToolBar extends ToolBar
void update() void update()
{ {
if (experimentId != null) if (experiment != null)
{ {
final TechId experimentID = TechId.create(experimentId); final TechId experimentID = TechId.create(experiment);
browserGrid.setLoadMaskImmediately(true); browserGrid.setLoadMaskImmediately(true);
browserGrid.setPostRefreshCallback(new IDataRefreshCallback() browserGrid.setPostRefreshCallback(new IDataRefreshCallback()
{ {
......
...@@ -51,10 +51,10 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ResultSet; ...@@ -51,10 +51,10 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.dto.ResultSet;
import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TableExportCriteria; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TableExportCriteria;
import ch.systemsx.cisd.openbis.generic.shared.basic.GridRowModel; import ch.systemsx.cisd.openbis.generic.shared.basic.GridRowModel;
import ch.systemsx.cisd.openbis.generic.shared.basic.IColumnDefinition; import ch.systemsx.cisd.openbis.generic.shared.basic.IColumnDefinition;
import ch.systemsx.cisd.openbis.generic.shared.basic.IIdAndCodeHolder;
import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.BasicEntityType; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.BasicEntityType;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Experiment;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind.ObjectKind; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind.ObjectKind;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.IPhosphoNetXClientServiceAsync; import ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.IPhosphoNetXClientServiceAsync;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.application.columns.InternalAbundanceColumnDefinition; import ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.application.columns.InternalAbundanceColumnDefinition;
...@@ -97,11 +97,11 @@ class ProteinByExperimentBrowserGrid extends AbstractSimpleBrowserGrid<ProteinIn ...@@ -97,11 +97,11 @@ class ProteinByExperimentBrowserGrid extends AbstractSimpleBrowserGrid<ProteinIn
static IDisposableComponent create( static IDisposableComponent create(
final IViewContext<IPhosphoNetXClientServiceAsync> viewContext, final IViewContext<IPhosphoNetXClientServiceAsync> viewContext,
BasicEntityType experimentType, IIdAndCodeHolder experimentId) BasicEntityType experimentType, Experiment experiment)
{ {
final IDisposableComponent summaryGrid = ProteinSummaryGrid.create(viewContext); final IDisposableComponent summaryGrid = ProteinSummaryGrid.create(viewContext);
ProteinByExperimentBrowserGrid browserGrid = ProteinByExperimentBrowserGrid browserGrid =
new ProteinByExperimentBrowserGrid(viewContext, experimentId); new ProteinByExperimentBrowserGrid(viewContext, experiment);
final IDisposableComponent disposableBrowerGrid = browserGrid.asDisposableWithoutToolbar(); final IDisposableComponent disposableBrowerGrid = browserGrid.asDisposableWithoutToolbar();
final ProteinByExperimentBrowerToolBar toolBar = browserGrid.toolbar; final ProteinByExperimentBrowerToolBar toolBar = browserGrid.toolbar;
toolBar.setSummaryGrid((ProteinSummaryGrid) summaryGrid.getComponent()); toolBar.setSummaryGrid((ProteinSummaryGrid) summaryGrid.getComponent());
...@@ -152,12 +152,12 @@ class ProteinByExperimentBrowserGrid extends AbstractSimpleBrowserGrid<ProteinIn ...@@ -152,12 +152,12 @@ class ProteinByExperimentBrowserGrid extends AbstractSimpleBrowserGrid<ProteinIn
private ProteinByExperimentBrowserGrid( private ProteinByExperimentBrowserGrid(
final IViewContext<IPhosphoNetXClientServiceAsync> viewContext, final IViewContext<IPhosphoNetXClientServiceAsync> viewContext,
IIdAndCodeHolder experimentId) Experiment experiment)
{ {
super(viewContext.getCommonViewContext(), BROWSER_ID, GRID_ID, false, super(viewContext.getCommonViewContext(), BROWSER_ID, GRID_ID, false,
PhosphoNetXDisplayTypeIDGenerator.PROTEIN_BY_EXPERIMENT_BROWSER_GRID); PhosphoNetXDisplayTypeIDGenerator.PROTEIN_BY_EXPERIMENT_BROWSER_GRID);
specificViewContext = viewContext; specificViewContext = viewContext;
toolbar = new ProteinByExperimentBrowerToolBar(viewContext, experimentId); toolbar = new ProteinByExperimentBrowerToolBar(viewContext, experiment);
toolbar.setBrowserGrid(this); toolbar.setBrowserGrid(this);
registerLinkClickListenerFor(ProteinColDefKind.ACCESSION_NUMBER.id(), registerLinkClickListenerFor(ProteinColDefKind.ACCESSION_NUMBER.id(),
new ICellListener<ProteinInfo>() new ICellListener<ProteinInfo>()
...@@ -208,9 +208,9 @@ class ProteinByExperimentBrowserGrid extends AbstractSimpleBrowserGrid<ProteinIn ...@@ -208,9 +208,9 @@ class ProteinByExperimentBrowserGrid extends AbstractSimpleBrowserGrid<ProteinIn
for (AbundanceColumnDefinition definition : abundanceColumnDefinitions) for (AbundanceColumnDefinition definition : abundanceColumnDefinitions)
{ {
String header = definition.getSampleCode(); String header = definition.getSampleCode();
final long sampleID = definition.getID();
List<Treatment> treatments = definition.getTreatments();
Map<String, String> properties = new HashMap<String, String>(); Map<String, String> properties = new HashMap<String, String>();
properties.put(ABUNDANCE_PROPERTY_KEY, header);
List<Treatment> treatments = definition.getTreatments();
if (treatments.isEmpty() == false) if (treatments.isEmpty() == false)
{ {
header = ""; header = "";
...@@ -221,10 +221,8 @@ class ProteinByExperimentBrowserGrid extends AbstractSimpleBrowserGrid<ProteinIn ...@@ -221,10 +221,8 @@ class ProteinByExperimentBrowserGrid extends AbstractSimpleBrowserGrid<ProteinIn
delim = ", "; delim = ", ";
properties.put(treatment.getTypeCode(), treatment.getValue()); properties.put(treatment.getTypeCode(), treatment.getValue());
} }
} else
{
properties.put(ABUNDANCE_PROPERTY_KEY, header);
} }
final long sampleID = definition.getID();
IColumnDefinitionUI<ProteinInfo> columnDefinition = IColumnDefinitionUI<ProteinInfo> columnDefinition =
new InternalAbundanceColumnDefinition(header, properties, 100, false, sampleID); new InternalAbundanceColumnDefinition(header, properties, 100, false, sampleID);
abundanceColumnIDs.add(columnDefinition.getIdentifier()); abundanceColumnIDs.add(columnDefinition.getIdentifier());
......
...@@ -24,9 +24,16 @@ import java.util.Set; ...@@ -24,9 +24,16 @@ import java.util.Set;
import com.extjs.gxt.ui.client.Style.LayoutRegion; import com.extjs.gxt.ui.client.Style.LayoutRegion;
import com.extjs.gxt.ui.client.Style.Scroll; import com.extjs.gxt.ui.client.Style.Scroll;
import com.extjs.gxt.ui.client.util.Margins;
import com.extjs.gxt.ui.client.widget.ContentPanel; import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.TabItem;
import com.extjs.gxt.ui.client.widget.TabPanel;
import com.extjs.gxt.ui.client.widget.layout.BorderLayout; import com.extjs.gxt.ui.client.widget.layout.BorderLayout;
import com.extjs.gxt.ui.client.widget.layout.BorderLayoutData; import com.extjs.gxt.ui.client.widget.layout.BorderLayoutData;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.extjs.gxt.ui.client.widget.layout.RowData;
import com.extjs.gxt.ui.client.widget.layout.RowLayout;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.DisposableSectionPanel; import ch.systemsx.cisd.openbis.generic.client.web.client.application.DisposableSectionPanel;
...@@ -53,6 +60,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; ...@@ -53,6 +60,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityType; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityType;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Experiment; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Experiment;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.IPhosphoNetXClientServiceAsync; import ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.IPhosphoNetXClientServiceAsync;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.basic.dto.IndistinguishableProteinInfo;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.basic.dto.Peptide; import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.basic.dto.Peptide;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.basic.dto.ProteinByExperiment; import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.basic.dto.ProteinByExperiment;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.basic.dto.ProteinDetails; import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.basic.dto.ProteinDetails;
...@@ -64,7 +72,7 @@ import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.basic.dto.ProteinInfo; ...@@ -64,7 +72,7 @@ import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.basic.dto.ProteinInfo;
public class ProteinViewer extends AbstractViewer<IEntityInformationHolder> implements public class ProteinViewer extends AbstractViewer<IEntityInformationHolder> implements
IDatabaseModificationObserver IDatabaseModificationObserver
{ {
private static final int AMINOACIDS_IN_SEQUENCE_PER_LINE = 60; private static final int AMINOACIDS_IN_SEQUENCE_PER_LINE = 90;
private static final int AMINOACIDS_IN_ONE_BLOCK = 10; private static final int AMINOACIDS_IN_ONE_BLOCK = 10;
...@@ -74,25 +82,25 @@ public class ProteinViewer extends AbstractViewer<IEntityInformationHolder> impl ...@@ -74,25 +82,25 @@ public class ProteinViewer extends AbstractViewer<IEntityInformationHolder> impl
static AbstractTabItemFactory createTabItemFactory( static AbstractTabItemFactory createTabItemFactory(
final IViewContext<IPhosphoNetXClientServiceAsync> viewContext, final IViewContext<IPhosphoNetXClientServiceAsync> viewContext,
final IIdAndCodeHolder experimentId, final ProteinInfo proteinInfo) final Experiment experiment, final ProteinInfo proteinInfo)
{ {
return new AbstractTabItemFactory() return new AbstractTabItemFactory()
{ {
@Override @Override
public String getId() public String getId()
{ {
return createWidgetID(experimentId, proteinInfo.getId()); return createWidgetID(experiment, proteinInfo.getId());
} }
@Override @Override
public ITabItem create() public ITabItem create()
{ {
ProteinViewer viewer = ProteinViewer viewer =
new ProteinViewer(viewContext, experimentId, proteinInfo.getId()); new ProteinViewer(viewContext, experiment, proteinInfo.getId());
DatabaseModificationAwareComponent c = DatabaseModificationAwareComponent c =
new DatabaseModificationAwareComponent(viewer, viewer); new DatabaseModificationAwareComponent(viewer, viewer);
String description = getAbbreviatedDescription(proteinInfo); String description = getAbbreviatedDescription(proteinInfo);
String identifier = experimentId == null ? "?" : experimentId.getCode(); String identifier = experiment == null ? "?" : experiment.getCode();
return DefaultTabItem.create(viewContext.getMessage( return DefaultTabItem.create(viewContext.getMessage(
Dict.PROTEIN_IN_EXPERIMENT_TAB_LABEL, description, identifier), c, Dict.PROTEIN_IN_EXPERIMENT_TAB_LABEL, description, identifier), c,
viewContext, false); viewContext, false);
...@@ -124,27 +132,27 @@ public class ProteinViewer extends AbstractViewer<IEntityInformationHolder> impl ...@@ -124,27 +132,27 @@ public class ProteinViewer extends AbstractViewer<IEntityInformationHolder> impl
private final IViewContext<IPhosphoNetXClientServiceAsync> viewContext; private final IViewContext<IPhosphoNetXClientServiceAsync> viewContext;
private final IIdAndCodeHolder experimentIdOrNull; private final Experiment experimentOrNull;
private final TechId proteinReferenceID; private final TechId proteinReferenceID;
private ProteinSamplesSection proteinSamplesSection; private ProteinSamplesSection proteinSamplesSection;
private ProteinViewer(IViewContext<IPhosphoNetXClientServiceAsync> viewContext, private ProteinViewer(IViewContext<IPhosphoNetXClientServiceAsync> viewContext,
IIdAndCodeHolder experimentId, TechId proteinReferenceID) Experiment experiment, TechId proteinReferenceID)
{ {
super(viewContext, "", createWidgetID(experimentId, proteinReferenceID), false); super(viewContext, "", createWidgetID(experiment, proteinReferenceID), false);
this.viewContext = viewContext; this.viewContext = viewContext;
this.experimentIdOrNull = experimentId; this.experimentOrNull = experiment;
this.proteinReferenceID = proteinReferenceID; this.proteinReferenceID = proteinReferenceID;
reloadAllData(); reloadAllData();
} }
private void reloadAllData() private void reloadAllData()
{ {
if (experimentIdOrNull != null) if (experimentOrNull != null)
{ {
viewContext.getService().getProteinByExperiment(new TechId(experimentIdOrNull.getId()), viewContext.getService().getProteinByExperiment(new TechId(experimentOrNull.getId()),
proteinReferenceID, new ProteinByExperimentCallback(viewContext, this)); proteinReferenceID, new ProteinByExperimentCallback(viewContext, this));
} }
} }
...@@ -156,18 +164,74 @@ public class ProteinViewer extends AbstractViewer<IEntityInformationHolder> impl ...@@ -156,18 +164,74 @@ public class ProteinViewer extends AbstractViewer<IEntityInformationHolder> impl
setScrollMode(Scroll.AUTO); setScrollMode(Scroll.AUTO);
ContentPanel propertyPanel = createPropertyPanel(protein); ContentPanel propertyPanel = createPropertyPanel(protein);
if (protein.getDetails() == null) ProteinDetails details = protein.getDetails();
if (details == null)
{ {
recreateUIWithDatasetTable(protein, propertyPanel); recreateUIWithDatasetTable(protein, propertyPanel);
} else } else
{ {
add(propertyPanel, createBorderLayoutData(LayoutRegion.CENTER)); List<IndistinguishableProteinInfo> indistinguishableProteins =
details.getIndistinguishableProteinInfos();
LayoutContainer southPanel = new LayoutContainer();
RowLayoutManager rowDataManager = new RowLayoutManager(southPanel, new RowLayout());
add(southPanel, bld(LayoutRegion.CENTER));
rowDataManager.addToContainer(propertyPanel, new RowData(1, 0.5f));
if (indistinguishableProteins.isEmpty() == false)
{
List<Peptide> peptides = details.getPeptides();
ContentPanel panel =
createIndistinguishableProteinsSection(indistinguishableProteins, peptides);
rowDataManager.addToContainer(panel, new RowData(1, 0.3f));
}
proteinSamplesSection = proteinSamplesSection =
new ProteinSamplesSection(viewContext, proteinReferenceID, experimentIdOrNull); new ProteinSamplesSection(viewContext, proteinReferenceID, experimentOrNull);
add(proteinSamplesSection, createBorderLayoutData(LayoutRegion.SOUTH)); rowDataManager.addToContainer(proteinSamplesSection, new RowData(1, 0.2f));
layout(); layout();
} }
} }
private ContentPanel createIndistinguishableProteinsSection(
List<IndistinguishableProteinInfo> indistinguishableProteins, List<Peptide> peptides)
{
ContentPanel panel = new ContentPanel(new RowLayout());
panel.setHeading(viewContext.getMessage(Dict.INDISTINGUISHABLE_PROTEINS));
panel.setCollapsible(true);
panel.setHeight("100%");
TabPanel tabPanel = new TabPanel();
tabPanel.setTabScroll(true);
for (IndistinguishableProteinInfo info : indistinguishableProteins)
{
String accessionNumber = info.getAccessionNumber();
TabItem item = new TabItem(accessionNumber);
item.setLayout(new FitLayout());
PropertyGrid propertyGrid = new PropertyGrid(viewContext, 3);
final Map<String, Object> properties = new LinkedHashMap<String, Object>();
properties.put(viewContext.getMessage(Dict.ACCESSION_NUMBER), accessionNumber);
properties.put(viewContext.getMessage(Dict.PROTEIN_DESCRIPTION), info
.getDescription());
String markedSequence = markPeptides(info.getSequence(), peptides);
properties.put(viewContext.getMessage(Dict.SEQUENCE_NAME), markedSequence);
propertyGrid.setProperties(properties);
ContentPanel contentPanel = new ContentPanel();
contentPanel.setHeight("100%");
contentPanel.setScrollMode(Scroll.AUTO);
contentPanel.add(propertyGrid);
item.add(contentPanel);
tabPanel.add(item);
}
panel.add(tabPanel, new RowData(1, 1));
return panel;
}
private BorderLayoutData bld(LayoutRegion region)
{
BorderLayoutData data = new BorderLayoutData(region);
data.setSplit(true);
data.setCollapsible(true);
data.setMargins(new Margins(2));
return data;
}
private void recreateUIWithDatasetTable(ProteinByExperiment protein, ContentPanel propertyPanel) private void recreateUIWithDatasetTable(ProteinByExperiment protein, ContentPanel propertyPanel)
{ {
...@@ -193,7 +257,7 @@ public class ProteinViewer extends AbstractViewer<IEntityInformationHolder> impl ...@@ -193,7 +257,7 @@ public class ProteinViewer extends AbstractViewer<IEntityInformationHolder> impl
protected IDisposableComponent createDisposableContent() protected IDisposableComponent createDisposableContent()
{ {
return DataSetProteinGrid.create(ProteinViewer.this.viewContext, return DataSetProteinGrid.create(ProteinViewer.this.viewContext,
experimentIdOrNull, proteinReferenceID); experimentOrNull, proteinReferenceID);
} }
}; };
add(proteinsSection, createBorderLayoutData(LayoutRegion.SOUTH)); add(proteinsSection, createBorderLayoutData(LayoutRegion.SOUTH));
...@@ -205,6 +269,7 @@ public class ProteinViewer extends AbstractViewer<IEntityInformationHolder> impl ...@@ -205,6 +269,7 @@ public class ProteinViewer extends AbstractViewer<IEntityInformationHolder> impl
PropertyGrid propertyGrid = createPropertyGrid(protein); PropertyGrid propertyGrid = createPropertyGrid(protein);
ContentPanel contentPanel = new ContentPanel(); ContentPanel contentPanel = new ContentPanel();
contentPanel.setScrollMode(Scroll.AUTO); contentPanel.setScrollMode(Scroll.AUTO);
contentPanel.setCollapsible(true);
contentPanel.add(propertyGrid); contentPanel.add(propertyGrid);
return contentPanel; return contentPanel;
} }
...@@ -213,9 +278,9 @@ public class ProteinViewer extends AbstractViewer<IEntityInformationHolder> impl ...@@ -213,9 +278,9 @@ public class ProteinViewer extends AbstractViewer<IEntityInformationHolder> impl
{ {
final Map<String, Object> properties = new LinkedHashMap<String, Object>(); final Map<String, Object> properties = new LinkedHashMap<String, Object>();
PropertyGrid propertyGrid = new PropertyGrid(viewContext, 0); PropertyGrid propertyGrid = new PropertyGrid(viewContext, 0);
if (experimentIdOrNull != null) if (experimentOrNull != null)
{ {
properties.put(viewContext.getMessage(Dict.EXPERIMENT_LABEL), experimentIdOrNull); properties.put(viewContext.getMessage(Dict.EXPERIMENT_LABEL), experimentOrNull);
propertyGrid.registerPropertyValueRenderer(Experiment.class, PropertyValueRenderers propertyGrid.registerPropertyValueRenderer(Experiment.class, PropertyValueRenderers
.createExperimentPropertyValueRenderer(viewContext)); .createExperimentPropertyValueRenderer(viewContext));
} }
......
/*
* Copyright 2010 ETH Zuerich, CISD
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.application;
import java.util.ArrayList;
import java.util.List;
import com.extjs.gxt.ui.client.Style.Orientation;
import com.extjs.gxt.ui.client.event.BaseEvent;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.layout.RowData;
import com.extjs.gxt.ui.client.widget.layout.RowLayout;
/**
* Helper class for doing {@link RowLayout} of a {@link LayoutContainer} with instances of
* {@link ContentPanel} in a dynamic way. Collapsed row components lead to a resize of the
* non-collapsed components if the row size is defined by a positive value &lt;= 1.
*
* @author Franz-Josef Elmer
*/
public class RowLayoutManager
{
private static interface IManipulator
{
double getFor(RowData rowData);
void setFor(RowData rowData, double newValue);
int getFrameSizeFor(ContentPanel panel);
}
private static final class DynamicRowData
{
private RowData rowData;
private double originalValue;
private ContentPanel panel;
}
private static final IManipulator HEIGHT_MANIPULATOR = new IManipulator()
{
public void setFor(RowData rowData, double newValue)
{
rowData.setHeight(newValue);
}
public double getFor(RowData rowData)
{
return rowData.getHeight();
}
public int getFrameSizeFor(ContentPanel panel)
{
return panel.isRendered() ? panel.getFrameHeight() : 0;
}
};
private static final IManipulator WIDTH_MANIPULATOR = new IManipulator()
{
public void setFor(RowData rowData, double newValue)
{
rowData.setWidth(newValue);
}
public double getFor(RowData rowData)
{
return rowData.getWidth();
}
public int getFrameSizeFor(ContentPanel panel)
{
return panel.isRendered() ? panel.getFrameWidth() : 0;
}
};
private final LayoutContainer container;
private final IManipulator manipulator;
private final List<DynamicRowData> dynamicRowDatas = new ArrayList<DynamicRowData>();
/**
* Creates an instance for the specified container and apply the specified layout.
*/
public RowLayoutManager(LayoutContainer container, RowLayout rowLayout)
{
this.container = container;
container.setLayout(rowLayout);
Orientation orientation = rowLayout.getOrientation();
if (orientation.equals(Orientation.VERTICAL))
{
manipulator = HEIGHT_MANIPULATOR;
} else
{
manipulator = WIDTH_MANIPULATOR;
}
}
/**
* Adds the specified panel to the container in accordance to the specified row data.
*/
public void addToContainer(ContentPanel contentPanel, RowData rowData)
{
container.add(contentPanel, rowData);
double value = manipulator.getFor(rowData);
if (value < 0 || value > 1)
{
return;
}
DynamicRowData dynamicRowData = new DynamicRowData();
dynamicRowData.rowData = rowData;
dynamicRowData.originalValue = value;
dynamicRowData.panel = contentPanel;
dynamicRowDatas.add(dynamicRowData);
adjustRelative();
Listener<BaseEvent> listener = new Listener<BaseEvent>()
{
public void handleEvent(BaseEvent event)
{
adjustRelative();
}
};
contentPanel.addListener(Events.Collapse, listener);
contentPanel.addListener(Events.Expand, listener);
}
private void adjustRelative()
{
double sum = 0;
for (DynamicRowData data : dynamicRowDatas)
{
if (data.panel.isCollapsed() == false)
{
sum += data.originalValue;
}
}
for (DynamicRowData data : dynamicRowDatas)
{
double value;
if (data.panel.isCollapsed())
{
value = manipulator.getFrameSizeFor(data.panel);
}
else
{
value = data.originalValue / sum;
}
manipulator.setFor(data.rowData, value);
}
container.layout(true);
}
}
\ No newline at end of file
...@@ -22,6 +22,7 @@ var phosphonetx = { ...@@ -22,6 +22,7 @@ var phosphonetx = {
protein_browser: "Proteins", protein_browser: "Proteins",
protein_summary: "Protein/Peptide Counts", protein_summary: "Protein/Peptide Counts",
database_name_and_version: "Database", database_name_and_version: "Database",
indistinguishable_proteins: "Indistinguishable Proteins",
sequence: "Amino Acid Sequence", sequence: "Amino Acid Sequence",
sequences: "Amino Acid Sequences", sequences: "Amino Acid Sequences",
data_set_proteins: "Data Sets", data_set_proteins: "Data Sets",
......
...@@ -28,10 +28,12 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.ExperimentPE; ...@@ -28,10 +28,12 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.ExperimentPE;
import ch.systemsx.cisd.openbis.generic.shared.dto.Session; import ch.systemsx.cisd.openbis.generic.shared.dto.Session;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.server.dataaccess.IPhosphoNetXDAOFactory; import ch.systemsx.cisd.openbis.plugin.phosphonetx.server.dataaccess.IPhosphoNetXDAOFactory;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.server.dataaccess.IProteinQueryDAO; import ch.systemsx.cisd.openbis.plugin.phosphonetx.server.dataaccess.IProteinQueryDAO;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.basic.dto.IndistinguishableProteinInfo;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.basic.dto.Peptide; import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.basic.dto.Peptide;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.basic.dto.ProteinDetails; import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.basic.dto.ProteinDetails;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.dto.IdentifiedPeptide; import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.dto.IdentifiedPeptide;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.dto.IdentifiedProtein; import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.dto.IdentifiedProtein;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.dto.IndistinguishableProtein;
/** /**
* @author Franz-Josef Elmer * @author Franz-Josef Elmer
...@@ -79,29 +81,60 @@ class ProteinDetailsBO extends AbstractBusinessObject implements IProteinDetails ...@@ -79,29 +81,60 @@ class ProteinDetailsBO extends AbstractBusinessObject implements IProteinDetails
details.setDataSetTypeCode(ds.getDataSetType().getCode()); details.setDataSetTypeCode(ds.getDataSetType().getCode());
} }
details.setPeptides(loadPeptides(protein)); details.setPeptides(loadPeptides(protein));
details.setProteinID(new TechId(protein.getProteinID())); long proteinID = protein.getProteinID();
details.setProteinID(new TechId(proteinID));
details.setIndistinguishableProteinInfos(loadIndistinguishableProteinInfos(proteinID));
} }
} finally } finally
{ {
proteins.close(); proteins.close();
} }
} }
private List<IndistinguishableProteinInfo> loadIndistinguishableProteinInfos(long proteinID)
{
IProteinQueryDAO proteinQueryDAO = getSpecificDAOFactory().getProteinQueryDAO();
DataSet<IndistinguishableProtein> proteins =
proteinQueryDAO.listIndistinguishableProteinsByProteinID(proteinID);
try
{
List<IndistinguishableProteinInfo> infos =
new ArrayList<IndistinguishableProteinInfo>();
for (IndistinguishableProtein protein : proteins)
{
IndistinguishableProteinInfo info = new IndistinguishableProteinInfo();
info.setAccessionNumber(protein.getAccessionNumber());
info.setDescription(protein.getDescription());
info.setSequence(protein.getSequence());
infos.add(info);
}
return infos;
} finally
{
proteins.close();
}
}
private List<Peptide> loadPeptides(IdentifiedProtein protein) private List<Peptide> loadPeptides(IdentifiedProtein protein)
{ {
IProteinQueryDAO proteinQueryDAO = getSpecificDAOFactory().getProteinQueryDAO(); IProteinQueryDAO proteinQueryDAO = getSpecificDAOFactory().getProteinQueryDAO();
DataSet<IdentifiedPeptide> identifiedPeptides = DataSet<IdentifiedPeptide> identifiedPeptides =
proteinQueryDAO.listIdentifiedPeptidesByProtein(protein.getProteinID()); proteinQueryDAO.listIdentifiedPeptidesByProtein(protein.getProteinID());
List<Peptide> peptides = new ArrayList<Peptide>(); try
for (IdentifiedPeptide identifiedPeptide : identifiedPeptides) {
List<Peptide> peptides = new ArrayList<Peptide>();
for (IdentifiedPeptide identifiedPeptide : identifiedPeptides)
{
Peptide peptide = new Peptide();
peptide.setSequence(identifiedPeptide.getSequence());
peptide.setCharge(identifiedPeptide.getCharge());
peptides.add(peptide);
}
return peptides;
} finally
{ {
Peptide peptide = new Peptide(); identifiedPeptides.close();
peptide.setSequence(identifiedPeptide.getSequence());
peptide.setCharge(identifiedPeptide.getCharge());
peptides.add(peptide);
} }
identifiedPeptides.close();
return peptides;
} }
private String getExperimentPermIDFor(TechId experimentId) private String getExperimentPermIDFor(TechId experimentId)
......
...@@ -25,6 +25,7 @@ import net.lemnik.eodsql.Select; ...@@ -25,6 +25,7 @@ import net.lemnik.eodsql.Select;
import ch.systemsx.cisd.openbis.generic.server.dataaccess.db.LongSetMapper; import ch.systemsx.cisd.openbis.generic.server.dataaccess.db.LongSetMapper;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.dto.IdentifiedPeptide; import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.dto.IdentifiedPeptide;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.dto.IdentifiedProtein; import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.dto.IdentifiedProtein;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.dto.IndistinguishableProtein;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.dto.ProbabilityFDRMapping; import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.dto.ProbabilityFDRMapping;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.dto.ProteinAbundance; import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.dto.ProteinAbundance;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.dto.ProteinReference; import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.dto.ProteinReference;
...@@ -98,10 +99,16 @@ public interface IProteinQueryDAO extends BaseQuery ...@@ -98,10 +99,16 @@ public interface IProteinQueryDAO extends BaseQuery
+ " amino_acid_sequence, s.db_id, name_and_version order by data_set_perm_id") + " amino_acid_sequence, s.db_id, name_and_version order by data_set_perm_id")
public DataSet<IdentifiedProtein> listProteinsByProteinReferenceAndExperiment( public DataSet<IdentifiedProtein> listProteinsByProteinReferenceAndExperiment(
String experimentPermID, long proteinReferenceID); String experimentPermID, long proteinReferenceID);
@Select("select * from peptides where prot_id = ?{1}") @Select("select * from peptides where prot_id = ?{1}")
public DataSet<IdentifiedPeptide> listIdentifiedPeptidesByProtein(long proteinID); public DataSet<IdentifiedPeptide> listIdentifiedPeptidesByProtein(long proteinID);
@Select("select accession_number, description, amino_acid_sequence "
+ "from identified_proteins as ip join sequences as s on ip.sequ_id = s.id "
+ " join protein_references as pr on s.prre_id = pr.id "
+ "where ip.prot_id = ?{1} and ip.is_primary = 'f'")
public DataSet<IndistinguishableProtein> listIndistinguishableProteinsByProteinID(long proteinID);
@Select("select distinct a.id, samples.perm_id, value " @Select("select distinct a.id, samples.perm_id, value "
+ "from abundances as a left join proteins as p on a.prot_id = p.id " + "from abundances as a left join proteins as p on a.prot_id = p.id "
+ " left join data_sets as d on p.dase_id = d.id " + " left join data_sets as d on p.dase_id = d.id "
......
/*
* Copyright 2010 ETH Zuerich, CISD
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.basic.dto;
import java.io.Serializable;
import com.google.gwt.user.client.rpc.IsSerializable;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ServiceVersionHolder;
/**
*
*
* @author Franz-Josef Elmer
*/
public class IndistinguishableProteinInfo implements IsSerializable, Serializable
{
private static final long serialVersionUID = ServiceVersionHolder.VERSION;
private String sequence;
private String accessionNumber;
private String description;
public final String getSequence()
{
return sequence;
}
public final void setSequence(String sequence)
{
this.sequence = sequence;
}
public final String getAccessionNumber()
{
return accessionNumber;
}
public final void setAccessionNumber(String accessionNumber)
{
this.accessionNumber = accessionNumber;
}
public final String getDescription()
{
return description;
}
public final void setDescription(String description)
{
this.description = description;
}
}
...@@ -48,6 +48,8 @@ public class ProteinDetails implements IsSerializable, Serializable ...@@ -48,6 +48,8 @@ public class ProteinDetails implements IsSerializable, Serializable
private TechId proteinID; private TechId proteinID;
private List<Peptide> peptides; private List<Peptide> peptides;
private List<IndistinguishableProteinInfo> indistinguishableProteinInfos;
public String getSequence() public String getSequence()
{ {
...@@ -138,4 +140,14 @@ public class ProteinDetails implements IsSerializable, Serializable ...@@ -138,4 +140,14 @@ public class ProteinDetails implements IsSerializable, Serializable
{ {
this.dataSetTypeCode = dataSetTypeCode; this.dataSetTypeCode = dataSetTypeCode;
} }
public void setIndistinguishableProteinInfos(List<IndistinguishableProteinInfo> indistinguishableProteinInfos)
{
this.indistinguishableProteinInfos = indistinguishableProteinInfos;
}
public List<IndistinguishableProteinInfo> getIndistinguishableProteinInfos()
{
return indistinguishableProteinInfos;
}
} }
/*
* Copyright 2010 ETH Zuerich, CISD
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.dto;
import net.lemnik.eodsql.ResultColumn;
/**
*
*
* @author Franz-Josef Elmer
*/
public class IndistinguishableProtein extends ProteinReference
{
private static final long serialVersionUID = 1L;
@ResultColumn("amino_acid_sequence")
private String sequence;
public void setSequence(String sequence)
{
this.sequence = sequence;
}
public String getSequence()
{
return sequence;
}
}
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