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

SE-137 bugs in protein viewer fixed

SVN: 12526
parent 31c8a9cf
No related branches found
No related tags found
No related merge requests found
Showing
with 52 additions and 25 deletions
...@@ -22,6 +22,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.SingleSect ...@@ -22,6 +22,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.SingleSect
import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.IDatabaseModificationObserver; import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.IDatabaseModificationObserver;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.IDisposableComponent; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.IDisposableComponent;
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.plugin.phosphonetx.client.web.client.IPhosphoNetXClientServiceAsync; import ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.IPhosphoNetXClientServiceAsync;
/** /**
...@@ -38,12 +39,13 @@ public class ProteinSamplesSection extends SingleSectionPanel ...@@ -38,12 +39,13 @@ public class ProteinSamplesSection extends SingleSectionPanel
private IDisposableComponent sampleDisposableGrid; private IDisposableComponent sampleDisposableGrid;
public ProteinSamplesSection(final IViewContext<IPhosphoNetXClientServiceAsync> viewContext, public ProteinSamplesSection(final IViewContext<IPhosphoNetXClientServiceAsync> viewContext,
final TechId proteinReferenceID) final TechId proteinReferenceID, Experiment experimentOrNull)
{ {
super("Samples"); super("Samples");
Long experimentID = experimentOrNull == null ? null : experimentOrNull.getId();
sampleDisposableGrid = sampleDisposableGrid =
SampleAbundanceBrowserGrid.createGridForProteinSamples(viewContext, proteinReferenceID, SampleAbundanceBrowserGrid.createGridForProteinSamples(viewContext,
createGridId(proteinReferenceID)); proteinReferenceID, experimentID, createGridId(proteinReferenceID));
add(sampleDisposableGrid.getComponent()); add(sampleDisposableGrid.getComponent());
} }
......
...@@ -77,7 +77,7 @@ public class ProteinViewer extends ...@@ -77,7 +77,7 @@ public class ProteinViewer extends
{ {
public String getId() public String getId()
{ {
return createWidgetID(proteinInfo.getId()); return createWidgetID(experimentOrNull, proteinInfo.getId());
} }
public ITabItem create() public ITabItem create()
...@@ -106,9 +106,10 @@ public class ProteinViewer extends ...@@ -106,9 +106,10 @@ public class ProteinViewer extends
return StringUtils.abbreviate(info, 30); return StringUtils.abbreviate(info, 30);
} }
static String createWidgetID(TechId proteinReferenceID) static String createWidgetID(Experiment experimentOrNull, TechId proteinReferenceID)
{ {
return ID_PREFIX + proteinReferenceID.getId(); Long experimentID = experimentOrNull == null ? null : experimentOrNull.getId();
return ID_PREFIX + experimentID + "_" + proteinReferenceID.getId();
} }
private final IViewContext<IPhosphoNetXClientServiceAsync> viewContext; private final IViewContext<IPhosphoNetXClientServiceAsync> viewContext;
...@@ -122,7 +123,7 @@ public class ProteinViewer extends ...@@ -122,7 +123,7 @@ public class ProteinViewer extends
private ProteinViewer(IViewContext<IPhosphoNetXClientServiceAsync> viewContext, private ProteinViewer(IViewContext<IPhosphoNetXClientServiceAsync> viewContext,
Experiment experimentOrNull, TechId proteinReferenceID) Experiment experimentOrNull, TechId proteinReferenceID)
{ {
super(viewContext, "", createWidgetID(proteinReferenceID), false); super(viewContext, "", createWidgetID(experimentOrNull, proteinReferenceID), false);
this.viewContext = viewContext; this.viewContext = viewContext;
this.experimentOrNull = experimentOrNull; this.experimentOrNull = experimentOrNull;
this.proteinReferenceID = proteinReferenceID; this.proteinReferenceID = proteinReferenceID;
...@@ -151,7 +152,8 @@ public class ProteinViewer extends ...@@ -151,7 +152,8 @@ public class ProteinViewer extends
} else } else
{ {
add(propertyPanel, createBorderLayoutData(LayoutRegion.CENTER)); add(propertyPanel, createBorderLayoutData(LayoutRegion.CENTER));
proteinSamplesSection = new ProteinSamplesSection(viewContext, proteinReferenceID); proteinSamplesSection =
new ProteinSamplesSection(viewContext, proteinReferenceID, experimentOrNull);
add(proteinSamplesSection, createBorderLayoutData(LayoutRegion.SOUTH)); add(proteinSamplesSection, createBorderLayoutData(LayoutRegion.SOUTH));
layout(); layout();
} }
......
...@@ -87,11 +87,12 @@ public class SampleAbundanceBrowserGrid ...@@ -87,11 +87,12 @@ public class SampleAbundanceBrowserGrid
public static IDisposableComponent createGridForProteinSamples( public static IDisposableComponent createGridForProteinSamples(
final IViewContext<IPhosphoNetXClientServiceAsync> viewContext, final IViewContext<IPhosphoNetXClientServiceAsync> viewContext,
final TechId proteinReferenceID, final String gridId) final TechId proteinReferenceID, Long experimentIDOrNull, final String gridId)
{ {
final ListSampleAbundanceByProteinCriteria criteria = final ListSampleAbundanceByProteinCriteria criteria =
new ListSampleAbundanceByProteinCriteria(); new ListSampleAbundanceByProteinCriteria();
criteria.setProteinReferenceID(proteinReferenceID); criteria.setProteinReferenceID(proteinReferenceID);
criteria.setExperimentID(experimentIDOrNull);
ISampleAbundanceCriteriaProvider criteriaProvider = ISampleAbundanceCriteriaProvider criteriaProvider =
new SampleAbundanceCriteriaProvider(viewContext, criteria); new SampleAbundanceCriteriaProvider(viewContext, criteria);
......
...@@ -30,8 +30,19 @@ import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.basic.dto.SampleWithPr ...@@ -30,8 +30,19 @@ import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.basic.dto.SampleWithPr
public class ListSampleAbundanceByProteinCriteria extends public class ListSampleAbundanceByProteinCriteria extends
DefaultResultSetConfig<String, SampleWithPropertiesAndAbundance> implements IsSerializable DefaultResultSetConfig<String, SampleWithPropertiesAndAbundance> implements IsSerializable
{ {
private TechId experimentID;
private TechId proteinReferenceID; private TechId proteinReferenceID;
public final TechId getExperimentID()
{
return experimentID;
}
public final void setExperimentID(Long experimentID)
{
this.experimentID = experimentID == null ? null : new TechId(experimentID);
}
public final TechId getProteinReferenceID() public final TechId getProteinReferenceID()
{ {
return proteinReferenceID; return proteinReferenceID;
......
...@@ -35,20 +35,23 @@ class ListSampleAbundanceDataProvider implements IOriginalDataProvider<SampleWit ...@@ -35,20 +35,23 @@ class ListSampleAbundanceDataProvider implements IOriginalDataProvider<SampleWit
private final String sessionToken; private final String sessionToken;
private final TechId experimentID;
private final TechId proteinReferenceID; private final TechId proteinReferenceID;
ListSampleAbundanceDataProvider(IPhosphoNetXServer server, String sessionToken, ListSampleAbundanceDataProvider(IPhosphoNetXServer server, String sessionToken,
TechId proteinReferenceID) TechId experimentID, TechId proteinReferenceID)
{ {
this.server = server; this.server = server;
this.sessionToken = sessionToken; this.sessionToken = sessionToken;
this.experimentID = experimentID;
this.proteinReferenceID = proteinReferenceID; this.proteinReferenceID = proteinReferenceID;
} }
public List<SampleWithPropertiesAndAbundance> getOriginalData() throws UserFailureException public List<SampleWithPropertiesAndAbundance> getOriginalData() throws UserFailureException
{ {
return server.listSamplesWithAbundanceByProtein(sessionToken, proteinReferenceID); return server.listSamplesWithAbundanceByProtein(sessionToken, experimentID, proteinReferenceID);
} }
} }
...@@ -154,7 +154,7 @@ public class PhosphoNetXClientService extends AbstractClientService implements ...@@ -154,7 +154,7 @@ public class PhosphoNetXClientService extends AbstractClientService implements
{ {
final String sessionToken = getSessionToken(); final String sessionToken = getSessionToken();
return listEntities(criteria, new ListSampleAbundanceDataProvider(server, sessionToken, return listEntities(criteria, new ListSampleAbundanceDataProvider(server, sessionToken,
criteria.getProteinReferenceID())); criteria.getExperimentID(), criteria.getProteinReferenceID()));
} }
public String prepareExportSamplesWithAbundance( public String prepareExportSamplesWithAbundance(
......
...@@ -182,11 +182,12 @@ public class PhosphoNetXServer extends AbstractServer<IPhosphoNetXServer> implem ...@@ -182,11 +182,12 @@ public class PhosphoNetXServer extends AbstractServer<IPhosphoNetXServer> implem
} }
public List<SampleWithPropertiesAndAbundance> listSamplesWithAbundanceByProtein( public List<SampleWithPropertiesAndAbundance> listSamplesWithAbundanceByProtein(
String sessionToken, TechId proteinReferenceID) throws UserFailureException String sessionToken, TechId experimentID, TechId proteinReferenceID)
throws UserFailureException
{ {
final Session session = getSessionManager().getSession(sessionToken); final Session session = getSessionManager().getSession(sessionToken);
ISampleTable sampleTable = specificBOFactory.createSampleTable(session); ISampleTable sampleTable = specificBOFactory.createSampleTable(session);
sampleTable.loadSamplesWithAbundance(proteinReferenceID); sampleTable.loadSamplesWithAbundance(experimentID, proteinReferenceID);
return sampleTable.getSamples(); return sampleTable.getSamples();
} }
......
...@@ -96,10 +96,11 @@ public class PhosphoNetXServerLogger extends AbstractServerLogger implements IPh ...@@ -96,10 +96,11 @@ public class PhosphoNetXServerLogger extends AbstractServerLogger implements IPh
} }
public List<SampleWithPropertiesAndAbundance> listSamplesWithAbundanceByProtein( public List<SampleWithPropertiesAndAbundance> listSamplesWithAbundanceByProtein(
String sessionToken, TechId proteinReferenceID) throws UserFailureException String sessionToken, TechId experimentID, TechId proteinReferenceID)
throws UserFailureException
{ {
logAccess(sessionToken, "list_samples_with_abundance_by_protein", "PROTEIN_REFERENCE_ID(%s)", logAccess(sessionToken, "list_samples_with_abundance_by_protein",
proteinReferenceID); "EXPERIMENT_ID(%s) PROTEIN_REFERENCE_ID(%s)", experimentID, proteinReferenceID);
return null; return null;
} }
......
...@@ -29,7 +29,7 @@ import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.basic.dto.SampleWithPr ...@@ -29,7 +29,7 @@ import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.basic.dto.SampleWithPr
public interface ISampleTable public interface ISampleTable
{ {
public void loadSamplesWithAbundance(TechId proteinReferenceID); public void loadSamplesWithAbundance(TechId experimentID, TechId proteinReferenceID);
public List<SampleWithPropertiesAndAbundance> getSamples(); public List<SampleWithPropertiesAndAbundance> getSamples();
......
...@@ -59,15 +59,17 @@ class SampleTable extends AbstractBusinessObject implements ISampleTable ...@@ -59,15 +59,17 @@ class SampleTable extends AbstractBusinessObject implements ISampleTable
return samples; return samples;
} }
public void loadSamplesWithAbundance(TechId proteinReferenceID) public void loadSamplesWithAbundance(TechId experimentID, TechId proteinReferenceID)
{ {
samples = new ArrayList<SampleWithPropertiesAndAbundance>(); samples = new ArrayList<SampleWithPropertiesAndAbundance>();
IProteinQueryDAO proteinQueryDAO = getSpecificDAOFactory().getProteinQueryDAO(); IProteinQueryDAO proteinQueryDAO = getSpecificDAOFactory().getProteinQueryDAO();
ISampleDAO sampleDAO = getDaoFactory().getSampleDAO(); IDAOFactory daoFactory = getDaoFactory();
String experimentPermID = daoFactory.getExperimentDAO().getByTechId(experimentID).getPermId();
DataSet<SampleAbundance> sampleAbundances = DataSet<SampleAbundance> sampleAbundances =
proteinQueryDAO.listSampleAbundanceByProtein(proteinReferenceID.getId()); proteinQueryDAO.listSampleAbundanceByProtein(experimentPermID, proteinReferenceID.getId());
try try
{ {
ISampleDAO sampleDAO = daoFactory.getSampleDAO();
for (SampleAbundance sampleAbundance : sampleAbundances) for (SampleAbundance sampleAbundance : sampleAbundances)
{ {
SampleWithPropertiesAndAbundance sample = new SampleWithPropertiesAndAbundance(); SampleWithPropertiesAndAbundance sample = new SampleWithPropertiesAndAbundance();
......
...@@ -83,12 +83,15 @@ public interface IProteinQueryDAO extends BaseQuery ...@@ -83,12 +83,15 @@ public interface IProteinQueryDAO extends BaseQuery
@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 distinct a.id, 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 experiments as e on d.expe_id = e.id "
+ " left join identified_proteins as i on i.prot_id = p.id " + " left join identified_proteins as i on i.prot_id = p.id "
+ " left join sequences as s on i.sequ_id = s.id " + " left join sequences as s on i.sequ_id = s.id "
+ " left join samples on a.samp_id = samples.id " + " left join samples on a.samp_id = samples.id "
+ "where s.prre_id = ?{1}") + "where e.perm_id = ?{1} and s.prre_id = ?{2}")
public DataSet<SampleAbundance> listSampleAbundanceByProtein(long proteinReferenceID); public DataSet<SampleAbundance> listSampleAbundanceByProtein(String experimentPermID,
long proteinReferenceID);
} }
...@@ -81,6 +81,7 @@ public interface IPhosphoNetXServer extends IServer ...@@ -81,6 +81,7 @@ public interface IPhosphoNetXServer extends IServer
@Transactional @Transactional
@RolesAllowed(RoleSet.OBSERVER) @RolesAllowed(RoleSet.OBSERVER)
public List<SampleWithPropertiesAndAbundance> listSamplesWithAbundanceByProtein( public List<SampleWithPropertiesAndAbundance> listSamplesWithAbundanceByProtein(
String sessionToken, TechId proteinReferenceID) throws UserFailureException; String sessionToken, TechId experimentID, TechId proteinReferenceID)
throws UserFailureException;
} }
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