Skip to content

Instantly share code, notes, and snippets.

@crazyhottommy
Created November 17, 2023 22:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crazyhottommy/317544f3256f211266ad50ceb4ea8965 to your computer and use it in GitHub Desktop.
Save crazyhottommy/317544f3256f211266ad50ceb4ea8965 to your computer and use it in GitHub Desktop.
get metadata
```{r}
library(GEOquery)
library(tidyverse)
meta<- getGEO(GEO= "GSE185507",GSEMatrix=FALSE)
```
```{r}
meta@gsms$GSM5616943@header$characteristics_ch1
```
```{r}
purrr::map(meta@gsms, ~.x@header$characteristics_ch1) %>%
stack() %>%
tidyr::separate(values, into = c("feature", "value"), sep= ": ")%>%
pivot_wider(names_from= feature, values_from = value) %>%
janitor::clean_names() %>%
write_csv("~/Downloads/GSE185507_meta.csv")
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment