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

feature request: a function to visualise the expression of selected variables #134

Open
aljabadi opened this issue Jun 17, 2021 · 3 comments
Assignees
Labels
feature-request Can be implemented if there's enough interest

Comments

@aljabadi
Copy link
Collaborator

aljabadi commented Jun 17, 2021

data("breast.TCGA")
data = list(mrna = breast.TCGA$data.train$mrna, mirna = breast.TCGA$data.train$mirna,
            protein = breast.TCGA$data.train$protein)
# set number of variables to select, per component and per data set (this is set arbitrarily)
list.keepX = list(mrna = rep(20, 2), mirna = rep(20,2), protein = rep(20, 2))

TCGA.block.splsda = block.splsda(X = data, Y = breast.TCGA$data.train$subtype, 
                                 ncomp = 2, keepX = list.keepX, design = 'full')

## plot signature variables for mrna and mirna
# min contribution for mrna
plotMarkers(object = TCGA.block.splsda, comp = 1, block = 'mrna', contrib = 'min')

## plot only the top 6 variables
plotMarkers(object = TCGA.block.splsda, comp = 1, block = 'mrna', contrib = 'min', top_n = 6)

# max contribution for protein
plotMarkers(object = TCGA.block.splsda, comp = 1, block = 'protein', contrib = 'max')

@aljabadi aljabadi added the feature-request Can be implemented if there's enough interest label Jun 17, 2021
@aljabadi aljabadi self-assigned this Jun 17, 2021
aljabadi added a commit to aljabadi/mixOmics that referenced this issue Jun 17, 2021
aljabadi added a commit to aljabadi/mixOmics that referenced this issue Jun 22, 2021
@mixOmicsTeam
Copy link
Owner

I am not sure the use of the argument 'min' or 'max' makes sense here? In the past we have referred to a positive or a negative loading value, is this what you mean? This needs to be explained in the help file or potentially show both pos and neg in two independent plots, otherwise by default a user will only see (potentially) half the features.

@aljabadi
Copy link
Collaborator Author

aljabadi commented Jul 15, 2021

That's a fair point. I changed it so that all selected variables are shown and factted by their loading sign. See below.

data("breast.TCGA")
# this is the X data as a list of mRNA, miRNA and proteins
data = list(mrna = breast.TCGA$data.train$mrna, mirna = breast.TCGA$data.train$mirna,
            protein = breast.TCGA$data.train$protein)
ncomp = c(2)
# set number of variables to select, per component and per data set (this is set arbitrarily)
list.keepX = list(mrna = rep(5,2), mirna = rep(5,2), protein = rep(5,2))
TCGA.block.splsda = block.splsda(X = data, Y = breast.TCGA$data.train$subtype, 
                                 ncomp = ncomp, keepX = list.keepX, design = 'full')
## plot markers (selected variables) for mrna and mirna
# mrna: show each selected feature separately
plotMarkers(object = TCGA.block.splsda, comp = 1, block = 'mrna')
#> Warning: Groups with fewer than two data points have been dropped.

# mrna: show all selected features
plotMarkers(object = TCGA.block.splsda, comp = 1, block = 'mrna', global = TRUE)

# proteins
plotMarkers(object = TCGA.block.splsda, comp = 1, block = 'protein')
#> Warning: Groups with fewer than two data points have been dropped.

Created on 2021-07-15 by the reprex package (v2.0.0)

@aljabadi
Copy link
Collaborator Author

It no more takes any arguments related to signs or the number of top features to show (as we want the nature of the signature to remain intact).

aljabadi added a commit to aljabadi/mixOmics that referenced this issue Jul 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Can be implemented if there's enough interest
Projects
None yet
Development

No branches or pull requests

2 participants