Inconsistency with if statement check in DIALOGUE.cell.type.R
Closed this issue · 3 comments
Hi Livnat,
Some inconsistencies linked to what @tessadgreen has also noticed (in a closed post):
Code mentions:
https://github.com/livnatje/DIALOGUE/blob/master/R/DIALOGUE.cell.type.R
if(r@cells!=rownames(X)){
Given you have fixed X to be (k x n) as @tessadgreen mentioned in the closed post, then rownames(X) would be the K components.
Also, r@cells = colnames(tpm), would return multiple values - I believe a statement like:
if(all(r@cells!=rownames(X)))
would be better than the current
if(r@cells!=rownames(X))
Also please consider the axes of X; depending on your axes, it might be colnames rather than rownames:
if(r@cells!=colnames(X)){
Thanks in advance!
Thanks! Just fixed this
if(r@cells!=rownames(X))
was changed toif(!identical(r@cells,rownames(X)))
Note that X is (n x k) matrix, meaning, cells by features.
Great, that would work better than all() - looks like it works!
Note given X is (n x k), in your written tutorial
https://github.com/livnatje/DIALOGUE/wiki/Tutorial
you have:
X (k1 x n)
Awesome, I'll close this issue