How to get results from Homo.sapiens package in bioconductor for a specific reference I want to use the Homo.sapiens package in Bioconductor to retrieve the chromosome location start and end for each gene symbol in a specific reference (e.g. hg19 or hg38).

Right now, I am using the following code:

&gt; select(Homo.sapiens, keys=c('KRAS'), cols &lt;-c('SYMBOL', 'TXCHROM', 'TXSTART', 'TXEND'), keytype='SYMBOL')

  SYMBOL TXCHROM  TXSTART    TXEND
1   KRAS   chr12 25358180 25403854
2   KRAS   chr12 25386768 25403863


My question is two-fold:


How can I specify the human genome reference I want to retrieve the data from? (e.g. hg19 or hg38)
Why do I receive multiple and different mappings through Homo.sapiens for some genes? If I check the locations through GeneCards I get:


chr12:25,204,789-25,250,936 (GRCh38/hg38)
chr12:25,357,723-25,403,870 (GRCh37/hg19)
I couldn't find how is this package build, my guess is that is as in the example of the OrganismDBI package. See that vignette section to build your own data package with the genome you want. 

The locations are different because you ask for the transcript start and end, if you add the "TXNAME", you will (probably) see there are different transcripts, so different mappings are reported (untested). 

Update

The example of the OrganismDBI package builds correctly the Homo.sapiens package, which appears to be linked with hg19. I provide here the relevant code to build the package for hg19 and hg38.

&gt; source("https://bioconductor.org/biocLite.R")
&gt; biocLite("TxDb.Hsapiens.UCSC.hg19.knownGene")
&gt; biocLite("TxDb.Hsapiens.UCSC.hg38.knownGene")

&gt; library(OrganismDbi)

# instructions for hg19, for hg38 change accordingly
&gt; gd &lt;- list(join1 = c(GO.db="GOID", org.Hs.eg.db="GO"), 
             join2 = c(org.Hs.eg.db = "ENTREZID", 
                       TxDb.Hsapiens.UCSC.hg19.knownGene = "GENEID"))
&gt; destination &lt;- tempfile()
&gt; dir.create(destination)
&gt; makeOrganismPackage(pkgname = "Homo.sapiens.hg19", graphData = gd, 
                      organism = "Homo sapiens", version = "1.0.0", 
                      maintainer = "Maintainer&lt;maintainer@email&gt;", 
                      author = "Author Name", destDir = destination, 
                      license = "Artistic-2.0")

Creating package in /var/folders/sf/tfrswpc96jl8b4520mn784440000gn/T//RtmpzR4YnY/file111b490af70f/Homo.sapiens.hg19

# installing package
&gt; install.packages(destination, repos = NULL, type="source")


Then, you can load and use the packages with:

&gt; library(Homo.sapiens.hg19)
&gt; library(Homo.sapiens.hg38)

&gt; select(Homo.sapiens.hg19, keys=c('KRAS'), 
     cols = c('SYMBOL', 'TXCHROM', 'TXSTART', 'TXEND'), 
     keytype = 'SYMBOL')
'select()' returned 1:many mapping between keys and columns
  SYMBOL TXCHROM  TXSTART    TXEND
1   KRAS   chr12 25358180 25403854
2   KRAS   chr12 25386768 25403863
&gt; select(Homo.sapiens.hg38, keys = c('KRAS'), cols = 
       c('SYMBOL', 'TXCHROM', 'TXSTART', 'TXEND'), keytype = 'SYMBOL')
'select()' returned 1:many mapping between keys and columns
  SYMBOL TXCHROM  TXSTART    TXEND
1   KRAS   chr12 25204789 25250931
2   KRAS   chr12 25209168 25250936
3   KRAS   chr12 25209431 25250803
4   KRAS   chr12 25233819 25250929