stianlagstad / chimeraviz

chimeraviz is an R package that automates the creation of chimeric RNA visualizations.
36 stars 14 forks source link

2 question with chimeraviz #94

Closed yubau1112 closed 2 years ago

yubau1112 commented 2 years ago

My R Command:

if (!require("BiocManager", quietly = TRUE))
  install.packages("BiocManager")

# The following initializes usage of Bioc devel
BiocManager::install(version='devel')

BiocManager::install("chimeraviz")

library(chimeraviz)
library(RCircos)

starfusionData <- system.file(
  "extdata",
  "star-fusion.fusion_candidates.final.abridged.txt",
  package = "chimeraviz")
fusions <- import_starfusion(starfusionData, "hg19", 3)

length(fusions)

plot_fusion(
  fusions,
  edb = NULL,
  bamfile = NULL,
  which_transcripts = "exonBoundary",
  ylim = c(0, 1000),
  non_ucsc = TRUE,
  reduce_transcripts = FALSE,
  bedgraphfile = NULL
)

plot_circle(fusions)

create_fusion_report(fusions, "output.html")

I got results Info:

> plot_fusion(
+   fusions,
+   edb = NULL,
+   bamfile = NULL,
+   which_transcripts = "exonBoundary",
+   ylim = c(0, 1000),
+   non_ucsc = TRUE,
+   reduce_transcripts = FALSE,
+   bedgraphfile = NULL
+ )
Error in h(simpleError(msg, call)) : 
  在為 'isEmpty' 函式選擇方法時評估 'x' 引數發生錯誤: trying to get slot "gene_upstream" from an object of a basic class ("list") with no slots 
> 
> plot_circle(fusions)

RCircos.Core.Components initialized.
Type ?RCircos.Reset.Plot.Parameters to see how to modify the core components.

Not all labels will be plotted.
Type RCircos.Get.Gene.Name.Plot.Parameters()
to see the number of labels for each chromosome.
Not all labels will be plotted.
Type RCircos.Get.Gene.Name.Plot.Parameters()
to see the number of labels for each chromosome.
> 
> create_fusion_report(fusions, "output.html")

RCircos.Core.Components initialized.
Type ?RCircos.Reset.Plot.Parameters to see how to modify the core components.

Not all labels will be plotted.
Type RCircos.Get.Gene.Name.Plot.Parameters()
to see the number of labels for each chromosome.
Not all labels will be plotted.
Type RCircos.Get.Gene.Name.Plot.Parameters()
to see the number of labels for each chromosome.

Although I have got the figure, but I have 2 question:

question1:

Error in h(simpleError(msg, call)) : 在為 'isEmpty' 函式選擇方法時評估 'x' 引數發生錯誤: trying to get slot "gene_upstream" from an object of a basic class ("list") with no slots

How to solve that?

question2:

I have 300 fusions, I want all fusion plot into figure, but It's said "Not all labels will be plotted.".

I try

params <- RCircos.Get.Plot.Parameters() #$char.width
params$char.width <- 100 #default 500
RCircos.Reset.Plot.Parameters(params)

#the maxLabels are updated accordingly
RCircos.Get.Gene.Name.Plot.Parameters()

but results not change

How to solve that?

Thanks so mach!

yubau

stianlagstad commented 2 years ago

Hi @yubau1112 ! Thanks for posting here. This is difficult for me to figure out without the data in question. Are you able to share the file star-fusion.fusion_candidates.final.abridged.txt, so that i can try to reproduce the error on my end?

yubau1112 commented 2 years ago

Hi, thanks for your reply.

When you install chimeraviz, star-fusion.fusion_candidates.final.abridged.txt this file was automatically downloaded into C:\Users\yu_ba\Documents\R\win-library\4.1\chimeraviz\extdata by it's self, that is provide from chimeraviz not my data.

I also upload the file here. star-fusion.fusion_candidates.final.abridged.txt

And I change rstudio language into English, the error message is:

Error in h(simpleError(msg, call)) : 
  error in evaluating the argument 'x' in selecting a method for function 'isEmpty': trying to get slot "gene_upstream" from an object of a basic class ("list") with no slots

thanks!

yubau

stianlagstad commented 2 years ago

Thanks @yubau1112 ! :)

Question 1

The problem with this:

plot_fusion(
  fusions,
  edb = NULL,
  bamfile = NULL,
  which_transcripts = "exonBoundary",
  ylim = c(0, 1000),
  non_ucsc = TRUE,
  reduce_transcripts = FALSE,
  bedgraphfile = NULL
)

Is that you're passing a list (fusions) as the first argument. This function expects a single fusion object. Try this instead:

plot_fusion(
  fusion[[1]],
  edb = NULL,
  bamfile = NULL,
  which_transcripts = "exonBoundary",
  ylim = c(0, 1000),
  non_ucsc = TRUE,
  reduce_transcripts = FALSE,
  bedgraphfile = NULL
)

That will give you another error, since you don't provie an edb object. Please see section 3.3.1.2 2. "Create an ensembldb object" from the package vignette for more information on that: https://bioconductor.org/packages/release/bioc/vignettes/chimeraviz/inst/doc/chimeraviz-vignette.html

Question 2

I'm not sure about this one. It looks like you already found https://bioinformatics.stackexchange.com/questions/13935/how-to-fit-all-genes-labels-in-chromosome-ideogram-plot-made-by-rcircos-packag, and I can't help any further. Perhaps you can take a closer look at the source code of RCircos itself. I found the error message here: https://github.com/hzhanghenry/RCircos/blob/185edece54f841042e5c2feb0e04d61f21bad04b/R/RCircosPlotPositions.R#L391.

I'll close this, but feel free to ask further questions :)