Skip to content

Commit 8189b68

Browse files
committed
Merge discvr19.1 r64455-64468
SVN r64469 |2019-09-10 12:52:09 +0000
1 parent 81c5425 commit 8189b68

File tree

2 files changed

+20
-11
lines changed

2 files changed

+20
-11
lines changed

SequenceAnalysis/resources/external/scRNAseq/Seurat3.rmd

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,7 @@ seuratObj <- ProcessSeurat1(seuratObj, variableGeneTable = paste0(outPrefix, '.v
7979

8080
```{r DimRedux}
8181
82-
seuratObj <- FindClustersAndDimRedux(seuratObj, dimsToUse = dimsToUse, minDimsToUse = minDimsToUse)
83-
saveRDS(seuratObj, file = saveFile)
82+
seuratObj <- FindClustersAndDimRedux(seuratObj, dimsToUse = dimsToUse, minDimsToUse = minDimsToUse, saveFile = saveFile)
8483
8584
Find_Markers(seuratObj, resolutionToUse = resolutionToUse, outFile = paste0(outPrefix, '.markers.txt'), saveFileMarkers = paste0(outPrefix, '.markers.rds'))
8685
@@ -90,12 +89,18 @@ Find_Markers(seuratObj, resolutionToUse = resolutionToUse, outFile = paste0(outP
9089

9190
```{r SingleR}
9291
93-
seuratObj <- RunSingleR(seuratObj = seuratObj, resultTableFile = paste0(outPrefix, '.singleR.txt'))
94-
saveRDS(seuratObj, file = saveFile)
92+
tryCatch({
93+
seuratObj <- RunSingleR(seuratObj = seuratObj, resultTableFile = paste0(outPrefix, '.singleR.txt'))
94+
saveRDS(seuratObj, file = saveFile)
95+
96+
DimPlot_SingleRClassLabs(seuratObj, plotIndividually = T)
9597
96-
DimPlot_SingleRClassLabs(seuratObj, plotIndividually = T)
98+
Tabulate_SingleRClassLabs(seuratObj, plotIndividually = T)
99+
}, error = function(e){
100+
print('There was an error in SingleR')
97101
98-
Tabulate_SingleRClassLabs(seuratObj, plotIndividually = T)
102+
saveRDS(e, file = 'error.rds')
103+
})
99104
100105
```
101106

@@ -108,11 +113,11 @@ PlotImmuneMarkers(seuratObj, reduction = 'tsne')
108113
PlotImmuneMarkers(seuratObj, reduction = 'umap')
109114
110115
if (length(unique(seuratObj$BarcodePrefix)) > 1) {
111-
print(DimPlot(seuratObj, reduction = 'pca', group.by = 'BarcodePrefix', label = T))
112-
print(DimPlot(seuratObj, reduction = 'tsne', group.by = 'BarcodePrefix', label = T))
113-
print(DimPlot(seuratObj, reduction = 'umap', group.by = 'BarcodePrefix', label = T))
116+
print(Seurat::DimPlot(seuratObj, reduction = 'pca', group.by = 'BarcodePrefix', label = T))
117+
print(Seurat::DimPlot(seuratObj, reduction = 'tsne', group.by = 'BarcodePrefix', label = T))
118+
print(Seurat::DimPlot(seuratObj, reduction = 'umap', group.by = 'BarcodePrefix', label = T))
114119
115-
t <- table(Cluster = Idents(seuratObj), Dataset = seuratObj$BarcodePrefix)
120+
t <- table(Cluster = Seurat::Idents(seuratObj), Dataset = seuratObj$BarcodePrefix)
116121
t <- round(t / colSums(t), 2)
117122
knitr::kable(t)
118123
}

SequenceAnalysis/src/org/labkey/sequenceanalysis/analysis/CellRangerSeuratHandler.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,13 +273,17 @@ public void processFilesRemote(List<SequenceOutputFile> inputFiles, JobContext c
273273

274274
writer.println("outPrefix <- '" + outPrefix + "'");
275275
writer.println("resolutionToUse <- 0.6");
276-
for (String v : new String[]{"dimsToUse", "minDimsToUse", "mergeMethod"}) {
276+
for (String v : new String[]{"dimsToUse", "minDimsToUse"}) {
277277
String val = StringUtils.trimToNull(ctx.getParams().optString(v));
278278
val = val == null ? "NULL" : val;
279279

280280
writer.println(v + " <- " + val);
281281
}
282282

283+
String mergeMethod = StringUtils.trimToNull(ctx.getParams().optString("mergeMethod"));
284+
mergeMethod = mergeMethod == null ? "NULL" : "'" + mergeMethod + "'";
285+
writer.println("mergeMethod <- " + mergeMethod);
286+
283287
boolean doCellFilter = ctx.getParams().optBoolean("doCellFilter", true);
284288
writer.println("doCellFilter <- " + String.valueOf(doCellFilter).toUpperCase());
285289

0 commit comments

Comments
 (0)