aerickso / SpatialInferCNV

Clone Calling from Visium Spatial Transcriptomics of Cancer samples
55 stars 13 forks source link

ImportCountData() unexpected behaviour #9

Open igbiga opened 1 year ago

igbiga commented 1 year ago

Hi, in the ImportCountData() function, if there's '-' in the sample name, it's being changed into '.' which make it incompatible with the barcode names made using ImportHistologicalAnnotations() and the same sample name.

I'd suggest swiping the order of lines 16 and 17, to prevent it. Such as: ImportCountData <- function(SectionName, InputCountFile) { input <- Read10X_h5(InputCountFile, use.names = FALSE) input <- as.matrix(input) input <- as.data.frame(t(input)) input <- rownames_tocolumn(input, "Barcode") input$Barcode <- gsub("\-", "\.", input$Barcode) input$Barcode <- paste0(SectionName, "", input$Barcode) return(input) }

it doesn't intefere with the rest of the code