mirror of
				https://github.com/johrpan/ubigen.git
				synced 2025-10-26 19:57:24 +01:00 
			
		
		
		
	Add GTEx tissues dataset
This commit is contained in:
		
							parent
							
								
									510fafeb6e
								
							
						
					
					
						commit
						c14208c2b2
					
				
					 7 changed files with 49 additions and 4 deletions
				
			
		
							
								
								
									
										3
									
								
								R/data.R
									
										
									
									
									
								
							
							
						
						
									
										3
									
								
								R/data.R
									
										
									
									
									
								
							|  | @ -4,6 +4,9 @@ | ||||||
| #' The results from the analysis across all GTEx samples. | #' The results from the analysis across all GTEx samples. | ||||||
| "gtex_all" | "gtex_all" | ||||||
| 
 | 
 | ||||||
|  | #' The results from the analysis across GTEx tissue aggregated data. | ||||||
|  | "gtex_tissues" | ||||||
|  | 
 | ||||||
| #' The results from the analysis across Human Protein Atlas' tissue aggregated | #' The results from the analysis across Human Protein Atlas' tissue aggregated | ||||||
| #' data. | #' data. | ||||||
| "hpa_tissues" | "hpa_tissues" | ||||||
|  |  | ||||||
|  | @ -2,7 +2,9 @@ | ||||||
| #' @noRd | #' @noRd | ||||||
| server <- function(input, output, session) { | server <- function(input, output, session) { | ||||||
|   dataset <- reactive({ |   dataset <- reactive({ | ||||||
|     analysis <- if (input$dataset == "hpa_tissues") { |     analysis <- if (input$dataset == "gtex_tissues") { | ||||||
|  |       ubigen::gtex_tissues | ||||||
|  |     } else if (input$dataset == "hpa_tissues") { | ||||||
|       ubigen::hpa_tissues |       ubigen::hpa_tissues | ||||||
|     } else { |     } else { | ||||||
|       ubigen::gtex_all |       ubigen::gtex_all | ||||||
|  |  | ||||||
							
								
								
									
										5
									
								
								R/ui.R
									
										
									
									
									
								
							
							
						
						
									
										5
									
								
								R/ui.R
									
										
									
									
									
								
							|  | @ -23,8 +23,9 @@ ui <- function() { | ||||||
|               "dataset", |               "dataset", | ||||||
|               label = strong("Expression dataset"), |               label = strong("Expression dataset"), | ||||||
|               list( |               list( | ||||||
|                 "GTEx (all samples)" = "gtex_all", |                 "GTEx (across tissues and conditions)" = "gtex_all", | ||||||
|                 "Human Protein Atlas (tissues)" = "hpa_tissues" |                 "GTEx (across tissues)" = "gtex_tissues", | ||||||
|  |                 "Human Protein Atlas (across tissues)" = "hpa_tissues" | ||||||
|               ) |               ) | ||||||
|             ), |             ), | ||||||
|             selectInput( |             selectInput( | ||||||
|  |  | ||||||
							
								
								
									
										
											BIN
										
									
								
								data/gtex_tissues.rda
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								data/gtex_tissues.rda
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										16
									
								
								man/gtex_tissues.Rd
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								man/gtex_tissues.Rd
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,16 @@ | ||||||
|  | % Generated by roxygen2: do not edit by hand | ||||||
|  | % Please edit documentation in R/data.R | ||||||
|  | \docType{data} | ||||||
|  | \name{gtex_tissues} | ||||||
|  | \alias{gtex_tissues} | ||||||
|  | \title{The results from the analysis across GTEx tissue aggregated data.} | ||||||
|  | \format{ | ||||||
|  | An object of class \code{data.table} (inherits from \code{data.frame}) with 56156 rows and 17 columns. | ||||||
|  | } | ||||||
|  | \usage{ | ||||||
|  | gtex_tissues | ||||||
|  | } | ||||||
|  | \description{ | ||||||
|  | The results from the analysis across GTEx tissue aggregated data. | ||||||
|  | } | ||||||
|  | \keyword{datasets} | ||||||
							
								
								
									
										23
									
								
								scripts/gtex_tissues.R
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								scripts/gtex_tissues.R
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,23 @@ | ||||||
|  | library(data.table) | ||||||
|  | library(here) | ||||||
|  | 
 | ||||||
|  | i_am("scripts/gtex_tissues.R") | ||||||
|  | 
 | ||||||
|  | # Source: https://storage.googleapis.com/gtex_analysis_v8/rna_seq_data/GTEx_Analysis_2017-06-05_v8_RNASeQCv1.1.9_gene_median_tpm.gct.gz | ||||||
|  | data <- fread(here("scripts", "input", "gtex_tissues.tsv")) | ||||||
|  | data[, Description := NULL] | ||||||
|  | setnames(data, "Name", "gene") | ||||||
|  | 
 | ||||||
|  | # Remove Ensembl gene version numbers. | ||||||
|  | data[, gene := stringr::str_split(gene, "\\.") |> purrr::map_chr(1)] | ||||||
|  | 
 | ||||||
|  | data <- melt( | ||||||
|  |     data, | ||||||
|  |     id.vars = "gene", | ||||||
|  |     variable.name = "sample", | ||||||
|  |     value.name = "expression", | ||||||
|  |     variable.factor = FALSE | ||||||
|  | ) | ||||||
|  | 
 | ||||||
|  | gtex_tissues <- ubigen::analyze(data) | ||||||
|  | usethis::use_data(gtex_tissues, overwrite = TRUE) | ||||||
|  | @ -1,7 +1,7 @@ | ||||||
| library(data.table) | library(data.table) | ||||||
| library(here) | library(here) | ||||||
| 
 | 
 | ||||||
| i_am("scripts/hpa.R") | i_am("scripts/hpa_tissues.R") | ||||||
| 
 | 
 | ||||||
| # Source: https://www.proteinatlas.org/download/rna_tissue_hpa.tsv.zip | # Source: https://www.proteinatlas.org/download/rna_tissue_hpa.tsv.zip | ||||||
| data <- fread(here("scripts", "input", "rna_tissue_hpa.tsv")) | data <- fread(here("scripts", "input", "rna_tissue_hpa.tsv")) | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue