Entering edit mode
adklts
•
0
@adklts-21974
Last seen 3.7 years ago
Good day. I am trying to convert on the chromosome from bam file to GRobject and the to plot with package HilbertCurve. But I receive an error
> hc = GenomicHilbertCurve(chr = "chr1", background = reads level = 5, reference = TRUE,
Error: unexpected symbol in "hc = GenomicHilbertCurve(chr = "chr1", background = reads level"
> reference_gp = gpar(lty = 1, col = "grey"), arrow = FALSE)
Error: unexpected ',' in " reference_gp = gpar(lty = 1, col = "grey"),"
> hc_segments(hc, g, gp = gpar(lwd = 6, col = rand_color(length(g))))
Error in grid.Call.graphics(C_downviewport, name$name, strict) :
Viewport 'hilbert_curve_0' was not found
My code in the follow
library(chromstaR)
library(GenomicRanges)
library(HilbertCurve)
library(circlize)
bampath <-"C:/Users/Admin/Documents/R/win-library/3.6/GenomicRanges/extdata/wgEncodeUwRepliSeqBg02esG1bAlnRep1.bam"
bam <- bampath
reads <- readBamFileAsGRanges(bam, chromosomes='chr1', pairedEndReads=FALSE,
min.mapq=10, remove.duplicate.reads=TRUE)
hc = GenomicHilbertCurve(chr = "chr1", background = reads level = 5, reference = TRUE,
reference_gp = gpar(lty = 1, col = "grey"), arrow = FALSE)
hc_segments(hc, g, gp = gpar(lwd = 6, col = rand_color(length(g))))
I appreciate very much if you help me to create a Hilbert curve from bam files or to convert bam files to the data frame and then to use in the Hilbert curve package. Thank you!
Thank you very much . But now giving me new error
Error in GenomicHilbertCurve(chr = "chr1", background = reads, level = 5, : Chromosomes cannot be duplicated in background regions.
Value for
background
argument should contain ranges of chromosomes. In your code, I thinkreads
contains the mapped regions that needs to be visualized. Try:Thanks again. We pass the problem of duplicate chromosome but appear Error in .local(object, ...) : unused argument (col = "red")
Sorry, it should be
Giving error
Error in grid.Call.graphics(Cdownviewport, name$name, strict) : Viewport 'hilbertcurve_1' was not found
Solved by installing ellipse package. Thank you very much Zuguang Gu!!!