get_gene_weights: Get Gene Weights from Reference Data

Description Usage Arguments Value Author(s) References Examples

View source: R/ssPATHS.R

Description

This method performs linear discriminant analysis on a reference dataset using a pre-defined set of genes related to a pathway of interest.

Usage

1
get_gene_weights(expression_se)

Arguments

expression_se

This is an SummarizedExperiment object of the reference samples. Rows are genes and columns are samples. The colData component must contain columns Y and sample_id. The former indicates whether this is a positive or negative sample and the latter is the unique sample id. All genes in the SummarizedExperiment object are assumed to be genes in the pathway of interest.

Value

A list containing the gene weights and estimated scores of the reference samples.

proj_vector_df

A dataframe containing the gene weights and gene ids

dca_proj

A dataframe containing the sample scores and sample ids.

Author(s)

Natalie R. Davidson

References

Steven C.H. Hoi, W. Liu, M.R. Lyu and W.Y. Ma (2006). Learning Distance Metrics with Contextual Constraints for Image Retrieval. Proceedings IEEE Conference on Computer Vision and Pattern Recognition (CVPR2006).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
data(tcga_expr_df)

# transform from data.frame to SummarizedExperiment
tcga_se <- SummarizedExperiment(t(tcga_expr_df[ , -(1:4)]),
                                colData=tcga_expr_df[ , 2:4])
colnames(tcga_se) <- tcga_expr_df$tcga_id
colData(tcga_se)$sample_id <- tcga_expr_df$tcga_id

# get related genes, for us hypoxia
hypoxia_gene_ids <- get_hypoxia_genes()
hypoxia_gene_ids <- intersect(hypoxia_gene_ids, rownames(tcga_se))
hypoxia_se <- tcga_se[hypoxia_gene_ids,]

# setup labels for classification
colData(hypoxia_se)$Y <- ifelse(colData(hypoxia_se)$is_normal, 0, 1)

# now we can get the gene weightings
res <- get_gene_weights(hypoxia_se)
gene_weights_test <- res[[1]]
sample_scores <- res[[2]]

nrosed/ssPATHS documentation built on April 24, 2020, 6:22 p.m.