Closed gabyrech closed 4 years ago
Hi Gabriel,
Could you please post the result of head(te_annotated)
and the image that is produced? That'll help me piece together what might be happening.
Thanks, Raymond
Hi Raymond. Thanks for your reply. Here you go:
>head(te_annotated)
GRanges object with 6 ranges and 22 metadata columns:
seqnames ranges strand | te_ref frame Class Order SuperFamily family
<Rle> <IRanges> <Rle> | <factor> <factor> <factor> <factor> <factor> <factor>
[1] chr2L 553854 - | 2L_553854_553854_412 . RNA LTR Gypsy 412
[2] chr2L 553854 - | 2L_553854_553854_412 . RNA LTR Gypsy 412
[3] chr2L 553854 - | 2L_553854_553854_412 . RNA LTR Gypsy 412
[4] chr2L 553854 - | 2L_553854_553854_412 . RNA LTR Gypsy 412
[5] chr2L 553854 - | 2L_553854_553854_412 . RNA LTR Gypsy 412
[6] chr2L 553854 - | 2L_553854_553854_412 . RNA LTR Gypsy 412
inref g_count genomes te_ids te_len te_ratio Comeron FistonL RecomConclusion
<factor> <integer> <factor> <factor> <factor> <factor> <numeric> <factor> <factor>
[1] NO 1 TOM-007 TOM-007_1_412 7562 0.972 1.993676178 2.045 HRR
[2] NO 1 TOM-007 TOM-007_1_412 7562 0.972 1.993676178 2.045 HRR
[3] NO 1 TOM-007 TOM-007_1_412 7562 0.972 1.993676178 2.045 HRR
[4] NO 1 TOM-007 TOM-007_1_412 7562 0.972 1.993676178 2.045 HRR
[5] NO 1 TOM-007 TOM-007_1_412 7562 0.972 1.993676178 2.045 HRR
[6] NO 1 TOM-007 TOM-007_1_412 7562 0.972 1.993676178 2.045 HRR
Filter America Europa Other SFS_cat chromosomeClean annot
<factor> <integer> <integer> <integer> <factor> <factor> <GRanges>
[1] pass 0 1 0 Rare 2L chr2L:552924-553923:-
[2] pass 0 1 0 Rare 2L chr2L:553455-557454:-
[3] pass 0 1 0 Rare 2L chr2L:550503-554502:-
[4] pass 0 1 0 Rare 2L chr2L:553455-557454:-
[5] pass 0 1 0 Rare 2L chr2L:553742-554274:-
[6] pass 0 1 0 Rare 2L chr2L:553742-554274:-
-------
seqinfo: 5 sequences from an unspecified genome; no seqlengths
Hi Gabrial,
I see what you mean now. You'd prefer that the facets be lined up in three columns for Rare, Polymorphic and Fixed. I think you should be able to do something like:
recomPlot = recomPlot + facet_wrap(V1 ~ V2, ncol = 3)
Since annotatr plot functions return the plots themselves, you can modify their styles after creating them. In this case, the V1 and V2 wouldn't have been obvious without looking in the source code. Sorry about that.
Let me know if that works?
Thanks, Raymond
Thanks Raymond, I am not sure if I should change V1 and V2 with any of my variables? I am getting this:
> recomPlot = recomPlot + facet_wrap(V1 ~ V2, ncol = 3)
> recomPlot
Error: At least one layer must contain all faceting variables: `V1`, `V2`.
* Plot is missing `V1`, `V2`
* Layer 1 is missing `V1`, `V2`
* Layer 2 is missing `V1`, `V2`
Oh, perhaps I was trying to be too clever, does the following work?
recomPlot = recomPlot + facet_wrap(annot.type ~ SFS_cat, ncol = 3)
Great! That works! Thank so much for your help and congrats for annotatr, it is a a great tool and very useful! All the best, Gabriel
Excellent, thanks for the feedback! I'll go ahead and close the issue.
Hi! I am trying to build a plot_numerical() with two categorical variables to facet over but I am getting 5 columns in the plot instead of 3 . My code is:
So, I would like my plot to show three columns (Rare','Polymorphic','Fixed) for each "annot.type". But instead I am getting 5 columns. Any way to change this? Thanks! Gabriel