File tree Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -182,20 +182,16 @@ Here we will add a gene symbol column to the `airway` object. This will be used
182182library(org.Hs.eg.db)
183183library(AnnotationDbi)
184184
185- # Add gene symbol and entrez for better annotation
186- rowData(airway)$symbol = AnnotationDbi::mapIds(org.Hs.eg.db::org.Hs.eg.db,
187- keys = rownames(airway),
188- keytype = "ENSEMBL",
189- column = "SYMBOL",
190- multiVals = "first"
191- )
192-
193- rowData(airway)$entrezid = AnnotationDbi::mapIds(org.Hs.eg.db::org.Hs.eg.db,
194- keys = rownames(airway),
185+ # Add gene symbol and entrez
186+ airway <-
187+ airway |>
188+
189+ mutate(entrezid = mapIds(org.Hs.eg.db,
190+ keys = .feature,
195191 keytype = "ENSEMBL",
196192 column = "ENTREZID",
197193 multiVals = "first"
198- )
194+ ))
199195
200196detach("package:org.Hs.eg.db", unload = TRUE)
201197detach("package:AnnotationDbi", unload = TRUE)
You can’t perform that action at this time.
0 commit comments