diff --git a/GenotypeAssays/src/org/labkey/genotypeassays/GenotypeAssaysController.java b/GenotypeAssays/src/org/labkey/genotypeassays/GenotypeAssaysController.java index 761c97a8..c025e29f 100644 --- a/GenotypeAssays/src/org/labkey/genotypeassays/GenotypeAssaysController.java +++ b/GenotypeAssays/src/org/labkey/genotypeassays/GenotypeAssaysController.java @@ -16,6 +16,7 @@ package org.labkey.genotypeassays; +import org.apache.commons.text.StringEscapeUtils; import org.json.JSONArray; import org.labkey.api.action.ApiResponse; import org.labkey.api.action.ApiSimpleResponse; @@ -37,6 +38,7 @@ import org.springframework.validation.Errors; import org.springframework.web.servlet.ModelAndView; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -130,7 +132,8 @@ public ApiResponse execute(CacheAnalysesForm form, BindException errors) return null; } - Pair, List> ret = GenotypeAssaysManager.get().cacheAnalyses(getViewContext(), protocol, form.getAlleleNames()); + String[] alleleNames = Arrays.stream(form.getAlleleNames()).map(StringEscapeUtils::unescapeHtml4).toArray(String[]::new); + Pair, List> ret = GenotypeAssaysManager.get().cacheAnalyses(getViewContext(), protocol, alleleNames); resultProperties.put("runsCreated", ret.first); resultProperties.put("runsDeleted", ret.second); } diff --git a/GenotypeAssays/src/org/labkey/genotypeassays/GenotypeAssaysManager.java b/GenotypeAssays/src/org/labkey/genotypeassays/GenotypeAssaysManager.java index 68267c26..faa9ff51 100644 --- a/GenotypeAssays/src/org/labkey/genotypeassays/GenotypeAssaysManager.java +++ b/GenotypeAssays/src/org/labkey/genotypeassays/GenotypeAssaysManager.java @@ -62,6 +62,7 @@ import java.util.List; import java.util.Map; import java.util.Set; +import java.util.concurrent.atomic.AtomicInteger; public class GenotypeAssaysManager { @@ -123,6 +124,7 @@ public Pair, List> cacheAnalyses(final ViewContext ctx, final E final Map>> rowHash = new IntHashMap<>(); final Map> toDeleteByAnalysis = new IntHashMap<>(); + AtomicInteger records = new AtomicInteger(); TableSelector tsAlignments = new TableSelector(tableAlignments, cols.values(), new SimpleFilter(FieldKey.fromString("key"), Arrays.asList(pks), CompareType.IN), null); tsAlignments.forEach(new Selector.ForEachBlock() { @@ -130,6 +132,7 @@ public Pair, List> cacheAnalyses(final ViewContext ctx, final E public void exec(ResultSet object) throws SQLException { Results rs = new ResultsImpl(object, cols); + records.getAndIncrement(); int analysisId = rs.getInt(FieldKey.fromString("analysis_id")); String lineages = rs.getString(FieldKey.fromString("lineages")); @@ -169,6 +172,11 @@ public void exec(ResultSet object) throws SQLException } }); + if (records.get() != pks.length) + { + throw new IllegalStateException("The number of records found did not match the number supplied. This indicates a problem with the import."); + } + if (!rowHash.isEmpty()) { processSet(SBT_LINEAGE_ASSAY_TYPE, rowHash, assayDataTable, u, ctx, toDeleteByAnalysis, ap, protocol, runsCreated); diff --git a/mGAP/resources/views/login.html b/mGAP/resources/views/login.html index ead854e2..a087ae9c 100644 --- a/mGAP/resources/views/login.html +++ b/mGAP/resources/views/login.html @@ -66,6 +66,6 @@ \ No newline at end of file diff --git a/mcc/src/client/RequestReview/components/RabReviewForm.tsx b/mcc/src/client/RequestReview/components/RabReviewForm.tsx index 4b849a01..8874b55d 100644 --- a/mcc/src/client/RequestReview/components/RabReviewForm.tsx +++ b/mcc/src/client/RequestReview/components/RabReviewForm.tsx @@ -124,8 +124,8 @@ export default function RabReviewForm(props: {requestId: string}) { - Enter review... - Not Decided I recommend this proposal I recommend this proposal with conditions diff --git a/mcc/src/org/labkey/mcc/MccManager.java b/mcc/src/org/labkey/mcc/MccManager.java index 0fe8763b..6a554238 100644 --- a/mcc/src/org/labkey/mcc/MccManager.java +++ b/mcc/src/org/labkey/mcc/MccManager.java @@ -56,10 +56,10 @@ public enum RequestStatus Fulfilled(8, "Fulfilled", MccRequestAdminPermission.class), Withdrawn(9, "Withdrawn", MccRequestorPermission.class); - int sortOrder; - String label; - Class updatePermission; - Class insertPermission; + final int sortOrder; + final String label; + final Class updatePermission; + final Class insertPermission; RequestStatus(int sortOrder, String label, Class editPermission) { diff --git a/mcc/src/org/labkey/mcc/query/MccRequestCustomizer.java b/mcc/src/org/labkey/mcc/query/MccRequestCustomizer.java index b3c023a3..559e9229 100644 --- a/mcc/src/org/labkey/mcc/query/MccRequestCustomizer.java +++ b/mcc/src/org/labkey/mcc/query/MccRequestCustomizer.java @@ -58,7 +58,7 @@ public boolean isSortable() ti.addColumn(newCol); - SQLFragment sql2 = new SQLFragment("(SELECT COALESCE(sum(CASE WHEN r.review IS NULL THEN 1 ELSE 0 END), -1) as expr FROM mcc.requestReviews r WHERE r.requestId = " + ExprColumn.STR_TABLE_ALIAS + ".requestId)"); + SQLFragment sql2 = new SQLFragment("(SELECT COALESCE(sum(CASE WHEN r.review IS NULL THEN 1 ELSE 0 END), -1) as expr FROM mcc.requestReviews r WHERE CAST(r.requestId AS VARCHAR(36)) = CAST(" + ExprColumn.STR_TABLE_ALIAS + ".requestId AS VARCHAR(36)))"); ExprColumn newCol2 = new ExprColumn(ti, "pendingRabReviews", sql2, JdbcType.INTEGER, ti.getColumn("requestId")); newCol2.setLabel("Pending RAB Reviews"); ti.addColumn(newCol2); @@ -66,7 +66,7 @@ public boolean isSortable() if (ti.getColumn("numAnimalsRequested") == null) { - SQLFragment sql = new SQLFragment("(SELECT SUM(rc.numberofanimals) as expr FROM mcc." + MccSchema.TABLE_REQUEST_COHORTS + " rc WHERE rc.requestId = " + ExprColumn.STR_TABLE_ALIAS + ".requestId)"); + SQLFragment sql = new SQLFragment("(SELECT SUM(rc.numberofanimals) as expr FROM mcc." + MccSchema.TABLE_REQUEST_COHORTS + " rc WHERE CAST(rc.requestId AS VARCHAR(36)) = CAST(" + ExprColumn.STR_TABLE_ALIAS + ".requestId AS VARCHAR(36)))"); ExprColumn newCol = new ExprColumn(ti, "numAnimalsRequested", sql, JdbcType.INTEGER, ti.getColumn("requestId")); newCol.setLabel("# Animals Requested"); newCol.setURL(DetailsURL.fromString("/query/executeQuery.view?schemaName=mcc&query.queryName=" + MccSchema.TABLE_REQUEST_COHORTS + "&query.requestId~eq=${requestId}")); @@ -98,7 +98,7 @@ public boolean isSortable() append(" as expr FROM "). append(" mcc." + MccSchema.TABLE_ANIMAL_REQUESTS + " ar JOIN studydataset.").append(dti.getName()). append(" d ON (d.mccRequestId = ar.rowId)"). - append(" WHERE ar.objectid = " + ExprColumn.STR_TABLE_ALIAS + ".requestId)"); + append(" WHERE CAST(ar.objectid AS VARCHAR(36)) = CAST(" + ExprColumn.STR_TABLE_ALIAS + ".requestId AS VARCHAR(36)))"); ExprColumn newCol = new ExprColumn(ti, "transferIds", sql, JdbcType.VARCHAR, ti.getColumn("requestId")); newCol.setLabel("Animal ID(s)"); diff --git a/primeseq/src/org/labkey/primeseq/pipeline/BismarkWrapper.java b/primeseq/src/org/labkey/primeseq/pipeline/BismarkWrapper.java index 91f5a36e..1af365e1 100644 --- a/primeseq/src/org/labkey/primeseq/pipeline/BismarkWrapper.java +++ b/primeseq/src/org/labkey/primeseq/pipeline/BismarkWrapper.java @@ -297,6 +297,9 @@ public Provider() put("minValue", 0); put("maxValue", 1); }}, 1), + ToolParameterDescriptor.createCommandLineParam(CommandLineParam.create("--score_min"), "score_min", "Score Min", "Sets a function governing the minimum alignment score needed for an alignment to be considered \"valid\" (i.e. good enough to report). This is a function of read length. For instance, specifying L,0,-0.2 sets the minimum-score function f to f(x) = 0 + -0.2 * x, where x is the read length", "textfield", new JSONObject(){{ + + }}, null), ToolParameterDescriptor.createCommandLineParam(CommandLineParam.createSwitch("--local"), "local", "Local Alignment", "In this mode, it is not required that the entire read aligns from one end to the other. Rather, some characters may be omitted (“soft-clipped”) from the ends in order to achieve the greatest possible alignment score. For Bowtie 2, the match bonus --ma (default: 2) is used in this mode, and the best possible alignment score is equal to the match bonus (--ma) times the length of the read. This is mutually exclusive with end-to-end alignments.", "checkbox", new JSONObject(){{ }}, false),