adding gene names with biomaRt hgnc_symbol column <logical> with NA
1
0
Entering edit mode
jnaviapelaez ▴ 10
@jnaviapelaez-23060
Last seen 2.6 years ago

I am adding gene names to my results from DESeq2

however, I am running into a problem and don't know how to fix it

I am getting the hgnc_symblo column as <logical> and with NA values

here is the code

  res_cisp$ensembl <- sapply(strsplit(rownames(res_cisp), split="\\+"),"[",1) 
  ensembl <- useMart("ensembl", dataset="mmusculus_gene_ensembl", host="uswest.ensembl.org" ) 
  ensembl
  genemap <- getBM(attributes=c("ensembl_gene_id", "entrezgene_id", "hgnc_symbol"),
  filters= "ensembl_gene_id",
  values= res_cisp$ensembl,
  mart= ensembl)

  idx <- match(res_cisp$ensembl, genemap$ensembl_gene_id)
  res_cisp$entrez <- genemap$entrezgene_id[idx]
  res_cisp$hgnc_symbol <- genemap$hgnc_symbol[idx]

  head(res_cisp)

and the results

log2 fold change (MMSE): condition cisplatin it saline vs naive 
Wald test p-value: condition cisplatin.it.saline vs naive 
DataFrame with 6 rows and 8 columns
                           baseMean      log2FoldChange             lfcSE
                          <numeric>           <numeric>         <numeric>
ENSMUSG00000103377 49.1110927570198 0.00414782875544946  0.49189537354036
ENSMUSG00000098104 12.2865163125002  -0.073818230097171 0.460767651597771
ENSMUSG00000102175 7.18534311588583  -0.204118906299468   1.1017255901118
ENSMUSG00000103265 14.3593112522462  0.0176820483747342 0.664184999715962
ENSMUSG00000103922 50.0663878879066   0.317321233753418 0.388894551120162
ENSMUSG00000033845 4150.26363804658   0.408154062125359 0.251104088928333
                               pvalue              padj            ensembl    entrez
                            <numeric>         <numeric>        <character> <integer>
ENSMUSG00000103377  0.980115594258496 0.996217945158712 ENSMUSG00000103377        NA
ENSMUSG00000098104  0.707277000946448  0.89484074550068 ENSMUSG00000098104        NA
ENSMUSG00000102175                 NA                NA ENSMUSG00000102175        NA
ENSMUSG00000103265  0.847547508190696 0.951328475392166 ENSMUSG00000103265        NA
ENSMUSG00000103922  0.189685601646874 0.486707535702066 ENSMUSG00000103922        NA
ENSMUSG00000033845 0.0532513850609968 0.235103096130907 ENSMUSG00000033845     27395
                   hgnc_symbol
                     <logical>
ENSMUSG00000103377          NA
ENSMUSG00000098104          NA
ENSMUSG00000102175          NA
ENSMUSG00000103265          NA
ENSMUSG00000103922          NA
ENSMUSG00000033845          NA

any ideas?

sessionInfo() R version 3.6.1 (2019-07-05) Platform: x86_64-apple-darwin15.6.0 (64-bit) Running under: macOS Sierra 10.12.5

Matrix products: default BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib

locale: [1] enUS.UTF-8/enUS.UTF-8/enUS.UTF-8/C/enUS.UTF-8/en_US.UTF-8

attached base packages: [1] parallel stats4 stats graphics grDevices utils datasets methods
[9] base

other attached packages: [1] biomaRt2.42.0 DESeq21.26.0 SummarizedExperiment1.16.1 [4] DelayedArray0.12.2 BiocParallel1.20.1 matrixStats0.55.0
[7] Biobase2.46.0 GenomicRanges1.38.0 GenomeInfoDb1.22.0
[10] IRanges
2.20.2 S4Vectors0.24.3 BiocGenerics0.32.0
[13] dplyr0.8.5 tibble2.1.3 magrittr_1.5

loaded via a namespace (and not attached): [1] bitops1.0-6 bit640.9-7 RColorBrewer1.1-2
[4] progress
1.2.2 httr1.4.1 tools3.6.1
[7] backports1.1.5 utf81.1.4 R62.4.1
[10] rpart
4.1-15 Hmisc4.3-1 DBI1.1.0
[13] colorspace1.4-1 nnet7.3-13 tidyselect1.0.0
[16] gridExtra
2.3 prettyunits1.1.1 bit1.1-15.2
[19] curl4.3 compiler3.6.1 cli2.0.2
[22] htmlTable
1.13.3 scales1.1.0 checkmate2.0.0
[25] genefilter1.68.0 askpass1.1 rappdirs0.3.1
[28] stringr
1.4.0 digest0.6.25 foreign0.8-76
[31] XVector0.26.0 base64enc0.1-3 jpeg0.1-8.1
[34] pkgconfig
2.0.3 htmltools0.4.0 dbplyr1.4.2
[37] htmlwidgets1.5.1 rlang0.4.5 rstudioapi0.11
[40] RSQLite
2.2.0 acepack1.4.1 RCurl1.98-1.1
[43] GenomeInfoDbData1.2.2 Formula1.2-3 Matrix1.2-18
[46] Rcpp
1.0.3 munsell0.5.0 fansi0.4.1
[49] lifecycle0.2.0 stringi1.4.6 zlibbioc1.32.0
[52] BiocFileCache
1.10.2 grid3.6.1 blob1.2.1
[55] crayon1.3.4 lattice0.20-40 splines3.6.1
[58] annotate
1.64.0 hms0.5.3 locfit1.5-9.1
[61] knitr1.28 pillar1.4.3 geneplotter1.64.0
[64] XML
3.99-0.3 glue1.3.1 latticeExtra0.6-29
[67] data.table1.12.8 BiocManager1.30.10 png0.1-7
[70] vctrs
0.2.4 gtable0.3.0 openssl1.4.1
[73] purrr0.3.3 assertthat0.2.1 ggplot23.3.0
[76] xfun
0.12 xtable1.8-4 survival3.1-11
[79] AnnotationDbi1.48.0 memoise1.1.0 cluster_2.1.0

thanks,

biomaRt gene annotation • 267 views
ADD COMMENT
1
Entering edit mode
@james-w-macdonald-5106
Last seen 2 days ago
United States

For mice you use 'mgi_symbol"

> mart <- useEnsembl("ensembl","mmusculus_gene_ensembl", mirror = "useast")
> gns <- c("ENSMUSG00000103377","ENSMUSG00000098104","ENSMUSG00000102175","ENSMUSG00000103265","ENSMUSG00000103922","ENSMUSG00000033845")
> getBM(c("ensembl_gene_id","mgi_symbol"), "ensembl_gene_id", gns, mart)
     ensembl_gene_id mgi_symbol
1 ENSMUSG00000033845     Mrpl15
2 ENSMUSG00000098104     Gm6085
3 ENSMUSG00000102175     Gm6119
4 ENSMUSG00000103265     Gm2053
5 ENSMUSG00000103377    Gm37180
6 ENSMUSG00000103922     Gm6123
ADD COMMENT
0
Entering edit mode

ooohh thank you!!!!!

ADD REPLY

Login before adding your answer.

Traffic: 259 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6