@@ -1461,19 +1461,12 @@ IntegrateData <- function(
1461
1461
} else {
1462
1462
active.assay <- DefaultAssay(object = ref [[1 ]])
1463
1463
reference.integrated [[active.assay ]] <- NULL
1464
- # TODO: restore once check.matrix is in SeuratObject
1465
- # reference.integrated[[active.assay]] <- CreateAssayObject(
1466
- # data = GetAssayData(
1467
- # object = reference.integrated[[new.assay.name]],
1468
- # slot = 'data'
1469
- # ),
1470
- # check.matrix = FALSE
1471
- # )
1472
1464
reference.integrated [[active.assay ]] <- CreateAssayObject(
1473
1465
data = GetAssayData(
1474
1466
object = reference.integrated [[new.assay.name ]],
1475
1467
slot = ' data'
1476
- )
1468
+ ),
1469
+ check.matrix = FALSE
1477
1470
)
1478
1471
DefaultAssay(object = reference.integrated ) <- active.assay
1479
1472
reference.integrated [[new.assay.name ]] <- NULL
@@ -1496,13 +1489,9 @@ IntegrateData <- function(
1496
1489
)
1497
1490
1498
1491
# Construct final assay object
1499
- # TODO: restore once check.matrix is in SeuratObject
1500
- # integrated.assay <- CreateAssayObject(
1501
- # data = integrated.data,
1502
- # check.matrix = FALSE
1503
- # )
1504
1492
integrated.assay <- CreateAssayObject(
1505
- data = integrated.data
1493
+ data = integrated.data ,
1494
+ check.matrix = FALSE
1506
1495
)
1507
1496
if (normalization.method == " SCT" ) {
1508
1497
integrated.assay <- CreateSCTAssayObject(
@@ -1594,13 +1583,9 @@ IntegrateEmbeddings.IntegrationAnchorSet <- function(
1594
1583
embeddings <- t(x = Embeddings(object = reductions )[cell.names.map [Cells(x = object.list [[i ]])], dims.to.integrate ])
1595
1584
rownames(x = embeddings ) <- dims.names
1596
1585
fake.assay <- suppressWarnings(
1597
- # TODO: restore once check.matrix is in SeuratObject
1598
- # expr = CreateAssayObject(
1599
- # data = embeddings,
1600
- # check.matrix = FALSE
1601
- # )
1602
1586
expr = CreateAssayObject(
1603
- data = embeddings
1587
+ data = embeddings ,
1588
+ check.matrix = FALSE
1604
1589
)
1605
1590
)
1606
1591
object.list [[i ]][[' drtointegrate' ]] <- fake.assay
@@ -1636,18 +1621,11 @@ IntegrateEmbeddings.IntegrationAnchorSet <- function(
1636
1621
}
1637
1622
active.assay <- DefaultAssay(object = object.list [reference.datasets ][[1 ]])
1638
1623
reference.integrated [[active.assay ]] <- NULL
1639
- # TODO: restore once check.matrix is in SeuratObject
1640
- # reference.integrated[[active.assay]] <- CreateAssayObject(
1641
- # data = GetAssayData(
1642
- # object = reference.integrated[[new.reduction.name.safe]],
1643
- # slot = 'data',
1644
- # check.matrix = FALSE
1645
- # )
1646
- # )
1647
1624
reference.integrated [[active.assay ]] <- CreateAssayObject(
1648
1625
data = GetAssayData(
1649
1626
object = reference.integrated [[new.reduction.name.safe ]],
1650
- slot = ' data'
1627
+ slot = ' data' ,
1628
+ check.matrix = FALSE
1651
1629
)
1652
1630
)
1653
1631
DefaultAssay(object = reference.integrated ) <- active.assay
@@ -1734,13 +1712,9 @@ IntegrateEmbeddings.TransferAnchorSet <- function(
1734
1712
)[ , dims.to.integrate ])
1735
1713
rownames(x = embeddings ) <- dims.names
1736
1714
fake.assay <- suppressWarnings(
1737
- # TODO restore once check.matrix is in SeuratObject
1738
- # expr = CreateAssayObject(
1739
- # data = embeddings,
1740
- # check.matrix = FALSE
1741
- # )
1742
1715
expr = CreateAssayObject(
1743
- data = embeddings
1716
+ data = embeddings ,
1717
+ check.matrix = FALSE
1744
1718
)
1745
1719
)
1746
1720
object.list [[i ]][[' drtointegrate' ]] <- fake.assay
@@ -3014,9 +2988,9 @@ TransferData <- function(
3014
2988
stringsAsFactors = FALSE
3015
2989
)
3016
2990
if (prediction.assay || ! is.null(x = query )) {
3017
- # TODO: restore once check.matrix is in SeuratObject
3018
- # predictions <- CreateAssayObject( data = t(x = as.matrix(x = prediction.scores)), check.matrix = FALSE)
3019
- predictions <- CreateAssayObject( data = t( x = as.matrix( x = prediction.scores )) )
2991
+ predictions <- CreateAssayObject(
2992
+ data = t(x = as.matrix(x = prediction.scores )), check.matrix = FALSE
2993
+ )
3020
2994
Key(object = predictions ) <- paste0(" predictionscore" , rd.name , " _" )
3021
2995
}
3022
2996
if (is.null(x = query )) {
@@ -3040,13 +3014,9 @@ TransferData <- function(
3040
3014
new.data <- as.sparse(x = new.data )
3041
3015
}
3042
3016
if (slot == " counts" ) {
3043
- # TODO: restore once check.matrix is in SeuratObject
3044
- # new.assay <- CreateAssayObject(counts = new.data, check.matrix = FALSE)
3045
- new.assay <- CreateAssayObject(counts = new.data )
3017
+ new.assay <- CreateAssayObject(counts = new.data , check.matrix = FALSE )
3046
3018
} else if (slot == " data" ) {
3047
- # TODO: restore once check.matrix is in SeuratObject
3048
- # new.assay <- CreateAssayObject(data = new.data, check.matrix = FALSE)
3049
- new.assay <- CreateAssayObject(data = new.data )
3019
+ new.assay <- CreateAssayObject(data = new.data , check.matrix = FALSE )
3050
3020
}
3051
3021
Key(object = new.assay ) <- paste0(rd.name , " _" )
3052
3022
if (is.null(x = query )) {
@@ -4096,13 +4066,9 @@ PairwiseIntegrateReference <- function(
4096
4066
features.to.integrate <- features.to.integrate %|| % features
4097
4067
if (length(x = reference.objects ) == 1 ) {
4098
4068
ref.obj <- object.list [[reference.objects ]]
4099
- # TODO: restore once check.matrix is in SeuratObject
4100
- # ref.obj[[new.assay.name]] <- CreateAssayObject(
4101
- # data = GetAssayData(ref.obj, slot = 'data')[features.to.integrate, ],
4102
- # check.matrix = FALSE
4103
- # )
4104
4069
ref.obj [[new.assay.name ]] <- CreateAssayObject(
4105
- data = GetAssayData(ref.obj , slot = ' data' )[features.to.integrate , ]
4070
+ data = GetAssayData(ref.obj , slot = ' data' )[features.to.integrate , ],
4071
+ check.matrix = FALSE
4106
4072
)
4107
4073
DefaultAssay(object = ref.obj ) <- new.assay.name
4108
4074
return (ref.obj )
@@ -4225,9 +4191,7 @@ PairwiseIntegrateReference <- function(
4225
4191
verbose = verbose
4226
4192
)
4227
4193
integrated.matrix <- cbind(integrated.matrix , GetAssayData(object = object.1 , slot = ' data' )[features.to.integrate , ])
4228
- # TODO: restore once check.matrix is in SeuratObject
4229
- # merged.obj[[new.assay.name]] <- CreateAssayObject(data = integrated.matrix, check.matrix = FALSE)
4230
- merged.obj [[new.assay.name ]] <- CreateAssayObject(data = integrated.matrix )
4194
+ merged.obj [[new.assay.name ]] <- CreateAssayObject(data = integrated.matrix , check.matrix = FALSE )
4231
4195
DefaultAssay(object = merged.obj ) <- new.assay.name
4232
4196
object.list [[as.character(x = ii )]] <- merged.obj
4233
4197
object.list [[merge.pair [[1 ]]]] <- NULL
0 commit comments