Coder Social home page Coder Social logo

Comments (4)

akramdi avatar akramdi commented on June 17, 2024 1

I actually forgot to check/fix duplicated cell names across samples before Conos integration...
For anyone with the same issue, here's how I fixed it (I used CheckDuplicateCellNames from Seurat):

## Check if we have duplicated cell names. If yes, fix it
if ( any(duplicated(unlist(lapply(objectList,colnames)))) ){
  objectList <- Seurat:::CheckDuplicateCellNames(objectList)
}

After running Conos integration, the conversion to Seurat works perfectly.

from seurat-wrappers.

akramdi avatar akramdi commented on June 17, 2024

Hi,

I have the same issue:

sobj <- as.Seurat(con)
Merging 10 samples
Adding pairwise alignments to 'conos.pairs' in miscellaneous data
Adding graph as 'SCT_mnn'
Error in intI(i, n = d[1], dn[[1]], give.dn = FALSE) : 
  invalid character indexing
In addition: Warning message:
In CheckDuplicateCellNames(object.list = objects) :
  Some cell names are duplicated across objects provided. Renaming to enforce unique cell names.

Were you finally able to convert from Conos to Seurat ?
Thanks,

from seurat-wrappers.

akramdi avatar akramdi commented on June 17, 2024

Well, I was able to spot the code that causes the error in as.Seurat function:

# Add graph
if (!is.null(x = x$graph)) {
graph <- paste(DefaultAssay(object = object), method, sep = '_')
message("Adding graph as '", graph, "'")
object[[graph]] <- as.Graph(x = get.adjacency(graph = x$graph)[colnames(x = object), colnames(x = object)])
}

Precisely in line 79:

object[[graph]] <- as.Graph(x = get.adjacency(graph = x$graph)[colnames(x = object), colnames(x = object)])
Error in intI(i, n = d[1], dn[[1]], give.dn = FALSE) :
invalid character indexing

Cell names retrieved bycolnames(object) do not match cell names present in the matrix returned by get.adjacency(graph = x$graph).

> colnames(object) %>% head()
[1] "AAACCCAAGGCGTCCT_1" "AAACCCACAACAGCCC_1" "AAACGAAAGCTTGTTG_1"
[4] "AAACGAACAGACACCC_1" "AAACGAAGTAACTTCG_1" "AAACGCTAGCGATGCA_1"

> head(get.adjacency(graph = con$graph))
6 x 20199 sparse Matrix of class "dgCMatrix"
   [[ suppressing 34 column names ‘ACCCTTGCAGCAGATG’, ‘AAACCCATCTAGACAC’, ‘CTGGTCTGTACACGCC’ ... ]]

I'm not sure at which level this can be efficiency fixed. Can one of the developers give some advice ?

Thanks,

from seurat-wrappers.

vtosevski avatar vtosevski commented on June 17, 2024

Hi Amira,

I had not followed it further back then. I will keep this in mind next time I come around to it, it would be a very simple fix. Thanks for checking it more carefully.

Vinko

from seurat-wrappers.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.