nvelden / geneviewer

An R package designed for drawing gene arrow maps
https://nvelden.github.io/geneviewer/
Other
31 stars 5 forks source link

Links #8

Open Jessica1080 opened 4 months ago

Jessica1080 commented 4 months ago

Hi,

I'm trying to understand the GC_links( ) function a bit better and it looks like the example charts on the GC_links page don't reflect the changes in code.

When you use the GC_links function with blast results - I understand that it pulls from either the similarity or identity and these are the displayed percentages, but what determines the colors of the link? Some are grey and some are red in the examples...maybe I missed it somewhere, but is there a threshold value that switches the link from red/grey?

Thanks so much!

nvelden commented 4 months ago

The grey color indicates genes that are in the same orientation between clusters. The red color indicates genes that are inverted (in the reverse orientation). If you want to change the color for each, you can use the normal_color and inverted_color variables. These variables can accept hex color codes (e.g., #969696 for grey) as well as normal color names (e.g., "grey").

In the example below, all links are colored grey based on their identity values.

GC_chart(
  erythromycin_BlastP,
  cluster = "cluster"
) %>%
  GC_links(
    "BlastP",
    measure = "identity", # none / similarity
    normal_color = "#969696",
    inverted_color = "#969696",
  )

For all options see the GC_links documentation:

K3nnyBIOEPAR commented 1 month ago

Hi,

Thank you for your work on Geneviewer! I'm trying to make a cluster comparison using BlastP between several bacterial genomes. I succeeded to get the chart with the relevant genes but it seems that the GC_links don't work. Please could you help me on this issue? I join my script below (until the GC_scale, all is work) GC_chart( data = BlastP_results_2, cluster = "cluster", group = "function.", strand = "strand", height = "300px" ) %>% GC_labels(label = "gene", cluster = 1) %>% GC_scale(axis_type = "range") %>% GC_links(group = "BlastP", measure = "identity") %>%
GC_clusterLabel() %>% GC_legend(TRUE)

Thanks for your help ;-)