Skip to content

Error in momf.computeRef function #3

Description

@JGarnica22

Hi,

momf.computeRef function returns error due to lack of names in weight vector. This implementation should solve it.

momf.computeRef <- function(sc_counts, cell_type){

   U <- sapply(unique(cell_type), function(ct){
          y = sc_count[ ,cell_type %in% ct, drop = FALSE]
          weight = sum(y)/sum(sc_count)
          rowSums(y)/sum(y)*weight
      })
	U <- 1000000 * U
	colnames(U) <- unique(cell_type)
	rownames(U) <- rownames(sc_count)
	# return estimated mean for each cell type
	return(U)
}

P.D: I would also be straight forward to implement this function in parelel.

Thanks

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