Created
October 4, 2024 20:37
-
-
Save oganm/5c2f42574f6cc4dde8810c3a1b2c53e7 to your computer and use it in GitHub Desktop.
GSE add links
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(readxl) | |
library(writexl) | |
library(gemma.R) | |
library(GEOquery) | |
library(dplyr) | |
library(glue) | |
data = readxl::read_excel('~/Downloads/Bad_QC_datasets_together.xlsx') | |
datasets = data$dataset | |
# pubmed ids ------------ | |
pubmed_ids = datasets %>% sapply(function(name){ | |
name = gsub('\\..*?$','',name) | |
geo = GEOquery::getGEO(name) | |
geo %>% lapply(\(x){ | |
attributes(attributes(x)$experimentData)$other$pubmed_id | |
}) %>% unique %>% unlist %>% paste0(collapse = ', ') %>% | |
gsub('\n',', ',.) | |
}) | |
# gemma links ------------ | |
set_gemma_user('OganM',readLines('~/gemma.R/auth')) | |
gemma_data = get_datasets_by_ids(datasets) %>% get_all_pages() | |
gemma_links = | |
glue::glue("https://gemma.msl.ubc.ca/expressionExperiment/showExpressionExperiment.html?id={gemma_data$experiment.ID}") %>% | |
{.[match(datasets,gemma_data$experiment.shortName)]} | |
# geo pages-------- | |
geo_links = glue::glue("https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc={gsub('\\\\..*?$','',datasets)}") | |
# multiqc report----------- | |
multiqc_links = glue::glue("https://luigi.pavlab.msl.ubc.ca/rnaseq-pipeline/experiment/{datasets}/report") | |
data$pubmed_ids = pubmed_ids | |
data$gemma_links = writexl::xl_hyperlink(gemma_links) | |
data$geo_links = writexl::xl_hyperlink(geo_links) | |
data$multiqc_links = writexl::xl_hyperlink(multiqc_links) | |
writexl::write_xlsx(data,'bad_data_links.xlsx') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment