Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
19 changes: 10 additions & 9 deletions elisa/src/org/labkey/elisa/ElisaAssayProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
import org.labkey.elisa.plate.BioTekPlateReader;
import org.springframework.web.servlet.ModelAndView;

import java.lang.reflect.InvocationTargetException;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
Expand Down Expand Up @@ -141,10 +142,10 @@ enum PlateReaderType
{
BIOTEK(BioTekPlateReader.LABEL, BioTekPlateReader.class);

private String _label;
private Class _class;
private final String _label;
private final Class<? extends PlateReader> _class;

private PlateReaderType(String label, Class cls)
PlateReaderType(String label, Class<? extends PlateReader> cls)
{
_label = label;
_class = cls;
Expand All @@ -159,9 +160,9 @@ public PlateReader getInstance()
{
try
{
return (PlateReader)_class.newInstance();
return _class.getDeclaredConstructor().newInstance();
}
catch (InstantiationException | IllegalAccessException x)
catch (InstantiationException | IllegalAccessException | InvocationTargetException | NoSuchMethodException x)
{
throw new RuntimeException(x);
}
Expand Down Expand Up @@ -295,11 +296,11 @@ private DomainProperty addPropertyWithFormat(Domain domain, String name, String
}

@Override
public HttpView getDataDescriptionView(AssayRunUploadForm form)
public HttpView<?> getDataDescriptionView(AssayRunUploadForm form)
{
if (form instanceof ElisaRunUploadForm)
if (form instanceof ElisaRunUploadForm eForm)
{
if (((ElisaRunUploadForm)form).getSampleMetadataInputFormat() == SampleMetadataInputFormat.COMBINED)
if (eForm.getSampleMetadataInputFormat() == SampleMetadataInputFormat.COMBINED)
return new JspView<>("/org/labkey/assay/view/tsvDataDescription.jsp", form);
}
return new HtmlView(HtmlString.of("The ELISA data files must be in the BioTek Microplate Reader Excel file format (.xls or .xlsx extension)."));
Expand Down Expand Up @@ -438,7 +439,7 @@ protected void moveAssayResults(List<ExpRun> runs, ExpProtocol protocol, Contain
// move specimen
String tableName = AssayProtocolSchema.DATA_TABLE_NAME;
AssaySchema schema = createProtocolSchema(user, targetContainer, protocol, null);
FilteredTable assayResultTable = (FilteredTable) schema.getTable(tableName);
FilteredTable<?> assayResultTable = (FilteredTable<?>) schema.getTable(tableName);
if (assayResultTable != null)
{
TableInfo expMaterialTable = ExperimentService.get().getTinfoMaterial();
Expand Down
2 changes: 1 addition & 1 deletion elisa/src/org/labkey/elisa/ElisaController.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public void setProtocolId(int protocolId)
}

@RequiresPermission(ReadPermission.class)
public class GetCurveFitXYPairs extends ReadOnlyApiAction<GetCurveFitXYPairsForm>
public static class GetCurveFitXYPairs extends ReadOnlyApiAction<GetCurveFitXYPairsForm>
{
ExpRun _run;

Expand Down
2 changes: 1 addition & 1 deletion elisa/src/org/labkey/elisa/ElisaImportHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

public interface ElisaImportHelper
{
public static String PLACEHOLDER_PLATE_NAME = "PLACEHOLDER_PLATE";
String PLACEHOLDER_PLATE_NAME = "PLACEHOLDER_PLATE";

/**
* Gets the set of plate names in this import
Expand Down
3 changes: 1 addition & 2 deletions elisa/src/org/labkey/elisa/ElisaProtocolSchema.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import org.labkey.api.data.DbSchema;
import org.labkey.api.data.TableInfo;
import org.labkey.api.exp.api.ExpProtocol;
import org.labkey.api.query.FilteredTable;
import org.labkey.api.security.User;
import org.labkey.elisa.query.CurveFitTable;
import org.labkey.elisa.query.ElisaResultsTable;
Expand Down Expand Up @@ -67,7 +66,7 @@ protected TableInfo createProviderTable(String name, ContainerFilter cf)
}

@Override
public FilteredTable createDataTable(ContainerFilter cf, boolean includeLinkedToStudyColumns)
public ElisaResultsTable createDataTable(ContainerFilter cf, boolean includeLinkedToStudyColumns)
{
return new ElisaResultsTable(this, cf, includeLinkedToStudyColumns);
}
Expand Down
14 changes: 7 additions & 7 deletions elisa/src/org/labkey/elisa/HighThroughputImportHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class HighThroughputImportHelper extends AbstractElisaImportHelper
{
private static final Logger LOG = LogManager.getLogger(HighThroughputImportHelper.class);

private Map<String, AnalytePlate> _plateMap = new HashMap<>();
private final Map<String, AnalytePlate> _plateMap = new HashMap<>();
private Plate _plateTemplate;

public HighThroughputImportHelper(AssayUploadXarContext context, PlateBasedAssayProvider provider, ExpProtocol protocol, File dataFile) throws ExperimentException
Expand Down Expand Up @@ -77,7 +77,7 @@ private void ensureData() throws ExperimentException
}
}
else
LOG.warn("No well location and plate name for row : " + row.toString());
LOG.warn("No well location and plate name for row : " + row);
}
}
catch (IOException e)
Expand Down Expand Up @@ -171,12 +171,12 @@ public Map<String, Object> getExtraProperties(String plateName, Position positio

private static class AnalytePlate
{
private Map<Integer, Map<String, Double>> _stdConcentrations = new HashMap<>();
private Map<Integer, double[][]> _dataMap = new HashMap<>();
private String _plateName;
private Plate _plateTemplate;
private final Map<Integer, Map<String, Double>> _stdConcentrations = new HashMap<>();
private final Map<Integer, double[][]> _dataMap = new HashMap<>();
private final String _plateName;
private final Plate _plateTemplate;
// contains the mapping of (well/analyte) to extra row data to merge during data import
private Map<String, Map<String, Object>> _extraWellData = new HashMap<>();
private final Map<String, Map<String, Object>> _extraWellData = new HashMap<>();
public static final String CONTROL_ID_COLUMN = "Sample";

public AnalytePlate(String plateName, Plate plateTemplate)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import org.labkey.api.data.DataRegion;
import org.labkey.api.exp.ExperimentException;
import org.labkey.api.exp.api.ExpProtocol;
import org.labkey.api.exp.api.ExpRun;
import org.labkey.api.exp.api.ExperimentService;
import org.labkey.api.exp.property.DomainProperty;
import org.labkey.api.query.PropertyValidationError;
Expand Down Expand Up @@ -117,7 +116,7 @@ public boolean executeStep(ElisaRunUploadForm form, BindException errors) throws
}

@Override
public ModelAndView getNextStep(ElisaRunUploadForm form, BindException errors) throws ServletException, SQLException, ExperimentException
public ModelAndView getNextStep(ElisaRunUploadForm form, BindException errors) throws ExperimentException
{
if (form.isResetDefaultValues() || errors.hasErrors())
return getRunPropertiesView(form, !form.isResetDefaultValues(), false, errors);
Expand Down Expand Up @@ -230,15 +229,14 @@ public void validateStep(ElisaRunUploadForm form, Errors errors)
@Override
public boolean executeStep(ElisaRunUploadForm form, BindException errors) throws ServletException, SQLException, ExperimentException
{
ExpRun run;
try
{
PlateConcentrationPropertyHelper helper = createConcentrationPropertyHelper(form.getContainer(), form.getProtocol(), form.getProvider());

Map<String, Map<DomainProperty, String>> postedProps = helper.getPostedPropertyValues(form.getRequest());
form.setConcentrationProperties(postedProps);

run = saveExperimentRun(form);
saveExperimentRun(form);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could remove unused run var now


for (Map.Entry<String, Map<DomainProperty, String>> entry : postedProps.entrySet())
form.saveDefaultValues(entry.getValue(), entry.getKey());
Expand All @@ -263,7 +261,7 @@ public boolean executeStep(ElisaRunUploadForm form, BindException errors) throws
}

@Override
public ModelAndView getNextStep(ElisaRunUploadForm form, BindException errors) throws ServletException, SQLException, ExperimentException
public ModelAndView getNextStep(ElisaRunUploadForm form, BindException errors) throws ExperimentException
{
if (form.isResetDefaultValues() || errors.hasErrors())
return getConcentrationsView(form, !form.isResetDefaultValues(), errors);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ protected boolean isCopyable(DomainProperty pd)
@Override
public List<String> getSampleNames()
{
return Arrays.asList(_controlNames.toArray(new String[_controlNames.size()]));
return Arrays.asList(_controlNames.toArray(new String[0]));
}

@Override
Expand Down
2 changes: 0 additions & 2 deletions elisa/src/org/labkey/elisa/query/CurveFitTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
import org.labkey.api.assay.AssayProtocolSchema;
import org.labkey.api.data.ColumnInfo;
import org.labkey.api.data.ContainerFilter;
import org.labkey.api.data.ContainerForeignKey;
import org.labkey.api.exp.api.ExpProtocol;
import org.labkey.api.query.FilteredTable;
import org.labkey.api.query.UserIdForeignKey;
import org.labkey.elisa.ElisaProtocolSchema;

public class CurveFitTable extends FilteredTable<AssayProtocolSchema>
Expand Down
1 change: 0 additions & 1 deletion elisa/src/org/labkey/elisa/query/ElisaResultsTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import org.labkey.api.exp.api.SampleTypeService;
import org.labkey.api.exp.property.DomainProperty;
import org.labkey.api.exp.query.ExpMaterialTable;
import org.labkey.api.exp.query.ExpSchema;
import org.labkey.api.query.FieldKey;
import org.labkey.api.query.LookupForeignKey;
import org.labkey.api.query.PropertyForeignKey;
Expand Down
13 changes: 7 additions & 6 deletions elispotassay/src/org/labkey/elispot/ElispotAssayProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
import org.labkey.elispot.plate.AIDPlateReader;
import org.labkey.elispot.query.ElispotAntigenDomainKind;

import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
Expand Down Expand Up @@ -102,10 +103,10 @@ enum PlateReaderType
AID("AID", AIDPlateReader.class),
ZEISS("Zeiss", TextPlateReader.class);

private String _label;
private Class _class;
private final String _label;
private final Class<? extends PlateReader> _class;

PlateReaderType(String label, Class cls)
PlateReaderType(String label, Class<? extends PlateReader> cls)
{
_label = label;
_class = cls;
Expand All @@ -120,9 +121,9 @@ public PlateReader getInstance()
{
try
{
return (PlateReader)_class.newInstance();
return _class.getDeclaredConstructor().newInstance();
}
catch (InstantiationException | IllegalAccessException x)
catch (InstantiationException | IllegalAccessException | InvocationTargetException | NoSuchMethodException x)
{
throw new RuntimeException(x);
}
Expand Down Expand Up @@ -238,7 +239,7 @@ public List<Pair<Domain, Map<DomainProperty, Object>>> createDefaultDomains(Cont
}

@Override
public HttpView getDataDescriptionView(AssayRunUploadForm form)
public HttpView<?> getDataDescriptionView(AssayRunUploadForm form)
{
return HtmlView.of("The data file is the output file from the plate reader that has been selected.");
}
Expand Down
12 changes: 6 additions & 6 deletions elispotassay/src/org/labkey/elispot/ElispotController.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public ElispotController()
}

@RequiresPermission(ReadPermission.class)
public class BeginAction extends SimpleViewAction
public static class BeginAction extends SimpleViewAction<Object>
{
@Override
public ModelAndView getView(Object o, BindException errors)
Expand Down Expand Up @@ -255,7 +255,7 @@ private void addRunFilter(ExpProtocol protocol, ActionURL url, int rowId)
url.addFilter(ElispotProtocolSchema.ANTIGEN_STATS_TABLE_NAME, provider.getTableMetadata(protocol).getRunRowIdFieldKeyFromResults(), CompareType.EQUAL, rowId);
}

private class ElispotDetailsHeaderView extends AssayHeaderView
private static class ElispotDetailsHeaderView extends AssayHeaderView
{
List<NavTree> _links = new ArrayList<>();

Expand Down Expand Up @@ -341,7 +341,7 @@ public ApiResponse execute(DetailsForm form, BindException errors)
}
}
response.put("summary", rows);
if (analyteMap.size() > 0)
if (!analyteMap.isEmpty())
{
response.put("analytes", analyteMap.keySet());
response.put("analyteMap", analyteMap);
Expand Down Expand Up @@ -374,9 +374,9 @@ public static class WellInfo
private String _spotSize = "";
private String _activity = "";
private String _intensity = "";
private Map<String, ObjectProperty> _wellProperties = new LinkedHashMap<>();
private final Map<String, ObjectProperty> _wellProperties = new LinkedHashMap<>();
private final RunDataRow _runDataRow;
private Position _position;
private final Position _position;

public WellInfo(@Nullable RunDataRow runDataRow, Position position)
{
Expand Down Expand Up @@ -530,7 +530,7 @@ public void setFluorospot(boolean fluorospot)
}

@RequiresPermission(InsertPermission.class)
public class BackgroundSubtractionAction extends FormHandlerAction<Object>
public static class BackgroundSubtractionAction extends FormHandlerAction<Object>
{
@Override
public void validateCommand(Object target, Errors errors)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import org.labkey.api.view.ViewContext;
import org.labkey.vfs.FileLike;

import java.io.File;
import java.util.List;
import java.util.Map;
import java.util.Set;
Expand Down Expand Up @@ -79,9 +78,8 @@ public void createSampleData(
) throws Exception
{
AssayProvider provider = AssayService.get().getProvider(protocol);
if (provider instanceof ElispotAssayProvider)
if (provider instanceof ElispotAssayProvider plateProvider)
{
ElispotAssayProvider plateProvider = (ElispotAssayProvider)provider;
Plate template = plateProvider.getPlate(viewContext.getContainer(), protocol);
if (template != null)
{
Expand Down
2 changes: 1 addition & 1 deletion elispotassay/src/org/labkey/elispot/ElispotManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public Map<String, Set<Integer>> getAntigenHeadings(Container container, TableIn
if (null != antigenHeading)
{
if (!antigenHeadingMap.containsKey(antigenHeading))
antigenHeadingMap.put(antigenHeading, new HashSet<Integer>());
antigenHeadingMap.put(antigenHeading, new HashSet<>());
antigenHeadingMap.get(antigenHeading).add((Integer)object.get("RunId"));
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public TableInfo createTable(String name, ContainerFilter cf)
{
if (name.equalsIgnoreCase(ELISPOT_PLATE_READER_TABLE))
{
EnumTableInfo<ElispotAssayProvider.PlateReaderType> result = new EnumTableInfo<>(ElispotAssayProvider.PlateReaderType.class, this, new EnumTableInfo.EnumValueGetter<ElispotAssayProvider.PlateReaderType>()
EnumTableInfo<ElispotAssayProvider.PlateReaderType> result = new EnumTableInfo<>(ElispotAssayProvider.PlateReaderType.class, this, new EnumTableInfo.EnumValueGetter<>()
{
@Override
public String getValue(ElispotAssayProvider.PlateReaderType e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
*/
public class FluorescentPlateInfo implements PlateInfo
{
private String _measurement;
private String _analyte;
private final String _measurement;
private final String _analyte;

private FluorescentPlateInfo(String measurement, String analyte)
{
Expand All @@ -52,7 +52,6 @@ public String getAnalyte()

/**
* Factory to parse annotations and create PlateInfo instances
* @return
*/
@Nullable
public static FluorescentPlateInfo create(List<String> annotations)
Expand Down
36 changes: 17 additions & 19 deletions elispotassay/src/org/labkey/elispot/plate/PlateInfo.java
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
/*
* Copyright (c) 2015 LabKey Corporation
*
* 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.
*/
/*
* Copyright (c) 2015 LabKey Corporation
*
* 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 org.labkey.elispot.plate;

import org.jetbrains.annotations.NotNull;
Expand All @@ -27,13 +27,11 @@ public interface PlateInfo
* Returns the type of measurement the corresponding plate contains
* @return the measurement name
*/
@NotNull
public String getMeasurement();
@NotNull String getMeasurement();

/**
* Returns the name of the analyte used for a corresponding plate data
* @return the name of the analyte
*/
@Nullable
public String getAnalyte();
@Nullable String getAnalyte();
}
Loading
Loading