velocyto.py
velocyto.py copied to clipboard
'VelocytoLoom' object has no attribute 'colorandum'
I have recently generated a loom file using velocyto and I am currently trying to implement the analysis pipeline on it. However, I see the following error when I try to use the vlm.plot_phase_portraits() and vlm.plot_grid_arrows() commands: AttributeError: 'VelocytoLoom' object has no attribute 'colorandum'.
In another issue report, it mentioned that you need to define the clusters to resolve this issue. However, I don't have any defined clusters currently in my loom file. Is there a way that I can still run these commands without defining clusters. If I do need to set clusters, do you also know how I can add these to my loom file. Is velocyto able to set clusters using tSNE? Any information on this would be much appreciated.
Hi spietrzak. All you have to do is define an array of length n (n = # cells) where each value denotes the cluster a cell is in. I personally use Seurat so I make use of their FindClusters
function. Once you have the cluster array, you can add this to the VelocytoLoom object like so vlm.set_clusters(cluster_array)
. This should automatically generate the colorandum attribute!
Hi mochar. Thank you for your response. We have used Monocle to generate cell clusters, so could we use this data to perform the same function? Additionally, is there a way to make sure that the order in the cluster array will match the order of the cells in the loom file (i.e. the cluster numbers match to the correct cells)?
I was finally able to generate a cluster array to use with my data and used the vlm.set_clusters() to add it to my vlm file. While I no longer see the same error, I do see a new one with the vlm.plot_phase_portraits saying "IndexError: index 1 is out of bounds for axis 0 with size 1". I have tried looking up this error to attempt to resolve it and I am still not entirely sure what it means or how to correct it.
For the vlm.plot_grid_arrows command, I don't see an error (only the warning message "The arrow scale was set to be 'absolute' make sure you know how to properly interpret the plots"), but it does look like it ran and generated a plot. However, I am not sure how I would be able to view this plot or save it as a png or other file type. If there are any ideas on how to resolve either of these issues, please let me know. Thanks.
Hi spietrzak. All you have to do is define an array of length n (n = # cells) where each value denotes the cluster a cell is in. I personally use Seurat so I make use of their
FindClusters
function. Once you have the cluster array, you can add this to the VelocytoLoom object like sovlm.set_clusters(cluster_array)
. This should automatically generate the colorandum attribute!
How should I get the cluster array and add to the VelocytoLoom object?