5
$\begingroup$

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:

> select(Homo.sapiens, keys=c('KRAS'), cols <-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)
$\endgroup$
3
$\begingroup$

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.

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

> library(OrganismDbi)

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

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

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

Then, you can load and use the packages with:

> library(Homo.sapiens.hg19)
> library(Homo.sapiens.hg38)

> 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
> 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
$\endgroup$
4
  • $\begingroup$ You're right about TXNAME, I'll check about building my own data package, even if I'd like a tested implementation. Thanks $\endgroup$
    – gc5
    Mar 23 '18 at 13:06
  • 1
    $\begingroup$ @gc5 that is the tested implementation, this data packages only collect the information available from other packages. So the data isn't altered $\endgroup$
    – llrs
    Mar 23 '18 at 13:11
  • 1
    $\begingroup$ @gc5 Thanks for adding the code you used. I only tweaked the format $\endgroup$
    – llrs
    Mar 26 '18 at 15:40
  • $\begingroup$ Yes, thanks. I still don't understand why the hg19 package does not provide a coherent mapping of transcript start and end with GeneCards, but I think that's minor. $\endgroup$
    – gc5
    Mar 26 '18 at 15:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.