-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support Rdiscvr SummarizeTCellActivation
- Loading branch information
Showing
3 changed files
with
79 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
if (!file.exists('/homeDir/.netrc')) { | ||
print(list.files('/homeDir')) | ||
stop('Unable to find file: /homeDir/.netrc') | ||
} | ||
|
||
invisible(Rlabkey::labkey.setCurlOptions(NETRC_FILE = '/homeDir/.netrc')) | ||
Rdiscvr::SetLabKeyDefaults(baseUrl = serverBaseUrl, defaultFolder = defaultLabKeyFolder) | ||
|
||
for (datasetId in names(seuratObjects)) { | ||
printName(datasetId) | ||
seuratObj <- readSeuratRDS(seuratObjects[[datasetId]]) | ||
|
||
outFile <- paste0(outputPrefix, '.', makeLegalFileName(datasetId), '.activation.txt') | ||
seuratObj <- Rdiscvr::SummarizeTNK_Activation(seuratObj, outFile = outFile, xFacetField = xFacetField, groupingFields = groupingFields, activationFieldName = activationFieldName, threshold = threshold) | ||
|
||
saveData(seuratObj, datasetId) | ||
|
||
# Cleanup | ||
rm(seuratObj) | ||
gc() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
singlecell/src/org/labkey/singlecell/pipeline/singlecell/SummarizeTCellActivation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package org.labkey.singlecell.pipeline.singlecell; | ||
|
||
import org.json.JSONObject; | ||
import org.labkey.api.sequenceanalysis.pipeline.AbstractPipelineStepProvider; | ||
import org.labkey.api.sequenceanalysis.pipeline.PipelineContext; | ||
import org.labkey.api.singlecell.pipeline.SeuratToolParameter; | ||
import org.labkey.api.singlecell.pipeline.SingleCellStep; | ||
|
||
import java.util.Arrays; | ||
|
||
public class SummarizeTCellActivation extends AbstractRDiscvrStep | ||
{ | ||
public SummarizeTCellActivation(PipelineContext ctx, SummarizeTCellActivation.Provider provider) | ||
{ | ||
super(provider, ctx); | ||
} | ||
|
||
public static class Provider extends AbstractPipelineStepProvider<SingleCellStep> | ||
{ | ||
public Provider() | ||
{ | ||
super("SummarizeTCellActivation", "Summarize TCell Activation", "RDiscvr", "This uses Rdiscvr::SummarizeTCellActivation to summarize cells with activation above a threshold.", Arrays.asList( | ||
SeuratToolParameter.create("groupingFields", "Grouping Field(s)", "The fields used to group cells.", "sequenceanalysis-trimmingtextarea", new JSONObject(){{ | ||
put("allowBlank", false); | ||
put("height", 200); | ||
put("delimiter", ","); | ||
put("stripCharsRe", "/['\"]/g"); | ||
}}, "SampleDate,Stim,Population,AssayType").delimiter(","), | ||
SeuratToolParameter.create("threshold", "Threshold", "Cells with a score greater than or equal to this are considered activated", "ldk-numberfield", new JSONObject(){{ | ||
put("allowBlank", false); | ||
put("minValue", 0); | ||
put("maxValue", 1); | ||
put("decimalPrecision", 2); | ||
}}, 0.5), | ||
SeuratToolParameter.create("xFacetField", "X Facet Field", "A field used to facet the resulting plot", "textfield", new JSONObject(){{ | ||
put("allowBlank", false); | ||
}}, "Population"), | ||
SeuratToolParameter.create("activationFieldName", "Activation Field Name", "The name of the field holding the score used to activation thresholding", "textfield", new JSONObject(){{ | ||
put("allowBlank", false); | ||
}}, "TandNK_Activation_UCell") | ||
), null, null); | ||
} | ||
|
||
@Override | ||
public SummarizeTCellActivation create(PipelineContext ctx) | ||
{ | ||
return new SummarizeTCellActivation(ctx, this); | ||
} | ||
} | ||
|
||
@Override | ||
public String getFileSuffix() | ||
{ | ||
return "activation"; | ||
} | ||
} | ||
|