diff --git a/genotyping/src/org/labkey/genotyping/GenotypingAnalysis.java b/genotyping/src/org/labkey/genotyping/GenotypingAnalysis.java index 39dbae2d..4ade77cf 100644 --- a/genotyping/src/org/labkey/genotyping/GenotypingAnalysis.java +++ b/genotyping/src/org/labkey/genotyping/GenotypingAnalysis.java @@ -30,7 +30,7 @@ */ public class GenotypingAnalysis { - private int _rowId; + private long _rowId; private Container _container; private int _run; private int _createdBy; @@ -57,12 +57,12 @@ public GenotypingAnalysis(Container c, User user, GenotypingRun run, @Nullable S setSequencesView(sequencesView); } - public int getRowId() + public long getRowId() { return _rowId; } - public void setRowId(int rowId) + public void setRowId(long rowId) { _rowId = rowId; } diff --git a/genotyping/src/org/labkey/genotyping/GenotypingController.java b/genotyping/src/org/labkey/genotyping/GenotypingController.java index f215fab6..461374b6 100644 --- a/genotyping/src/org/labkey/genotyping/GenotypingController.java +++ b/genotyping/src/org/labkey/genotyping/GenotypingController.java @@ -172,7 +172,7 @@ public PageConfig defaultPageConfig() } - public static ActionURL getAnalysisURL(Container c, int analysisId) + public static ActionURL getAnalysisURL(Container c, long analysisId) { ActionURL url = new ActionURL(AnalysisAction.class, c); url.addParameter("analysis", analysisId); @@ -182,17 +182,17 @@ public static ActionURL getAnalysisURL(Container c, int analysisId) public static class AnalysisForm extends QueryExportForm { - private Integer _analysis = null; + private Long _analysis = null; private Integer _highlightId = null; private String _error = null; - public Integer getAnalysis() + public Long getAnalysis() { return _analysis; } @SuppressWarnings({"UnusedDeclaration"}) - public void setAnalysis(Integer analysis) + public void setAnalysis(Long analysis) { _analysis = analysis; } @@ -1423,7 +1423,7 @@ public URLHelper getSuccessURL(PipelinePathForm pipelinePathForm) } - private void importAnalysis(int analysisId, FileLike pipelineDir, User user) throws IOException, PipelineValidationException + private void importAnalysis(long analysisId, FileLike pipelineDir, User user) throws IOException, PipelineValidationException { GenotypingAnalysis analysis = GenotypingManager.get().getAnalysis(getContainer(), analysisId); FileLike analysisDir = new FileSystemLike.Builder(Paths.get(analysis.getPath())).readwrite().root(); @@ -1916,9 +1916,9 @@ public void validateCommand(Object target, Errors errors) public boolean handlePost(Object o, BindException errors) { GenotypingManager gm = GenotypingManager.get(); - Set runs = DataRegionSelection.getSelectedIntegers(getViewContext(), true); + Set runs = DataRegionSelection.getSelectedIntegers(getViewContext(), true); - for (Integer runId : runs) + for (Long runId : runs) { GenotypingRun run = gm.getRun(getContainer(), runId); gm.deleteRun(run); @@ -1948,7 +1948,7 @@ public boolean handlePost(Object o, BindException errors) throws Exception { GenotypingManager gm = GenotypingManager.get(); - for (Integer analysisId : DataRegionSelection.getSelectedIntegers(getViewContext(), true)) + for (Long analysisId : DataRegionSelection.getSelectedIntegers(getViewContext(), true)) { GenotypingAnalysis analysis = gm.getAnalysis(getContainer(), analysisId); gm.deleteAnalysis(analysis); @@ -1968,7 +1968,7 @@ public ActionURL getSuccessURL(Object o) public static class MatchReadsForm extends RunForm { private int _match = 0; - private int _analysis = 0; + private long _analysis = 0; public int getMatch() { @@ -1981,13 +1981,13 @@ public void setMatch(int run) _match = run; } - public int getAnalysis() + public long getAnalysis() { return _analysis; } @SuppressWarnings({"UnusedDeclaration"}) - public void setAnalysis(int analysis) + public void setAnalysis(long analysis) { _analysis = analysis; } @@ -2038,18 +2038,18 @@ protected void handleSettings(QuerySettings settings) public static class AssignmentReportBean { - private final Collection _ids; + private final Collection _ids; private final String _assayName; private final ActionURL _returnUrl; - public AssignmentReportBean(Collection ids, String assayName, ActionURL returnUrl) + public AssignmentReportBean(Collection ids, String assayName, ActionURL returnUrl) { _ids = ids; _assayName = assayName; _returnUrl = returnUrl; } - public Collection getIds() + public Collection getIds() { return _ids; } @@ -2076,7 +2076,7 @@ public ModelAndView getView(ProtocolIdForm form, BindException errors) _protocol = form.getProtocol(); // when coming from the results grid, we use the selected rows as the initial set of IDs for the report form - Set selected = DataRegionSelection.getSelectedIntegers(getViewContext(), false); + Set selected = DataRegionSelection.getSelectedIntegers(getViewContext(), false); VBox result = new VBox(); AssayHeaderView header = new AssayHeaderView(form.getProtocol(), form.getProvider(), false, true, null); diff --git a/genotyping/src/org/labkey/genotyping/GenotypingManager.java b/genotyping/src/org/labkey/genotyping/GenotypingManager.java index 3daa2c53..4e835c93 100644 --- a/genotyping/src/org/labkey/genotyping/GenotypingManager.java +++ b/genotyping/src/org/labkey/genotyping/GenotypingManager.java @@ -134,7 +134,7 @@ public GenotypingRun createRun(Container c, User user, Integer metaDataId, FileL return Table.insert(user, GenotypingSchema.get().getRunsTable(), run); } - public @Nullable GenotypingRun getRun(Container c, int runId) + public @Nullable GenotypingRun getRun(Container c, long runId) { return new TableSelector(GenotypingSchema.get().getRunsTable()).getObject(c, runId, GenotypingRun.class); } @@ -156,7 +156,7 @@ public GenotypingAnalysis createAnalysis(Container c, User user, GenotypingRun r return Table.insert(user, GenotypingSchema.get().getAnalysesTable(), new GenotypingAnalysis(c, user, run, description, sequencesViewName)); } - public @NotNull GenotypingAnalysis getAnalysis(Container c, Integer analysisId) + public @NotNull GenotypingAnalysis getAnalysis(Container c, Long analysisId) { if (null == analysisId) throw new NotFoundException("Analysis parameter is missing"); @@ -437,7 +437,7 @@ public int insertMatch(User user, GenotypingAnalysis analysis, int sampleId, Res return matchId; } - public int deleteMatches(Container c, User user, int analysisId, List matchIds) + public int deleteMatches(Container c, User user, long analysisId, List matchIds) { // Validate analysis was posted and exists in this container GenotypingAnalysis analysis = GenotypingManager.get().getAnalysis(c, analysisId); diff --git a/genotyping/src/org/labkey/genotyping/GenotypingQuerySchema.java b/genotyping/src/org/labkey/genotyping/GenotypingQuerySchema.java index 5341d948..f25263b5 100644 --- a/genotyping/src/org/labkey/genotyping/GenotypingQuerySchema.java +++ b/genotyping/src/org/labkey/genotyping/GenotypingQuerySchema.java @@ -85,7 +85,7 @@ public class GenotypingQuerySchema extends UserSchema private SortedMap> _allHaplotypes; - @Nullable private final Integer _analysisId; + @Nullable private final Long _analysisId; public enum TableType { @@ -289,7 +289,7 @@ FilteredTable createTable(GenotypingQuerySchema schema, ContainerFilter cf) } @Override - public FilteredTable createTable(final GenotypingQuerySchema schema, ContainerFilter cf, @Nullable final Integer analysisId) + public FilteredTable createTable(final GenotypingQuerySchema schema, ContainerFilter cf, @Nullable final Long analysisId) { FilteredTable table = new FilteredTable<>(GS.getMatchesTable(), schema, cf); //TODO: filter on container?? @@ -686,7 +686,7 @@ boolean isAvailable(GenotypingQuerySchema schema) } // Special factory method for Matches table, to pass through analysis id (if present) - FilteredTable createTable(GenotypingQuerySchema schema, ContainerFilter cf, @Nullable Integer analysisId) + FilteredTable createTable(GenotypingQuerySchema schema, ContainerFilter cf, @Nullable Long analysisId) { return createTable(schema, cf); } @@ -887,7 +887,7 @@ public GenotypingQuerySchema(User user, Container container) this(user, container, null); } - public GenotypingQuerySchema(User user, Container container, @Nullable Integer analysisId) + public GenotypingQuerySchema(User user, Container container, @Nullable Long analysisId) { super(NAME, "Contains genotyping data", user, container, GS.getSchema()); _analysisId = analysisId; @@ -899,7 +899,7 @@ public TableInfo createTable(String name, ContainerFilter cf) // Special handling for Matches -- need to pass in Analysis if (name.startsWith(TableType.Matches.name())) { - Integer analysisId = _analysisId; + Long analysisId = _analysisId; if (null == analysisId) { @@ -909,7 +909,7 @@ public TableInfo createTable(String name, ContainerFilter cf) { if (split.length == 2 && TableType.Matches.name().equals(split[0])) { - analysisId = Integer.parseInt(split[1]); + analysisId = Long.parseLong(split[1]); } else { diff --git a/genotyping/src/org/labkey/genotyping/HaplotypeDataHandler.java b/genotyping/src/org/labkey/genotyping/HaplotypeDataHandler.java index c9f29e7c..23da88d2 100644 --- a/genotyping/src/org/labkey/genotyping/HaplotypeDataHandler.java +++ b/genotyping/src/org/labkey/genotyping/HaplotypeDataHandler.java @@ -21,6 +21,7 @@ import org.junit.Test; import org.labkey.api.collections.CaseInsensitiveHashMap; import org.labkey.api.collections.CaseInsensitiveTreeMap; +import org.labkey.api.collections.IntHashMap; import org.labkey.api.data.Container; import org.labkey.api.data.SQLFragment; import org.labkey.api.data.SimpleFilter; @@ -356,7 +357,7 @@ private Map insertAnimalAnalysis(ExpRun run, List map = new HashMap<>(); + Map map = new IntHashMap<>(); for (Map insertedRow : insertedRows) { map.put(Integer.parseInt(insertedRow.get("animalid").toString()), Integer.parseInt(insertedRow.get("RowId").toString())); @@ -476,7 +477,7 @@ public Priority getPriority(ExpData data) } @Override - public void runMoved(ExpData newData, Container container, Container targetContainer, String oldRunLSID, String newRunLSID, User user, int oldDataRowID) + public void runMoved(ExpData newData, Container container, Container targetContainer, String oldRunLSID, String newRunLSID, User user, long oldDataRowID) { throw new UnsupportedOperationException(); } diff --git a/genotyping/src/org/labkey/genotyping/IlluminaFastqParser.java b/genotyping/src/org/labkey/genotyping/IlluminaFastqParser.java index 29c2bc84..8513fb3f 100644 --- a/genotyping/src/org/labkey/genotyping/IlluminaFastqParser.java +++ b/genotyping/src/org/labkey/genotyping/IlluminaFastqParser.java @@ -27,6 +27,7 @@ import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; +import org.labkey.api.collections.IntHashMap; import org.labkey.api.data.Container; import org.labkey.api.data.ContainerManager; import org.labkey.api.files.FileContentService; @@ -506,9 +507,9 @@ public void testHeaders() throws PipelineJobException, IOException int i = 0; int numOfPairs = pairs.length; Set> expectedOutputs = new HashSet<>(); - Map sampleIndexToIdMap = new HashMap<>(); + Map sampleIndexToIdMap = new IntHashMap<>(); sampleIndexToIdMap.put(0, 0); - Map sampleIdToIndexMap = new HashMap<>(); + Map sampleIdToIndexMap = new IntHashMap<>(); sampleIdToIndexMap.put(0, 0); List oldHeaderFiles = new ArrayList<>(); List newHeaderFiles = new ArrayList<>(); diff --git a/genotyping/src/org/labkey/genotyping/ImportIlluminaReadsJob.java b/genotyping/src/org/labkey/genotyping/ImportIlluminaReadsJob.java index 11e43d17..7da095e6 100644 --- a/genotyping/src/org/labkey/genotyping/ImportIlluminaReadsJob.java +++ b/genotyping/src/org/labkey/genotyping/ImportIlluminaReadsJob.java @@ -21,6 +21,7 @@ import org.apache.commons.lang3.StringUtils; import org.jetbrains.annotations.Nullable; import org.labkey.api.collections.CaseInsensitiveHashMap; +import org.labkey.api.collections.IntHashMap; import org.labkey.api.data.DbScope; import org.labkey.api.data.Table; import org.labkey.api.data.TableInfo; @@ -137,9 +138,9 @@ private void importReads() throws PipelineJobException, SQLException //parse the samples file String[] nextLine; /* Index is the number of the sample as ordered in SampleType CSV, mapped to the unique RowId for each sample */ - Map sampleIndexToIdMap = new HashMap<>(); + Map sampleIndexToIdMap = new IntHashMap<>(); /* Unique RowId for each sample mapped to the index is the number of the sample as ordered in SampleType CSV */ - Map sampleIdToIndexMap = new HashMap<>(); + Map sampleIdToIndexMap = new IntHashMap<>(); /* Name for each sample, mapped to the RowId of the sample */ Map sampleNameToIdMap = new HashMap<>(); sampleIndexToIdMap.put(0, 0); //placeholder for control and unmapped reads diff --git a/genotyping/src/org/labkey/genotyping/Status.java b/genotyping/src/org/labkey/genotyping/Status.java index 72558945..999fce34 100644 --- a/genotyping/src/org/labkey/genotyping/Status.java +++ b/genotyping/src/org/labkey/genotyping/Status.java @@ -15,6 +15,8 @@ */ package org.labkey.genotyping; +import org.labkey.api.collections.IntHashMap; + import java.util.HashMap; import java.util.Map; @@ -27,7 +29,7 @@ public enum Status { NotSubmitted(0), Submitted(1), Importing(2), Complete(3); - private static final Map _map = new HashMap<>(); + private static final Map _map = new IntHashMap<>(); static {