Skip to content

Commit 4fea6c6

Browse files
committed
Merge discvr-23.11 to discvr-24.3
2 parents 25c0ecd + b22a685 commit 4fea6c6

File tree

3 files changed

+33
-15
lines changed

3 files changed

+33
-15
lines changed

SequenceAnalysis/src/org/labkey/sequenceanalysis/query/DownloadSequenceDisplayColumnFactory.java

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,16 @@
66
import org.labkey.api.data.DisplayColumn;
77
import org.labkey.api.data.DisplayColumnFactory;
88
import org.labkey.api.data.RenderContext;
9-
import org.labkey.api.data.Sort;
10-
import org.labkey.api.data.UrlColumn;
119
import org.labkey.api.query.FieldKey;
1210
import org.labkey.api.util.PageFlowUtil;
13-
import org.labkey.api.util.StringExpression;
14-
import org.labkey.api.util.StringExpressionFactory;
15-
import org.labkey.api.util.URLHelper;
11+
import org.labkey.api.view.HttpView;
1612
import org.labkey.api.view.template.ClientDependency;
1713

1814
import java.io.IOException;
1915
import java.io.Writer;
20-
import java.util.Arrays;
2116
import java.util.Collections;
2217
import java.util.LinkedHashSet;
18+
import java.util.Map;
2319
import java.util.Set;
2420

2521
/**
@@ -39,11 +35,21 @@ public DisplayColumn createRenderer(ColumnInfo colInfo)
3935
{
4036
DataColumn ret = new DataColumn(colInfo)
4137
{
38+
private boolean _handlerRegistered = false;
39+
4240
@Override
4341
public void renderGridCellContents(RenderContext ctx, Writer out) throws IOException
4442
{
4543
Object val = ctx.get(FieldKey.fromString(getBoundColumn().getFieldKey().getParent(), "rowId"));
46-
out.write(PageFlowUtil.link("Download Sequence").onClick("SequenceAnalysis.window.DownloadSequencesWindow.downloadSingle(" + val + ")").toString());
44+
out.write(PageFlowUtil.link("Download Sequence").attributes(Map.of(
45+
"data-rowid", val.toString()
46+
)).addClass("sdc-row").toString());
47+
48+
if (!_handlerRegistered)
49+
{
50+
HttpView.currentPageConfig().addHandlerForQuerySelector("a.sdc-row", "click", "SequenceAnalysis.window.DownloadSequencesWindow.downloadSingle(this.attributes.getNamedItem('data-rowid').value); return false;");
51+
_handlerRegistered = true;
52+
}
4753
}
4854

4955
@Override

SequenceAnalysis/src/org/labkey/sequenceanalysis/query/SequenceAnalysisCustomizer.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import org.labkey.api.security.User;
2929
import org.labkey.api.util.PageFlowUtil;
3030
import org.labkey.api.view.ActionURL;
31+
import org.labkey.api.view.HttpView;
3132
import org.labkey.api.view.template.ClientDependency;
3233
import org.labkey.sequenceanalysis.SequenceAnalysisSchema;
3334

@@ -232,6 +233,8 @@ public DisplayColumn createRenderer(ColumnInfo colInfo)
232233
{
233234
return new DataColumn(colInfo)
234235
{
236+
private boolean _handlerRegistered = false;
237+
235238
@Override
236239
public @NotNull Set<ClientDependency> getClientDependencies()
237240
{
@@ -275,8 +278,13 @@ public void renderGridCellContents(RenderContext ctx, Writer out) throws IOExcep
275278
}
276279
}
277280

278-
String onclick = "onclick=\"SequenceAnalysis.window.ManageFileSetsWindow.buttonHandlerForOutputFiles(" + PageFlowUtil.jsString(rowId.toString()) + ", " + PageFlowUtil.jsString(ctx.getCurrentRegion().getName()) + ");\"";
279-
out.write("<a class=\"fa fa-pencil lk-dr-action-icon\" data-tt=\"tooltip\" data-original-title=\"add/edit\" " + onclick + "></a>");
281+
out.write("<a class=\"fa fa-pencil lk-dr-action-icon sfs-row\" data-tt=\"tooltip\" data-rowid=\"" + rowId +"\" data-original-title=\"add/edit\"></a>");
282+
283+
if (!_handlerRegistered)
284+
{
285+
HttpView.currentPageConfig().addHandlerForQuerySelector("a.sfs-row", "click", "SequenceAnalysis.window.ManageFileSetsWindow.buttonHandlerForOutputFiles(this.attributes.getNamedItem('data-rowid').value, " + PageFlowUtil.jsString(ctx.getCurrentRegion().getName()) + "); return false;");
286+
_handlerRegistered = true;
287+
}
280288
}
281289
}
282290
};

singlecell/resources/chunks/Functions.R

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,17 +173,21 @@ readSeuratRDS <- function(filePath) {
173173
return(seuratObj)
174174
}
175175

176-
print('Updating future.globals.maxSize')
177-
options(future.globals.maxSize = Inf)
178-
179-
options('Seurat.memsafe' = TRUE, future.globals.onReference = "warning")
176+
options(future.globals.maxSize = Inf, future.globals.onReference = "warning")
177+
options('Seurat.memsafe' = TRUE)
180178

181179
if (Sys.getenv('SEURAT_MAX_THREADS') != '') {
182-
print(paste0('Setting future::plan workers to: ', Sys.getenv('SEURAT_MAX_THREADS')))
180+
logger::log_info(paste0('Setting future::plan workers to: ', Sys.getenv('SEURAT_MAX_THREADS')))
183181
mt <- as.integer(Sys.getenv('SEURAT_MAX_THREADS'))
184182
if (is.na(mt)) {
185183
stop(paste0('SEURAT_MAX_THREAD is not an integer: ', mt <- Sys.getenv('SEURAT_MAX_THREADS')))
186184
}
187185

188-
future::plan(strategy='multisession', workers=mt)
186+
fs <- ifelse(exists('futureStrategy'), yes = get('futureStrategy'), no = 'multicore')
187+
if (mt == 1) {
188+
fs <- 'sequential'
189+
}
190+
logger::log_info(paste0('Setting future::strategy to: ', fs))
191+
192+
future::plan(strategy = fs, workers = mt)
189193
}

0 commit comments

Comments
 (0)