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
creating a matrix #15
Comments
Well, as this is an R wrapper around some javascript code you need to provide your data as an R matrix. Here's some code from the README that should give you an idea (think of 'have' as the source and of 'prefer' as the target): m <- matrix(c(11975, 5871, 8916, 2868,
1951, 10048, 2060, 6171,
8010, 16145, 8090, 8045,
1013, 990, 940, 6907),
byrow = TRUE,
nrow = 4, ncol = 4)
haircolors <- c("black", "blonde", "brown", "red")
dimnames(m) <- list(have = haircolors,
prefer = haircolors)
m
#> prefer
#> have black blonde brown red
#> black 11975 5871 8916 2868
#> blonde 1951 10048 2060 6171
#> brown 8010 16145 8090 8045
#> red 1013 990 940 6907 |
Hi, Thank you for your example but I still do not how to convert my data to the required matrix. |
Start by converting your json files to data frames, e.g using the jsonlite R package. |
Without any coding how would the matrix look like from the above 2 JSON files? |
You may want to look at the d3 chord layout: https://github.com/d3/d3-chord
I.e. the chord layout handles everything automatically: It calculates total node/group sizes and chord start and end positions, so you don't specify those explicitely... |
Thank you for your link but I still do not understand how the matrix should look like for my data. |
Sorry, show me some code of what you have tried so far, and some more explanation of what your data means. Your questions are too unspecific otherwise. |
One of them is the reference file (chr03) which contains one long sequence (35020413 character long) and other file contained multiple sequence with different length and different ids (tig00007144, tig00026480,...). I used an alignment software called BLAST to align these two sequences. The original alignment results are stored in tab separated file:
This is the column explanation:
I would like to see which parts (tig00007144, tig00026480, ...) mapped where to chr03. Thank you in advance. |
I'm afraid the chorddiag package is not suited for your purpose. You may be able to misuse it to some (but certainly not satisfactory) degree. I would suggest you look for another tool. |
Mictadlo, your data reminded me of an example in the RCircos package. Here is some documentation on that package. |
Unfortunately, I do not understand how could create a matrix for my data. There separated in 2 json files. The first one describe the circle labeling, color and size
On the other hand, the second file describes the relationship between each label in the chord chart.
How do I convert the above relationship file to a proper matrix?
Thank you in advance.
The text was updated successfully, but these errors were encountered: