Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

column subsetting deletes dimnames of the layer matrix #16

Closed
akhst7 opened this issue Mar 18, 2022 · 1 comment
Closed

column subsetting deletes dimnames of the layer matrix #16

akhst7 opened this issue Mar 18, 2022 · 1 comment

Comments

@akhst7
Copy link

akhst7 commented Mar 18, 2022

I did the column subsetting as follows and checked str() of layers ;

nt<-intersect(selected.genes, colnames(ann))
ann.mini<-ann[, int]
str(ann.mini)
str(ann.mini$layers)
List of 2
 $ spliced  :Formal class 'dgRMatrix' [package "Matrix"] with 6 slots
  .. ..@ p       : int [1:9083] 0 2487 2815 4760 5115 6431 9226 10608 12898 13826 ...
  .. ..@ j       : int [1:13011806] 11 19 20 34 43 44 47 50 71 78 ...
  .. ..@ Dim     : int [1:2] 9082 18775
  .. ..@ Dimnames:List of 2
  .. .. ..$ : NULL
  .. .. ..$ : NULL
  .. ..@ x       : num [1:13011806] 1 1 1 2 4 1 5 1 5 3 ...
  .. ..@ factors : list()
 $ unspliced:Formal class 'dgRMatrix' [package "Matrix"] with 6 slots
  .. ..@ p       : int [1:9083] 0 1508 1614 2739 3136 4047 5677 6279 7397 8016 ...
  .. ..@ j       : int [1:6962033] 2 9 15 20 24 27 33 34 46 50 ...
  .. ..@ Dim     : int [1:2] 9082 18775
  .. ..@ Dimnames:List of 2
  .. .. ..$ : NULL
  .. .. ..$ : NULL
  .. ..@ x       : num [1:6962033] 1 1 1 1 1 1 2 2 1 2 ...
  .. ..@ factors : list()

This is not a major problem since I can easily restore dimnames of the layers but is this a bug or normal behavior of the ann obj subsetting ?

@rcannood
Copy link
Member

Thanks @akhst7! The latest commit to the master branch should solve this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants