I am using GenVisR to plotting my CNV result and found it very helpful.
Here I have two question regarding the cnSpec function, and could you please help me to figure them out?
1. how to adjust the thickness of the CNV lines within each chromosome to make them more visible? I tried to add geom_line() to the option plotLayer without success. could you please show me the right way to do that?
2. the function "cnSpec_buildMain" cannot be found
The cnSpec function uses geom_rect() to build the plot. You can view the source code on line 86 here: https://github.com/griffithlab/GenVisR/blob/master/R/cnSpec_buildMain.R. In general I would advise against increasing the thickness of these lines as doing so would require altering the data itself. I assume you have extremely short regions of CN and they don't show up quite as nice when viewed in the context of the entire genome. If you only care about a particular region i.e. one chromosome you could use the 'y' parameter to set a custom genome, for example just chromosome 1 and subset your data to just chromosome 1 before plotting. This might give better resolution to view the alterations. However if your set on increasing the thickness of the segments you can add a padding to the start and stop in the actual data you input. Also you could try altering the default color gradient to make things more visible.
For you second question cnSpec_buildMain is not an exported function, it's used internally by GenVisR. you can view it by using three colons. GenVisR:::cnSpec_buildMain. I need to go in and remove those non-exported functions from the r documentation.
Thanks very much for your great help. As you suggested , I will add a padding to the start and stop in the actual data to make it more visible.
By the way, which color code will you suggest to replace the default red for a better vision? I have tried to play with several different colors but none of them reached my expectation.
cnSpec using the ggplot2 layer scale_fill_gradientn() to do colors, you might try overwriting that layer and not transition through white as it does by default.
cnSpec using the ggplot2 layer scale_fill_gradientn() to do colors, you might try overwriting that layer and not transition through white as it does by default.
Hi Zach,
One more question.
I am trying to use coord_flip() to flip over the x and y axis, but seems the axis tick marks cannot be flipped.
Could you please show me the right way to do that?
Thanks again for your great helps!
Jieqiong