Coder Social home page Coder Social logo

Comments (5)

stianlagstad avatar stianlagstad commented on July 20, 2024

The first issue is that there's not enough rom on the screen to actually show you all the nucleotides. You can limit the amount of nucleotides with the nucleotideAmount parameter - that'll let you experiment a bit and find the limit. Try setting it to 10 to start, and also set showAllNucleotides to FALSE.

plotFusionReads(fusion = fusion, showAllNucleotides = FALSE, nucleotideAmount = 10)

rplot


I reproduced the second issue this morning on a mac at work. For some reason it draws the arc outside of the actual plot. But it seems to be a mac-specific problem. I'm not able to reproduce the error with my home laptop running Ubuntu. This code:

library(chimeraviz)
if(!exists("defuse833ke"))
  defuse833ke <- system.file(
    "extdata",
    "defuse_833ke_results.filtered.tsv",
    package = "chimeraviz")

# Then load the fusion events
fusions <- importDefuse(defuse833ke, "hg19", 1)
fusion <- getFusionById(fusions, 5267)
if(!exists("edbSqliteFile"))
  edbSqliteFile <- system.file(
    "extdata",
    "Homo_sapiens.GRCh37.74.sqlite",
    package="chimeraviz")
# Then load it
edb <- ensembldb::EnsDb(edbSqliteFile)

if(!exists("fusion5267and11759reads"))
  fusion5267and11759reads <- system.file(
    "extdata",
    "fusion5267and11759reads.bam",
    package = "chimeraviz")

if(!exists("bamfile5267")) {
  bamfile5267 <- system.file(
    "extdata",
    "5267readsAligned.bam",
    package="chimeraviz")
}

plotFusion(
  fusion = fusion,
  bamfile = bamfile5267,
  edb = edb,
  nonUCSC = TRUE,
  reduceTranscripts = TRUE)

Produces this plot for me:
rplot

Edit: Back on the mac, that same code produces this plot:
rplot

I'll look into this as soon as I can!

from chimeraviz.

stianlagstad avatar stianlagstad commented on July 20, 2024

Just to show a sign of life: So far I'm clueless. In the plotFusion function I use Gviz::coords() to fetch the coordinates of where the exons are plotted in the picture. I use these to decide where to draw the red arc. For some reason the y coordinates those code lines returns on a mac are off. I don't know why yet. I don't really think it's a Gviz issue.

Relevant chimeraviz code from plotFusion.R:

    # Get coordinates for the exons in the plot
    exonCoordinates1 <- Gviz::coords(res1$GeneRegionTrack)
    exonCoordinates2 <- Gviz::coords(res2$GeneRegionTrack)

from chimeraviz.

stianlagstad avatar stianlagstad commented on July 20, 2024

After getting some help on the bioc-devel list I got a bit further. The arc turns up where it's supposed to when I use another graphics device. Could you try that as well? I.e. try:

# Load data and example fusion event
defuse833ke <- system.file(
  "extdata",
  "defuse_833ke_results.filtered.tsv",
  package="chimeraviz")
fusions <- importDefuse(defuse833ke, "hg19", 1)
fusion <- getFusionById(fusions, 5267)
# Load edb
edbSqliteFile <- system.file(
  "extdata",
  "Homo_sapiens.GRCh37.74.sqlite",
  package="chimeraviz")
edb <- ensembldb::EnsDb(edbSqliteFile)
# bamfile with reads in the regions of this fusion event
bamfile5267 <- system.file(
  "extdata",
  "fusion5267and11759reads.bam",
  package="chimeraviz")
# Temporary file to store the plot
pngFilename <- "testplot.png"
# Open device
png(pngFilename, width = 1000, height = 750)
# Plot!
plotFusion(
  fusion = fusion,
  bamfile = bamfile5267,
  edb = edb,
  nonUCSC = TRUE)
# Close device
dev.off()

and then see what testplot.png looks like?

from chimeraviz.

komalsrathi avatar komalsrathi commented on July 20, 2024

Yes this works for me -- thanks! I am testing the entire code now and will update you on it.

testplot

Thanks a lot!

from chimeraviz.

stianlagstad avatar stianlagstad commented on July 20, 2024

Great! I'll look more into the default graphics driver on mac and try to figure out the issue. But I'll close this :)

from chimeraviz.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.