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

LMS-1028 ProteinViewer: ProteinSequenceGrid added

SVN: 11736
parent 4de4c4b9
No related branches found
No related tags found
No related merge requests found
Showing
with 414 additions and 44 deletions
......@@ -22,8 +22,10 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.dto.TableExportCriteri
import ch.systemsx.cisd.openbis.generic.client.web.client.exception.UserFailureException;
import ch.systemsx.cisd.openbis.generic.shared.basic.TechId;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.dto.ListProteinByExperimentCriteria;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.dto.ListProteinSequenceCriteria;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.dto.ProteinInfo;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.basic.dto.ProteinByExperiment;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.basic.dto.ProteinSequence;
/**
*
......@@ -40,5 +42,11 @@ public interface IPhosphoNetXClientService extends IClientService
public ProteinByExperiment getProteinByExperiment(TechId experimentID, TechId proteinReferenceID)
throws UserFailureException;
public ResultSet<ProteinSequence> listSequencesByProteinReference(ListProteinSequenceCriteria criteria)
throws UserFailureException;
public String prepareExportProteinSequences(TableExportCriteria<ProteinSequence> exportCriteria)
throws UserFailureException;
}
......@@ -23,8 +23,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.shared.basic.TechId;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.dto.ListProteinByExperimentCriteria;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.dto.ListProteinSequenceCriteria;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.dto.ProteinInfo;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.basic.dto.ProteinByExperiment;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.basic.dto.ProteinSequence;
/**
*
......@@ -36,7 +38,6 @@ public interface IPhosphoNetXClientServiceAsync extends IClientServiceAsync
/** @see IPhosphoNetXClientService#listProteinsByExperiment(ListProteinByExperimentCriteria) */
public void listProteinsByExperiment(ListProteinByExperimentCriteria criteria,
AsyncCallback<ResultSet<ProteinInfo>> callback);
/** @see IPhosphoNetXClientService#prepareExportProteins(TableExportCriteria) */
public void prepareExportProteins(TableExportCriteria<ProteinInfo> exportCriteria,
......@@ -45,4 +46,13 @@ public interface IPhosphoNetXClientServiceAsync extends IClientServiceAsync
/** @see IPhosphoNetXClientService#getProteinByExperiment(TechId, TechId) */
public void getProteinByExperiment(TechId experimentID, TechId proteinReferenceID,
AsyncCallback<ProteinByExperiment> callback);
/** @see IPhosphoNetXClientService#listSequencesByProteinReference(ListProteinSequenceCriteria) */
public void listSequencesByProteinReference(ListProteinSequenceCriteria criteria,
AsyncCallback<ResultSet<ProteinSequence>> callback);
/** @see IPhosphoNetXClientService#prepareExportProteinSequences(TableExportCriteria) */
public void prepareExportProteinSequences(TableExportCriteria<ProteinSequence> exportCriteria,
AsyncCallback<String> callback);
}
\ No newline at end of file
......@@ -35,6 +35,11 @@ public class Dict
// Protein Viewer
public static final String PROTEIN_IN_EXPERIMENT_TAB_LABEL = "protein_in_experiment_tab_label";
public static final String EXPERIMENT_LABEL = "experiment_label";
public static final String SEQUENCE_SHORT_NAME = "sequence_short_name";
public static final String DATABASE_NAME_AND_VERSION = "database_name_and_version";
public static final String SEQUENCE = "sequence";
public static final String SEQUENCES = "sequences";
}
......@@ -28,6 +28,7 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityType;
public enum PhosphoNetXDisplayTypeIDGenerator implements IDisplayTypeIDGenerator
{
PROTEIN_BY_EXPERIMENT_BROWSER_GRID("protein-by-experiment-browser-grid"),
PROTEIN_SEQUENCE_BROWSER_GRID("protein-sequence-browser-grid"),
;
private final String genericNameOrPrefix;
......
/*
* Copyright 2009 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.List;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.columns.framework.IColumnDefinitionKind;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.AbstractSimpleBrowserGrid;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.IDisposableComponent;
import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DefaultResultSetConfig;
import ch.systemsx.cisd.openbis.generic.client.web.client.dto.IColumnDefinition;
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.shared.basic.TechId;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.IPhosphoNetXClientServiceAsync;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.application.columns.ProteinSequenceColDefKind;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.dto.ListProteinSequenceCriteria;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.basic.dto.ProteinSequence;
/**
*
*
* @author Franz-Josef Elmer
*/
public class ProteinSequenceGrid extends AbstractSimpleBrowserGrid<ProteinSequence>
{
private static final String PREFIX = GenericConstants.ID_PREFIX + "protein-sequence-browser";
public static final String BROWSER_ID = PREFIX + "_main";
public static final String GRID_ID = PREFIX + "_grid";
static IDisposableComponent create(IViewContext<IPhosphoNetXClientServiceAsync> viewContext, TechId proteinReferenceID)
{
return new ProteinSequenceGrid(viewContext, proteinReferenceID).asDisposableWithoutToolbar();
}
private final IViewContext<IPhosphoNetXClientServiceAsync> specificViewContext;
private ListProteinSequenceCriteria criteria;
private ProteinSequenceGrid(IViewContext<IPhosphoNetXClientServiceAsync> viewContext,
TechId proteinReferenceID)
{
super(viewContext.getCommonViewContext(), BROWSER_ID + proteinReferenceID,
GRID_ID + proteinReferenceID, true);
specificViewContext = viewContext;
criteria = new ListProteinSequenceCriteria();
criteria.setProteinReferenceID(proteinReferenceID);
setDisplayTypeIDGenerator(PhosphoNetXDisplayTypeIDGenerator.PROTEIN_SEQUENCE_BROWSER_GRID);
}
@Override
protected IColumnDefinitionKind<ProteinSequence>[] getStaticColumnsDefinition()
{
return ProteinSequenceColDefKind.values();
}
@Override
protected List<IColumnDefinition<ProteinSequence>> getInitialFilters()
{
return asColumnFilters(new ProteinSequenceColDefKind[] {});
}
@Override
protected void listEntities(DefaultResultSetConfig<String, ProteinSequence> resultSetConfig,
AbstractAsyncCallback<ResultSet<ProteinSequence>> callback)
{
criteria.copyPagingConfig(resultSetConfig);
specificViewContext.getService().listSequencesByProteinReference(criteria, callback);
}
@Override
protected void prepareExportEntities(TableExportCriteria<ProteinSequence> exportCriteria,
AbstractAsyncCallback<String> callback)
{
specificViewContext.getService().prepareExportProteinSequences(exportCriteria, callback);
}
public DatabaseModificationKind[] getRelevantModifications()
{
return new DatabaseModificationKind[0];
}
}
......@@ -27,6 +27,7 @@ import com.extjs.gxt.ui.client.widget.layout.BorderLayout;
import com.extjs.gxt.ui.client.widget.layout.BorderLayoutData;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.BrowserSectionPanel;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewContext;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.DatabaseModificationAwareComponent;
......@@ -132,6 +133,8 @@ public class ProteinViewer extends
BorderLayoutData layoutData = createBorderLayoutData(LayoutRegion.WEST);
layoutData.setSize(400);
add(contentPanel, layoutData);
add(new BrowserSectionPanel(viewContext.getMessage(Dict.SEQUENCES), ProteinSequenceGrid
.create(viewContext, proteinreferenceID)), createRightBorderLayoutData());
layout();
}
......
/*
* Copyright 2009 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.columns;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.columns.framework.AbstractColumnDefinitionKind;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.columns.framework.IColumnDefinitionKind;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.application.Dict;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.basic.dto.ProteinSequence;
/**
*
*
* @author Franz-Josef Elmer
*/
public enum ProteinSequenceColDefKind implements IColumnDefinitionKind<ProteinSequence>
{
SHORT_NAME(new AbstractColumnDefinitionKind<ProteinSequence>(Dict.SEQUENCE_SHORT_NAME, 20)
{
@Override
public String tryGetValue(ProteinSequence entity)
{
return entity.getShortName();
}
}),
DATABASE(new AbstractColumnDefinitionKind<ProteinSequence>(Dict.DATABASE_NAME_AND_VERSION)
{
@Override
public String tryGetValue(ProteinSequence entity)
{
return entity.getDatabaseNameAndVersion();
}
}),
SEQUENCE(new AbstractColumnDefinitionKind<ProteinSequence>(Dict.SEQUENCE, 400)
{
@Override
public String tryGetValue(ProteinSequence entity)
{
return entity.getSequence();
}
}),
;
private final AbstractColumnDefinitionKind<ProteinSequence> columnDefinitionKind;
private ProteinSequenceColDefKind(AbstractColumnDefinitionKind<ProteinSequence> columnDefinitionKind)
{
this.columnDefinitionKind = columnDefinitionKind;
}
public String id()
{
return name();
}
public AbstractColumnDefinitionKind<ProteinSequence> getDescriptor()
{
return columnDefinitionKind;
}
}
/*
* Copyright 2009 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.dto;
import com.google.gwt.user.client.rpc.IsSerializable;
import ch.systemsx.cisd.openbis.generic.client.web.client.dto.DefaultResultSetConfig;
import ch.systemsx.cisd.openbis.generic.shared.basic.TechId;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.basic.dto.ProteinSequence;
/**
*
*
* @author Franz-Josef Elmer
*/
public class ListProteinSequenceCriteria extends
DefaultResultSetConfig<String, ProteinSequence> implements IsSerializable
{
private TechId proteinReferenceID;
public final TechId getProteinReferenceID()
{
return proteinReferenceID;
}
public final void setProteinReferenceID(TechId proteinReferenceID)
{
this.proteinReferenceID = proteinReferenceID;
}
}
......@@ -14,6 +14,10 @@ var phosphonetx = {
// Protein in experiment viewer
protein_in_experiment_tab_label: "{0} in {1}",
experiment_label: "Experiment",
sequence_short_name: "",
database_name_and_version: "Database",
sequence: "Amino Acid Sequence",
sequences: "Amino Acid Sequences",
// LAST LINE: KEEP IT AT THE END
lastline: "" // we need a line without a comma
......
/*
* Copyright 2009 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.server;
import java.util.List;
import ch.systemsx.cisd.common.exceptions.UserFailureException;
import ch.systemsx.cisd.openbis.generic.client.web.server.resultset.IOriginalDataProvider;
import ch.systemsx.cisd.openbis.generic.shared.basic.TechId;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.IPhosphoNetXServer;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.basic.dto.ProteinSequence;
/**
*
*
* @author Franz-Josef Elmer
*/
class ListProteinSequenceDataProvider implements IOriginalDataProvider<ProteinSequence>
{
private final IPhosphoNetXServer server;
private final String sessionToken;
private final TechId proteinReferenceID;
ListProteinSequenceDataProvider(IPhosphoNetXServer server, String sessionToken,
TechId proteinReferenceID)
{
this.server = server;
this.sessionToken = sessionToken;
this.proteinReferenceID = proteinReferenceID;
}
public List<ProteinSequence> getOriginalData() throws UserFailureException
{
return server.listProteinSequencesByProteinReference(sessionToken, proteinReferenceID);
}
}
......@@ -30,10 +30,12 @@ import ch.systemsx.cisd.openbis.generic.shared.IServer;
import ch.systemsx.cisd.openbis.generic.shared.basic.TechId;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.IPhosphoNetXClientService;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.dto.ListProteinByExperimentCriteria;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.dto.ListProteinSequenceCriteria;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.dto.ProteinInfo;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.IPhosphoNetXServer;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.ResourceNames;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.basic.dto.ProteinByExperiment;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.basic.dto.ProteinSequence;
/**
* @author Franz-Josef Elmer
......@@ -86,7 +88,21 @@ public class PhosphoNetXClientService extends AbstractClientService implements
{
throw UserFailureExceptionTranslator.translate(e);
}
}
public ResultSet<ProteinSequence> listSequencesByProteinReference(
ListProteinSequenceCriteria criteria)
throws ch.systemsx.cisd.openbis.generic.client.web.client.exception.UserFailureException
{
final String sessionToken = getSessionToken();
return listEntities(criteria, new ListProteinSequenceDataProvider(server, sessionToken,
criteria.getProteinReferenceID()));
}
public String prepareExportProteinSequences(TableExportCriteria<ProteinSequence> exportCriteria)
throws ch.systemsx.cisd.openbis.generic.client.web.client.exception.UserFailureException
{
return prepareExportEntities(exportCriteria);
}
}
......@@ -16,6 +16,7 @@
package ch.systemsx.cisd.openbis.plugin.phosphonetx.server;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Resource;
......@@ -96,7 +97,7 @@ public class PhosphoNetXServer extends AbstractServer<IPhosphoNetXServer> implem
return table.getProteinReferences();
}
public ProteinByExperiment getProteinByExperiment(String sessionToken, TechId experimentId,
public ProteinByExperiment getProteinByExperiment(String sessionToken, TechId experimentID,
TechId proteinReferenceID) throws UserFailureException
{
getSessionManager().getSession(sessionToken);
......@@ -110,18 +111,41 @@ public class PhosphoNetXServer extends AbstractServer<IPhosphoNetXServer> implem
}
proteinByExperiment.setUniprotID(proteinReference.getUniprotID());
proteinByExperiment.setDescription(proteinReference.getDescription());
return proteinByExperiment;
}
public List<ProteinSequence> listProteinSequencesByProteinReference(String sessionToken,
TechId proteinReferenceID) throws UserFailureException
{
IProteinQueryDAO proteinQueryDAO = specificDAOFactory.getProteinQueryDAO();
DataSet<Sequence> sequences =
proteinQueryDAO.listProteinSequencesByProteinReference(proteinReferenceID.getId());
ArrayList<ProteinSequence> proteinSequences =
new ArrayList<ProteinSequence>(sequences.size());
int number = 0;
for (Sequence sequence : sequences)
{
ProteinSequence proteinSequence = new ProteinSequence();
proteinSequence.setId(new TechId(sequence.getId()));
proteinSequence.setShortName(createShortName(number++));
proteinSequence.setSequence(sequence.getSequence());
proteinSequence.setDatabaseNameAndVersion(sequence.getDatabaseNameAndVersion());
proteinByExperiment.addSequence(proteinSequence);
proteinSequences.add(proteinSequence);
}
sequences.close();
return proteinByExperiment;
return proteinSequences;
}
private String createShortName(int number)
{
StringBuilder builder = new StringBuilder();
int n = number;
while (n > 0)
{
builder.insert(0, "ABCEDEFGHIJKLMNOPQRSTUVWXYZ".charAt(n % 26));
n /= 26;
}
return builder.toString();
}
}
......@@ -22,13 +22,10 @@ import ch.systemsx.cisd.authentication.ISessionManager;
import ch.systemsx.cisd.common.exceptions.UserFailureException;
import ch.systemsx.cisd.openbis.generic.server.AbstractServerLogger;
import ch.systemsx.cisd.openbis.generic.shared.basic.TechId;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.NewSample;
import ch.systemsx.cisd.openbis.generic.shared.dto.AttachmentPE;
import ch.systemsx.cisd.openbis.generic.shared.dto.SampleGenerationDTO;
import ch.systemsx.cisd.openbis.generic.shared.dto.Session;
import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.SampleIdentifier;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.IPhosphoNetXServer;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.basic.dto.ProteinByExperiment;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.basic.dto.ProteinSequence;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.dto.ProteinReference;
/**
......@@ -42,27 +39,6 @@ public class PhosphoNetXServerLogger extends AbstractServerLogger implements IPh
super(sessionManager, invocationSuccessful, elapsedTime);
}
public SampleGenerationDTO getSampleInfo(String sessionToken, SampleIdentifier sampleIdentifier)
throws UserFailureException
{
logAccess(sessionToken, "get_sample_info", "CODE(%s)", sampleIdentifier);
return null;
}
public SampleGenerationDTO getSampleInfo(String sessionToken, TechId sampleId)
throws UserFailureException
{
logAccess(sessionToken, "get_sample_info", "ID(%s)", sampleId);
return null;
}
public void registerSample(String sessionToken, NewSample newSample,
List<AttachmentPE> attachments)
{
logTracking(sessionToken, "register_sample", "SAMPLE_TYPE(%s) SAMPLE(%s) ATTACHMENTS(%s)",
newSample.getSampleType(), newSample.getIdentifier(), attachments.size());
}
public List<ProteinReference> listProteinsByExperiment(String sessionToken,
TechId experimentId, double falseDiscoveryRate) throws UserFailureException
{
......@@ -79,4 +55,12 @@ public class PhosphoNetXServerLogger extends AbstractServerLogger implements IPh
return null;
}
public List<ProteinSequence> listProteinSequencesByProteinReference(String sessionToken,
TechId proteinReferenceID) throws UserFailureException
{
logAccess(sessionToken, "list_protein_sequences_by_reference",
"PROTEIN_REFERENCE_ID(%s)", proteinReferenceID);
return null;
}
}
......@@ -20,6 +20,7 @@ import net.lemnik.eodsql.BaseQuery;
import net.lemnik.eodsql.DataSet;
import net.lemnik.eodsql.Select;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.dto.IdentifiedProtein;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.dto.ProbabilityFDRMapping;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.dto.ProteinReference;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.dto.ProteinReferenceWithProbability;
......@@ -46,7 +47,21 @@ public interface IProteinQueryDAO extends BaseQuery
@Select("select * from protein_references where id = ?{1}")
public ProteinReference tryToGetProteinReference(long proteinReferenceID);
@Select("select s.id, s.amino_acid_sequence, d.name_and_version "
+ "from sequences as s left join databases as d on s.db_id = d.id where s.prre_id = ?{1}")
@Select("select s.id, amino_acid_sequence, name_and_version "
+ "from sequences as s join databases as d on s.db_id = d.id "
+ "where s.prre_id = ?{1} order by name_and_version")
public DataSet<Sequence> listProteinSequencesByProteinReference(long proteinReferenceID);
@Select("select ds.id as data_set_id, ds.perm_id as data_set_perm_id, p.id as protein_id, "
+ "probability, count(pe.id) as peptide_count, amino_acid_sequence, name_and_version "
+ "from data_sets as ds join proteins as p on p.dase_id = ds.id "
+ " join identified_proteins as i on i.prot_id = p.id "
+ " join sequences as s on i.sequ_id = s.id "
+ " join databases as db on s.db_id = db.id "
+ " left join peptides as pe on pe.prot_id = p.id "
+ "where s.prre_id = ?{2} and ds.expe_id = ?{1} "
+ "group by data_set_id, data_set_perm_id, protein_id, probability, "
+ " amino_acid_sequence, name_and_version order by data_set_perm_id")
public DataSet<IdentifiedProtein> listProteinsByProteinReferenceAndExperiment(
long experimentID, long proteinReferenceID);
}
......@@ -28,6 +28,7 @@ import ch.systemsx.cisd.openbis.generic.shared.authorization.annotation.RolesAll
import ch.systemsx.cisd.openbis.generic.shared.authorization.predicate.AbstractTechIdPredicate.ExperimentTechIdPredicate;
import ch.systemsx.cisd.openbis.generic.shared.basic.TechId;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.basic.dto.ProteinByExperiment;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.basic.dto.ProteinSequence;
import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.dto.ProteinReference;
/**
......@@ -49,5 +50,8 @@ public interface IPhosphoNetXServer extends IServer
@AuthorizationGuard(guardClass = ExperimentTechIdPredicate.class)
TechId experimentId, TechId proteinReferenceID) throws UserFailureException;
@Transactional
@RolesAllowed(RoleSet.OBSERVER)
public List<ProteinSequence> listProteinSequencesByProteinReference(String sessionToken,
TechId proteinReferenceID) throws UserFailureException;
}
......@@ -32,12 +32,24 @@ public class ProteinSequence implements IsSerializable, Serializable
{
private static final long serialVersionUID = ServiceVersionHolder.VERSION;
private String shortName;
private TechId id;
private String sequence;
private String databaseNameAndVersion;
public final String getShortName()
{
return shortName;
}
public final void setShortName(String version)
{
this.shortName = version;
}
public final TechId getId()
{
return id;
......
......@@ -34,11 +34,14 @@ public class IdentifiedProtein extends AbstractDTOWithID
@ResultColumn("protein_id")
private long proteinID;
@ResultColumn("uniprot_id")
private String uniprotID;
@ResultColumn("peptide_count")
private int peptideCount;
@ResultColumn("description")
private String description;
@ResultColumn("amino_acid_sequence")
private String sequence;
@ResultColumn("name_and_version")
private String database;
@ResultColumn("probability")
private double probability;
......@@ -55,24 +58,24 @@ public class IdentifiedProtein extends AbstractDTOWithID
this.dataSetPermID = dataSetPermID;
}
public final String getUniprotID()
public final int getPeptideCount()
{
return uniprotID;
return peptideCount;
}
public final void setUniprotID(String uniprotID)
public final void setPeptideCount(int uniprotID)
{
this.uniprotID = uniprotID;
this.peptideCount = uniprotID;
}
public final String getDescription()
public final String getSequence()
{
return description;
return sequence;
}
public final void setDescription(String description)
public final void setSequence(String description)
{
this.description = description;
this.sequence = description;
}
public final long getDataSetID()
......@@ -115,5 +118,15 @@ public class IdentifiedProtein extends AbstractDTOWithID
this.falseDiscoveryRate = falseDiscoveryRate;
}
public final String getDatabase()
{
return database;
}
public final void setDatabase(String database)
{
this.database = database;
}
}
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