Skip to content

Unsure about the real need of this #411

@SamGG

Description

@SamGG

Hi Helena,
While adapting prepData() to convert my own object to sce and then using the CATALYST pipeline, I am usure about the need of this factor conversion

CATALYST/R/prepData.R

Lines 291 to 295 in 4ff7b02

cd <- DataFrame(lapply(md[k], function(u) {
v <- as.character(rep(u, md$n_cells))
factor(v, levels = levels(u))
}), row.names = NULL)

as md is reduced to the columns specified in md_cols and those columns previously converted to factor in

CATALYST/R/prepData.R

Lines 231 to 236 in 4ff7b02

# assure correctness of formats
k <- c(md_cols$id, md_cols$factors)
md <- md[, k, drop = FALSE] %>%
mutate_all(factor) %>%
rename("sample_id" = md_cols$id)

In the latter part, I am also unsure about the rename at L235.

Could you have a look when you have time and just drop me a line (without explanation) if you modify something or not.
Best wishes,
Samuel

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions