Comments (9)
- In order to re-shuffle in the left relative abundance plot (per-sample), you can provide just the names of the datasets (in this example I provide them in a random order):
data(immdata)
p <- repClonality(immdata$data, "homeo") %>% vis()
p <- p + scale_x_discrete(limits= sample(names(immdata$data), length(immdata$data), FALSE))
p
- Regarding the second plot. Our team will work on the more powerful ordering, thank you! I will leave this issue open until we implement this. You provided a very good workaround, thank you! And using functions such as
scale_x_discrete
it is possible to rename group names in the legend and of x/y axis.
from immunarch.
Yes, it is possible using the ggplot2 scale_x_discrete
function. Here is the example using the data from the package
data(immdat)
p = repDiversity(immdata$data) %>% vis("Status", immdata$meta)
p + scale_x_discrete(limits = c("MS", "C"))
from immunarch.
Oh i did find a crude way around this problem. It seems that the order is based on default alphabetical order, so i just made a new column in .meta and assigned "A", "B","C" to the samples in the order I want them to be, which would then output in the right order.
from immunarch.
This link might help: http://www.cookbook-r.com/Graphs/Axes_(ggplot2)/
from immunarch.
Hi @vadimnazarov thanks for your answer. After my post I used the exact same method to fix the ordering. However, the problem I have is with the Relative Abundance figures (ex. this one you had on your website), where scale_x_discrete no longer works.
from immunarch.
can you please provide an R code that you use to do that? Including the repClonality
part
from immunarch.
Ping about the sample order on figures @peter-yufan-zeng
from immunarch.
repClonality(immdata.opc.bcr$data, .method = "homeo", .clone.types = c(Small = .001, Medium = .01, Large = .1, Hyperexpanded = 10)) %>% vis(., .by=c("cluster_order"),.meta=immdata.opc.bcr$meta)+ labs(title = "",subtitle = "") + theme_classic()+ theme(axis.text.x=element_text(angle=45, hjust=1),legend.position = "none") + scale_fill_manual(values = c("Immune Rich" = "#3B4992FF","Mixture"="#EE0000FF","Immune Dessert"="#008B45FF"))+ scale_x_discrete(limits=c("Immune Rich","Mixture","Immune Desert"))+ xlab("") + ylab("Relative abundance (%)")
This is where it breaks down - likely because the x-axis in the right figure is (small, medium, large, hyperexpanded, etc.)
from immunarch.
Thank you, I will look into it!
from immunarch.
Related Issues (20)
- Loading BD Rhapsody VDJ CDR3 data
- Incorrect parsing of AIRR files HOT 1
- select_()` was deprecated in dplyr 0.7.0.
- Error when generating plot for "Gini coefficient" HOT 1
- Issue with repLoad and repGermline when using O. mykiss IMGT data HOT 2
- Ambiguous Gene Usage in TRBD HOT 2
- Package Installation Error HOT 1
- Get Immunarch back to CRAN
- Number of sequence provided in .data and .dist are not matching!
- Deprecation warning from purrr in function seqCluster
- Single cell TCRSeq HOT 1
- C call with TRUST4 files HOT 2
- gene_stats for pig TRAV
- Found dataframe without required column Cluster
- How to specify groups order?
- MiXCR import no longer works HOT 4
- File naming vs loading problems HOT 2
- Cellranger Data Loading HOT 1
- object 'generate_germline_sequence' not found
- CDR3 Length paired 10x data
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from immunarch.