How to name the custom genome in karyoploteR ?
1
0
Entering edit mode
@kirannbishwa01-12980
Last seen 6.4 years ago

I really like the features that are provided in karyoploteR.
https://bioconductor.org/packages/release/bioc/html/karyoploteR.html

But, I am working with different organisms. I am able to find the organisms of interest using:

> available.genomes()

 [1] "BSgenome.Alyrata.JGI.v1"                  
 [2] "BSgenome.Amellifera.BeeBase.assembly4"    
 [3] "BSgenome.Amellifera.UCSC.apiMel2"         
 [4] "BSgenome.Amellifera.UCSC.apiMel2.masked"

 

My organisms of interest is Arabdidopsis lyrata and I installed it using.

biocLite("BSgenome.Alyrata.JGI.v1")
But, when I try to plot the genome I get error message.

karyoploteR::plotKaryotype(genome = "BSgenome.Alyrata.JGI.v1")


        Error in .getInstalledPkgnameFromProviderVersion(genome, masked = masked) :
      Couldn't find a BSgenome data package that matches genome assembly
      (a.k.a. provider version): Alyrata.JGI.v1
    
      Please use 'available.genomes()' (or 'available.genomes(type="source")')
      to check the list of BSgenome data packages that are available in the
      Bioconductor repositories for your version of R/Bioconductor.
      If you don't find what you are looking for, please see the BSgenomeForge
      vignette in the BSgenome software package for how to forge a BSgenome
      data package for your organism of interest.

But, I am not able to load this genome. I have tried using different genome names like `Alyr`, `Alv1` and also tried looking what acronym is set for lyrata. But I can't find it.

Another question: How do I plot the karyotype if I don't have a BsGenome but a GTF, GFF file.

Any suggestions?

 

software error R bsgenome karyoploter • 2.1k views
ADD COMMENT
0
Entering edit mode
bernatgel ▴ 150
@bernatgel-7226
Last seen 10 months ago
Spain

Hi  @kirannbishwa01,

It should work as you are doing but it for some reason it does not work with this BSgenome. karyoploteR ultimately relies on the function `getBSgenome` from `BSgenome` to load the necessary BSgenomes on the fly. As an example I tried downloading and installing `"BSgenome.Vvinifera.URGI.IGGP12Xv2"` and loading with `getBSgenome("BSgenome.Vvinifera.URGI.IGGP12Xv2")` and it worked perfectly. However, doing the same with your genome results in an error:

    getBSgenome("BSgenome.Alyrata.JGI.v1")
    Error in .getBSgenomeObjectFromInstalledPkgname(genome) : 
      BSgenome.Alyrata.JGI.v1 doesn't look like a valid BSgenome data package

All this to tell you that there seems to be an error in the genome package you are using and the problem is not in your code or karyoploteR's code, 

Now, is there a workaround. Absolutely. The `genome` parameter of `plotKaryotype` also accepts GRanges and BSgenome objects.

Therefore, you can simply load the BSgenome with library and use the object it creates to start your plot:

    library(BSgenome.Alyrata.JGI.v1)
    kp <- plotKaryotype(genome=Alyrata)

Note that `Alyrata` is not quoted, since you are passing in the actual BSgenome object.

This would be useful too for your second question. As far as I know, GTF files are not suposed to contain the genome information but features mapped onto a genome. In any case, If you are able to get the names and lengths of your chromosomes into a BED file (simply a tab separated file with three columns, chr.name, start and end) then you can load it into R (for example using `toGRanges("file.name")`) and use it in the `genome` parameter of `plotKaryotype`.

As @VHahaut said, you can find more information at [https://bernatgel.github.io/karyoploter_tutorial//Tutorial/CustomGenomes/CustomGenomes.html](https://bernatgel.github.io/karyoploter_tutorial//Tutorial/CustomGenomes/CustomGenomes.html).

PS: This answer is copied from the question you've posted in biostars. In general is better if you do not post the same question in both sites.

ADD COMMENT

Login before adding your answer.

Traffic: 862 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