Skip to content

Commit 5aaa9d0

Browse files
committed
Allow most ADT processing steps to specify the assay name
1 parent c982cf8 commit 5aaa9d0

File tree

9 files changed

+29
-13
lines changed

9 files changed

+29
-13
lines changed

singlecell/resources/chunks/CiteSeqDimReduxDist.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ for (datasetId in names(seuratObjects)) {
22
printName(datasetId)
33
seuratObj <- readRDS(seuratObjects[[datasetId]])
44

5-
if (!('ADT' %in% names(seuratObj@assays))) {
6-
print('ADT assay not present, skipping')
5+
if (!(assayName %in% names(seuratObj@assays))) {
6+
print(paste0(assayName, ' assay not present, skipping'))
77
} else {
88
tryCatch({
99
seuratObj <- bindArgs(CellMembrane::CiteSeqDimRedux.Dist, seuratObj)()

singlecell/resources/chunks/CiteSeqDimReduxPca.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ for (datasetId in names(seuratObjects)) {
22
printName(datasetId)
33
seuratObj <- readRDS(seuratObjects[[datasetId]])
44

5-
if (!('ADT' %in% names(seuratObj@assays))) {
6-
print('ADT assay not present, skipping')
5+
if (!(assayName %in% names(seuratObj@assays))) {
6+
print(paste0(assayName, ' assay not present, skipping'))
77
} else {
88
seuratObj <- bindArgs(CellMembrane::CiteSeqDimRedux.PCA, seuratObj)()
99
}

singlecell/resources/chunks/CiteSeqPlots.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ for (datasetId in names(seuratObjects)) {
22
printName(datasetId)
33
seuratObj <- readRDS(seuratObjects[[datasetId]])
44

5-
assayName <- 'ADT'
65
if (!(assayName %in% names(seuratObj@assays))) {
76
print(paste0('Assay: ', assayName, ' not present, skipping'))
87
} else {

singlecell/resources/chunks/CiteSeqWnn.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ for (datasetId in names(seuratObjects)) {
33
seuratObj <- readRDS(seuratObjects[[datasetId]])
44

55
tryCatch({
6-
if (!('ADT' %in% names(seuratObj@assays))) {
7-
print('ADT assay not present, skipping')
6+
if (!(assayName %in% names(seuratObj@assays))) {
7+
print(paste0(assayName, ' assay not present, skipping'))
88
} else {
99
seuratObj <- bindArgs(CellMembrane::RunSeuratWnn, seuratObj)()
1010
}

singlecell/resources/chunks/PlotAverageCiteSeqCounts.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ for (datasetId in names(seuratObjects)) {
66
print('ADT assay not present, skipping')
77
} else {
88
tryCatch({
9-
CellMembrane::PlotAverageAdtCounts(seuratObj, groupFields = fieldNames)
9+
CellMembrane::PlotAverageAdtCounts(seuratObj, groupFields = fieldNames, assayName = assayName)
1010
}, error = function(e){
1111
print(paste0('Error running PlotAverageCiteSeqCounts for: ', datasetId))
1212
print(conditionMessage(e))

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ public Provider()
2222
super("CiteSeqDimReduxDist", "CiteSeq DimRedux (distance)", "CellMembrane/Seurat", "This will run DimRedux steps on the ADT data, based on euclidian distance.", Arrays.asList(
2323
SeuratToolParameter.create("performClrNormalization", "Perform CLR Normalization", "If true, Seurat CLR normalization will be performed. Otherwise any pre-existing normalization is used.", "checkbox", new JSONObject(){{
2424
put("checked", true);
25-
}}, true, "performClrNormalization", true)
25+
}}, true, "performClrNormalization", true),
26+
SeuratToolParameter.create("assayName", "Assay Name", "The assay to use", "textbox", new JSONObject(){{
27+
28+
}}, "ADT")
2629
), null, null);
2730
}
2831

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,11 @@ public Provider()
3030
SeuratToolParameter.create("adtBlacklist", "ADT Blacklist", "If provided, these ADTs will be excluded from scaling/PCA", "sequenceanalysis-trimmingtextarea", new JSONObject(){{
3131
put("height", 150);
3232
put("delimiter", ",");
33-
}}, null).delimiter(",")
34-
), null, null);
33+
}}, null).delimiter(","),
34+
SeuratToolParameter.create("assayName", "Assay Name", "The assay to use", "textbox", new JSONObject(){{
35+
36+
}}, "ADT")
37+
), null, null);
3538
}
3639

3740
@Override

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
package org.labkey.singlecell.pipeline.singlecell;
22

3+
import org.json.JSONObject;
34
import org.labkey.api.sequenceanalysis.pipeline.AbstractPipelineStepProvider;
45
import org.labkey.api.sequenceanalysis.pipeline.PipelineContext;
6+
import org.labkey.api.singlecell.pipeline.SeuratToolParameter;
57
import org.labkey.api.singlecell.pipeline.SingleCellStep;
68

9+
import java.util.Arrays;
10+
711
public class CiteSeqPlots extends AbstractCellMembraneStep
812
{
913
public CiteSeqPlots(PipelineContext ctx, CiteSeqPlots.Provider provider)
@@ -15,7 +19,11 @@ public static class Provider extends AbstractPipelineStepProvider<SingleCellStep
1519
{
1620
public Provider()
1721
{
18-
super("CiteSeqPlots", "CiteSeq/ADT Plots", "CellMembrane/Seurat", "This will create FeaturePlots for all features in the ADT assay.", null, null, null);
22+
super("CiteSeqPlots", "CiteSeq/ADT Plots", "CellMembrane/Seurat", "This will create FeaturePlots for all features in the ADT assay.", Arrays.asList(
23+
SeuratToolParameter.create("assayName", "Assay Name", "The assay to use", "textbox", new JSONObject(){{
24+
25+
}}, "ADT")
26+
), null, null);
1927
}
2028

2129
@Override

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ public Provider()
2626
put("allowBlank", false);
2727
put("height", 150);
2828
put("delimiter", ",");
29-
}}, "ClusterNames_0.2,ClusterNames_0.4,ClusterNames_0.6").delimiter(",")
29+
}}, "ClusterNames_0.2,ClusterNames_0.4,ClusterNames_0.6").delimiter(","),
30+
SeuratToolParameter.create("assayName", "Assay Name", "The assay to use", "textbox", new JSONObject(){{
31+
32+
}}, "ADT")
3033
), Arrays.asList("/sequenceanalysis/field/TrimmingTextArea.js"), null);
3134
}
3235

0 commit comments

Comments
 (0)