Closed gmhhope closed 1 year ago
using cytoscapejs
solves this issue
Ok. Regarding import to Cytoscape via automation, Cytoscape checks the first few values to guess the type. I see perhaps the first values were NA, so it defaults to string. You can sort your data prior to import to present numerical values first, or you can initialize column type in an explicit creation step prior to loading data.
Ok. Regarding import to Cytoscape via automation, Cytoscape checks the first few values to guess the type. I see perhaps the first values were NA, so it defaults to string. You can sort your data prior to import to present numerical values first,
How do you do then if you have multiple columns ? Sorting might not work across all columns.
or you can initialize column type in an explicit creation step prior to loading data.
Could you please detail how to proceed ?
You can find an example in the code for the handling of Integers here: https://github.com/cytoscape/RCy3/blob/devel/R/Tables.R#L345
If you have Cytoscape running, then you can view the documentation for the CyREST API call being used here: http://localhost:1234/v1/swaggerUI/swagger-ui/index.html?url=http%3A%2F%2Flocalhost%3A1234%2Fv1%2Fswagger.json#!/Tables/createColumn
So, you can explicitly set the names and types for new columns this way, before importing the values.
A less elegant (but less coding) approach would be to lapply through each column in your data, sort it and load it. This is how you'd get around sorting across multiple columns.
Hi Alex,
Somehow I tried to load my node table and visualize with fill color (e.g., Chisq_illness_duration ), and using
str()
shows the column is numeric. However, when I load the node_table, the type of the column becomes string in cytoscape desktop. What might be the issue and how to solve this? Thanks!Interestingly, manual loading of the table renders float for those columns. Is the NA the culprit? I have tested if I remove the NA rows, it seems to work. But I have to keep them :/
Attached is the test node & edge table attr_test.csv full_tree_edge_table.csv
Thanks, Minghao Gong