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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions genotyping/src/org/labkey/genotyping/GenotypingAnalysis.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*/
public class GenotypingAnalysis
{
private int _rowId;
private long _rowId;
private Container _container;
private int _run;
private int _createdBy;
Expand All @@ -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;
}
Expand Down
30 changes: 15 additions & 15 deletions genotyping/src/org/labkey/genotyping/GenotypingController.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
}
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -1916,9 +1916,9 @@ public void validateCommand(Object target, Errors errors)
public boolean handlePost(Object o, BindException errors)
{
GenotypingManager gm = GenotypingManager.get();
Set<Integer> runs = DataRegionSelection.getSelectedIntegers(getViewContext(), true);
Set<Long> runs = DataRegionSelection.getSelectedIntegers(getViewContext(), true);

for (Integer runId : runs)
for (Long runId : runs)
{
GenotypingRun run = gm.getRun(getContainer(), runId);
gm.deleteRun(run);
Expand Down Expand Up @@ -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);
Expand All @@ -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()
{
Expand All @@ -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;
}
Expand Down Expand Up @@ -2038,18 +2038,18 @@ protected void handleSettings(QuerySettings settings)

public static class AssignmentReportBean
{
private final Collection<Integer> _ids;
private final Collection<Long> _ids;
private final String _assayName;
private final ActionURL _returnUrl;

public AssignmentReportBean(Collection<Integer> ids, String assayName, ActionURL returnUrl)
public AssignmentReportBean(Collection<Long> ids, String assayName, ActionURL returnUrl)
{
_ids = ids;
_assayName = assayName;
_returnUrl = returnUrl;
}

public Collection<Integer> getIds()
public Collection<Long> getIds()
{
return _ids;
}
Expand All @@ -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<Integer> selected = DataRegionSelection.getSelectedIntegers(getViewContext(), false);
Set<Long> selected = DataRegionSelection.getSelectedIntegers(getViewContext(), false);

VBox result = new VBox();
AssayHeaderView header = new AssayHeaderView(form.getProtocol(), form.getProvider(), false, true, null);
Expand Down
6 changes: 3 additions & 3 deletions genotyping/src/org/labkey/genotyping/GenotypingManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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");
Expand Down Expand Up @@ -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<Integer> matchIds)
public int deleteMatches(Container c, User user, long analysisId, List<Integer> matchIds)
{
// Validate analysis was posted and exists in this container
GenotypingAnalysis analysis = GenotypingManager.get().getAnalysis(c, analysisId);
Expand Down
12 changes: 6 additions & 6 deletions genotyping/src/org/labkey/genotyping/GenotypingQuerySchema.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public class GenotypingQuerySchema extends UserSchema

private SortedMap<Integer, Map<String, String>> _allHaplotypes;

@Nullable private final Integer _analysisId;
@Nullable private final Long _analysisId;

public enum TableType
{
Expand Down Expand Up @@ -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??
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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;
Expand All @@ -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)
{
Expand All @@ -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
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -356,7 +357,7 @@ private Map<Integer, Integer> insertAnimalAnalysis(ExpRun run, List<HaplotypeAss
throwFirstError(errors);

// return a mapping from the AnimalId to the AnimalAnalysis RowId
Map<Integer, Integer> map = new HashMap<>();
Map<Integer, Integer> map = new IntHashMap<>();
for (Map<String, Object> insertedRow : insertedRows)
{
map.put(Integer.parseInt(insertedRow.get("animalid").toString()), Integer.parseInt(insertedRow.get("RowId").toString()));
Expand Down Expand Up @@ -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();
}
Expand Down
5 changes: 3 additions & 2 deletions genotyping/src/org/labkey/genotyping/IlluminaFastqParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -506,9 +507,9 @@ public void testHeaders() throws PipelineJobException, IOException
int i = 0;
int numOfPairs = pairs.length;
Set<Pair<Integer, Integer>> expectedOutputs = new HashSet<>();
Map<Integer, Integer> sampleIndexToIdMap = new HashMap<>();
Map<Integer, Integer> sampleIndexToIdMap = new IntHashMap<>();
sampleIndexToIdMap.put(0, 0);
Map<Integer, Integer> sampleIdToIndexMap = new HashMap<>();
Map<Integer, Integer> sampleIdToIndexMap = new IntHashMap<>();
sampleIdToIndexMap.put(0, 0);
List<File> oldHeaderFiles = new ArrayList<>();
List<File> newHeaderFiles = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<Integer, Integer> sampleIndexToIdMap = new HashMap<>();
Map<Integer, Integer> sampleIndexToIdMap = new IntHashMap<>();
/* Unique RowId for each sample mapped to the index is the number of the sample as ordered in SampleType CSV */
Map<Integer, Integer> sampleIdToIndexMap = new HashMap<>();
Map<Integer, Integer> sampleIdToIndexMap = new IntHashMap<>();
/* Name for each sample, mapped to the RowId of the sample */
Map<String, Integer> sampleNameToIdMap = new HashMap<>();
sampleIndexToIdMap.put(0, 0); //placeholder for control and unmapped reads
Expand Down
4 changes: 3 additions & 1 deletion genotyping/src/org/labkey/genotyping/Status.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
*/
package org.labkey.genotyping;

import org.labkey.api.collections.IntHashMap;

import java.util.HashMap;
import java.util.Map;

Expand All @@ -27,7 +29,7 @@ public enum Status
{
NotSubmitted(0), Submitted(1), Importing(2), Complete(3);

private static final Map<Integer, Status> _map = new HashMap<>();
private static final Map<Integer, Status> _map = new IntHashMap<>();

static
{
Expand Down