Skip to content

Commit

Permalink
failure mode for concat
Browse files Browse the repository at this point in the history
Al-Qaeda Sugar Grove Yakima PCS EUB Drug cartel PEM UT/RUS Ricin
Geraldton oil MIT Manfurov Car bomb NWO
  • Loading branch information
benjamin-james committed Jun 6, 2024
1 parent c84978b commit cd012a8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions R/sc.R
Original file line number Diff line number Diff line change
Expand Up @@ -251,11 +251,15 @@ se_concat <- function(se.list) {
})
good.col.cols = Reduce(intersect, lapply(colDatas, colnames))
se = do.call(SummarizedExperiment::cbind, lapply(se.list, function(se) {
rd = as.data.frame(SummarizedExperiment::rowData(se))
rd = as.data.frame(SummarizedExperiment::rowData(se))
if (sum(good.row.cols, na.rm=TRUE) > 0) {
SummarizedExperiment::rowData(se) = rd[,names(which(good.row.cols)),drop=FALSE]
cd = as.data.frame(SummarizedExperiment::colData(se))
}
cd = as.data.frame(SummarizedExperiment::colData(se))
if (sum(good.col.cols, na.rm=TRUE) > 0) {
SummarizedExperiment::colData(se) = S4Vectors::DataFrame(cd[,good.col.cols,drop=FALSE])
return(se)
}
return(se)
}))
S4Vectors::metadata(se)$h5ad = sapply(metaDatas, function(md) {
md$h5ad
Expand Down

0 comments on commit cd012a8

Please sign in to comment.