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
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -130,7 +132,8 @@ public ApiResponse execute(CacheAnalysesForm form, BindException errors)
return null;
}

Pair<List<Long>, List<Long>> ret = GenotypeAssaysManager.get().cacheAnalyses(getViewContext(), protocol, form.getAlleleNames());
String[] alleleNames = Arrays.stream(form.getAlleleNames()).map(StringEscapeUtils::unescapeHtml4).toArray(String[]::new);
Pair<List<Long>, List<Long>> ret = GenotypeAssaysManager.get().cacheAnalyses(getViewContext(), protocol, alleleNames);
resultProperties.put("runsCreated", ret.first);
resultProperties.put("runsDeleted", ret.second);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -123,13 +124,15 @@ public Pair<List<Long>, List<Long>> cacheAnalyses(final ViewContext ctx, final E
final Map<Integer, List<Map<String, Object>>> rowHash = new IntHashMap<>();
final Map<Integer, Set<Integer>> 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<ResultSet>()
{
@Override
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"));
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion mGAP/resources/views/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,6 @@
</div>
</form>
<div class="otherLoginMechanismsSection" hidden>
<div class="auth-header">Users from these institutions can use their existing logins (after registration):</div>
<div class="auth-header">Registered users from the following institutions can log in using their home institution's credentials below:</div>
<div class="otherLoginMechanismsContent"></div>
</div>
4 changes: 2 additions & 2 deletions mcc/src/client/RequestReview/components/RabReviewForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ export default function RabReviewForm(props: {requestId: string}) {
<TableRow>
<TableCell>
<FormControl>
<InputLabel id={"review-input-label"}>Enter review...</InputLabel>
<Select id={"review"} variant={"outlined"} name={"review"} aria-label="Review" label={"Review"} error={hasSubmitted && !recordData[0].review} onChange={handleChange} required={true} value={recordData[0].review ?? ''} fullWidth={true} displayEmpty={true}>
<InputLabel id={"review-input-label"}>Review</InputLabel>
<Select id={"review"} variant={"outlined"} name={"review"} aria-label="Review" label={"Review"} labelId={"review-input-label"} error={hasSubmitted && !recordData[0].review} onChange={handleChange} required={true} value={recordData[0].review ?? ''} fullWidth={true} displayEmpty={true}>
<MenuItem value={""}>Not Decided</MenuItem>
<MenuItem value={"I recommend this proposal"}>I recommend this proposal</MenuItem>
<MenuItem value={"I recommend this proposal with conditions"}>I recommend this proposal with conditions</MenuItem>
Expand Down
8 changes: 4 additions & 4 deletions mcc/src/org/labkey/mcc/MccManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ public enum RequestStatus
Fulfilled(8, "Fulfilled", MccRequestAdminPermission.class),
Withdrawn(9, "Withdrawn", MccRequestorPermission.class);

int sortOrder;
String label;
Class<? extends Permission> updatePermission;
Class<? extends Permission> insertPermission;
final int sortOrder;
final String label;
final Class<? extends Permission> updatePermission;
final Class<? extends Permission> insertPermission;

RequestStatus(int sortOrder, String label, Class<? extends Permission> editPermission)
{
Expand Down
6 changes: 3 additions & 3 deletions mcc/src/org/labkey/mcc/query/MccRequestCustomizer.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ 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);
}

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}"));
Expand Down Expand Up @@ -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)");
Expand Down
3 changes: 3 additions & 0 deletions primeseq/src/org/labkey/primeseq/pipeline/BismarkWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down