Skip to content

Commit c31f9a7

Browse files
committed
Allow jobs to control more EmptyDrop options
1 parent d5a13ca commit c31f9a7

File tree

3 files changed

+42
-3
lines changed

3 files changed

+42
-3
lines changed

singlecell/resources/chunks/PrepareRawCounts.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ for (datasetId in names(seuratObjects)) {
22
rawCountDir <- seuratObjects[[datasetId]]
33

44
datasetName <- datasetIdToName[[datasetId]]
5-
seuratObj <- CellMembrane::ReadAndFilter10xData(dataDir = rawCountDir, datasetId = datasetId, datasetName = datasetName)
5+
seuratObj <- CellMembrane::ReadAndFilter10xData(dataDir = rawCountDir, datasetId = datasetId, datasetName = datasetName, emptyDropsLower = emptyDropsLower, emptyDropsFdrThreshold = emptyDropsFdrThreshold)
66

77
saveData(seuratObj, datasetId)
88

singlecell/resources/web/singlecell/panel/SingleCellProcessingPanel.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Ext4.define('SingleCell.panel.SingleCellProcessingPanel', {
66
jobType: 'singleCell',
77

88
initComponent: function(){
9+
this.showPrepareRawData = this.handlerClass === 'ProcessSingleCellHandler';
10+
911
Ext4.apply(this, {
1012
itemId: 'sequenceAnalysisPanel',
1113
buttonAlign: 'left',
@@ -198,6 +200,28 @@ Ext4.define('SingleCell.panel.SingleCellProcessingPanel', {
198200
},
199201

200202
onDataLoad: function(results){
203+
results.prepareRawData = [{
204+
description: 'Options related to processing the 10x matrix into a seurat object',
205+
label: 'Prepare Raw Counts',
206+
name: 'PrepareRawCounts',
207+
parameters: [{
208+
fieldXtype: 'ldk-integerfield',
209+
name: 'emptyDropsLower',
210+
label: 'EmptyDrops Lower',
211+
description: 'Passed to DropletUtils::emptyDrops lower argument',
212+
defaultValue: 200,
213+
minValue: 0
214+
},{
215+
fieldXtype: 'ldk-numberfield',
216+
name: 'emptyDropsFdrThreshold',
217+
label: 'EmptyDrops FDR Threshold',
218+
description: 'The FDR limit used to filter the results of DropletUtils::emptyDrops',
219+
defaultValue: 0.001,
220+
minValue: 0,
221+
decimalPrecision: 4
222+
}]
223+
}];
224+
201225
this.add([this.getFilePanelCfg(), this.getProtocolPanelCfg(),{
202226
xtype: 'panel',
203227
title: 'Analysis Options',
@@ -212,6 +236,17 @@ Ext4.define('SingleCell.panel.SingleCellProcessingPanel', {
212236
var panel = this.down('#analysisOptions');
213237

214238
var items = [];
239+
if (this.showPrepareRawData){
240+
items.push({
241+
xtype: 'sequenceanalysis-analysissectionpanel',
242+
title: 'Prepare Raw Data',
243+
stepType: 'prepareRawData',
244+
singleTool: true,
245+
sectionDescription: 'This section allows you to control the parsing of the raw 10x count data',
246+
toolConfig: results
247+
});
248+
}
249+
215250
items.push({
216251
xtype: 'sequenceanalysis-analysissectionpanel',
217252
title: 'Seurat Processing',

singlecell/src/org/labkey/singlecell/pipeline/singlecell/PrepareRawCounts.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
package org.labkey.singlecell.pipeline.singlecell;
22

3+
import org.labkey.api.pipeline.PipelineJobException;
34
import org.labkey.api.sequenceanalysis.pipeline.AbstractPipelineStepProvider;
45
import org.labkey.api.sequenceanalysis.pipeline.PipelineContext;
6+
import org.labkey.api.sequenceanalysis.pipeline.SequenceOutputHandler;
7+
import org.labkey.api.singlecell.pipeline.SeuratToolParameter;
58
import org.labkey.api.singlecell.pipeline.SingleCellStep;
69

710
import java.util.Arrays;
11+
import java.util.List;
812

913
public class PrepareRawCounts extends AbstractCellMembraneStep
1014
{
@@ -20,11 +24,11 @@ public static class Provider extends AbstractPipelineStepProvider<SingleCellStep
2024
public Provider()
2125
{
2226
super("PrepareRawCounts", LABEL, "CellMembrane/Seurat", "This step reads the raw count matrix/matrices, and runs EmptyDrops to provide an unfiltered count matrix.", Arrays.asList(
23-
27+
SeuratToolParameter.create("emptyDropsLower", "Lower", "Passed to DropletUtils::emptyDrops lower argument", "ldk-integerfield", null, 200),
28+
SeuratToolParameter.create("emptyDropsFdrThreshold", "FDR Threshold", "The FDR limit used to filter the results of DropletUtils::emptyDrops", "ldk-numberfield", null, 0.001)
2429
), null, null);
2530
}
2631

27-
2832
@Override
2933
public PrepareRawCounts create(PipelineContext ctx)
3034
{

0 commit comments

Comments
 (0)