Skip to content

Commit fa0c90a

Browse files
WT: Small bug fixes
1 parent 050a87b commit fa0c90a

2 files changed

Lines changed: 14 additions & 8 deletions

File tree

R/downstream_analysis.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ RunFMD_RNA <- function(gene_list, network = "global", log_flag = FALSE) {
202202
return("ERROR")
203203
}
204204
)
205-
if(gene_check_post_request == "ERROR") {
205+
if(length(gene_check_post_request) == 1 && gene_check_post_request == "ERROR") {
206206
gc()
207207
return(NULL)
208208
} else {
@@ -256,7 +256,7 @@ RunFMD_RNA <- function(gene_list, network = "global", log_flag = FALSE) {
256256
return("ERROR")
257257
}
258258
)
259-
if(fmd_submission_post_request == "ERROR") {
259+
if(length(fmd_submission_post_request) == 1 && gene_check_post_request == "ERROR") {
260260
gc()
261261
return(NULL)
262262
} else {

vignettes/SPEEDI.Rmd

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -251,23 +251,29 @@ knitr::include_graphics(paste0(SPEEDI_variables$RNA_output_dir, "Before_Batch_Co
251251

252252
Next, we will use SPEEDI's data-derived batch inference method to determine sample batches in our data:
253253

254-
```{r infer_batches_rna, fig.show='hide'}
254+
```{r infer_batches_rna, results='hide', fig.show='hide'}
255255
sc_obj <- InferBatches(sc_obj = sc_obj, log_flag = TRUE)
256-
length(unique(sc_obj$batch))
257256
```
258257

259-
Above, we see that SPEEDI found 6 batches for our 9 samples.
258+
In total, SPEEDI found 4 batches for our 9 samples:
259+
260+
```{r infer_batches_rna_results}
261+
length(unique(sc_obj$batch))
262+
```
260263

261264
## Step 6: Integrate Batches
262265

263266
After we have grouped our samples according to batch, we are ready to integrate by batch. We first normalize counts within each batch using `SCTransform()` and then use a selection of methods from `Seurat` (`SelectIntegrationFeatures()`, `PrepSCTIntegration()`, `FindIntegrationAnchors()`, and `IntegrateData()`) to integrate our data.
264267

265-
```{r integrate_batches_rna, fig.show='hide'}
268+
```{r integrate_batches_rna, results='hide', fig.show='hide'}
266269
sc_obj <- IntegrateByBatch_RNA(sc_obj = sc_obj, log_flag = TRUE)
267-
sc_obj
268270
```
269271

270-
Note that we will now use the `integrated` assay for visualization (as opposed to the `SCT` assay) unless only one batch was found above.
272+
Note that we will now use the `integrated` assay for visualization (as opposed to the `SCT` assay) unless only one batch was found above:
273+
274+
```{r integrate_batches_rna_results}
275+
sc_obj
276+
```
271277

272278
## Step 7: Final Processing
273279

0 commit comments

Comments
 (0)