Skip to content
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

Question Regarding PCA plot #14

Closed
Miladebrahim opened this issue Aug 8, 2023 · 1 comment
Closed

Question Regarding PCA plot #14

Miladebrahim opened this issue Aug 8, 2023 · 1 comment

Comments

@Miladebrahim
Copy link

Hi Igor,

Was wondering how can i set assign each group when running rna-star-groups-dge a specific color ?
I have only two groups and I would like to choose which is red and which is blue on the PCA
Thank you

@igordot
Copy link
Owner

igordot commented Aug 8, 2023

The colors are defined in the deseq2-pca.R script. Specifically:

sns/scripts/deseq2-pca.R

Lines 47 to 55 in d59a37c

# set color scheme based on the number of groups
if (nlevels(fac) > 20) {
colors = rainbow(nlevels(fac))
} else if (nlevels(fac) > 2) {
colors = unique(c(brewer.pal(5, "Set1"), brewer.pal(8, "Dark2"), brewer.pal(8, "Accent")))
colors = colors[1:nlevels(fac)]
} else {
colors = c("dodgerblue3", "firebrick3")
}

You can modify the script to fit your needs.

@igordot igordot closed this as completed Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants