robinweide / GENOVA

GENome Organisation Visual Analytics
GNU General Public License v3.0
68 stars 15 forks source link

Importing data from .hic and pyramid plot #335

Open ionas23 opened 1 year ago

ionas23 commented 1 year ago

Hello! I have a problem making pyramid plots.

I am loading the contacts using a large .hic file (33 GB):

Bonev_ESC_hic <- load_contacts(signal_path = '.../ES_mapq30.hic',
sample_name = "ESC",
resolution = 10e3,
balancing = 'KR', # this is the default
colour = "black")

But when I try to make a pyramid plot using this code

pyramid(exp = Bonev_ESC_hic,
chrom = 'chr7',
start = 5e6,
end=5.1e6,
colour = c(0, 50))

I get this error:

Warning message in min(x):
“no non-missing arguments to min; returning Inf”
Warning message in max(x):
“no non-missing arguments to max; returning -Inf”
Error in if (head(edge$y, 1) != 0) {: missing value where TRUE/FALSE needed
Traceback:

1. pyramid(exp = Bonev_ESC_hic, chrom = "chr7", start = 5e+06, end = 5100000, 
 .     colour = c(0, 50))
2. pyramid.contacts(exp = Bonev_ESC_hic, chrom = "chr7", start = 5e+06, 
 .     end = 5100000, colour = c(0, 50))
3. pyramid(y, colour = colour, ...)
4. pyramid.contacts_matrix(y, colour = colour, ...)
5. .core_pyramid(x = rowcoord[as.vector(row(exp$z))], y = colcoord[as.vector(col(exp$z))], 
 .     z = as.vector(exp$z), location = location, resolution = res, 
 .     ...)
6. .build_triangle_edge(edge, location, crop_x, crop_y)

Any help would be appreciated! Thanks!

teunbrand commented 1 year ago

Does using pyramid(..., edge = NULL) help in any fashion?

ionas23 commented 1 year ago

I forgot to mention that when I load contacts, I get

Reading data...

and then nothing else,

When I use pyramid(..., edge = NULL) I get this error

Warning message in min(x): “no non-missing arguments to min; returning Inf” Warning message in max(x): “no non-missing arguments to max; returning -Inf” Warning message in min(x): “no non-missing arguments to min; returning Inf” Warning message in max(x): “no non-missing arguments to max; returning -Inf” Warning message in min(x): “no non-missing arguments to min; returning Inf” Warning message in max(x): “no non-missing arguments to max; returning -Inf” Warning message in min(x): “no non-missing arguments to min; returning Inf” Warning message in max(x): “no non-missing arguments to max; returning -Inf” ERROR while rich displaying an object: Error in combine_vars(): ! Faceting variables must have at least one value

Traceback:

  1. tryCatch(withCallingHandlers({ . if (!mime %in% names(repr::mime2repr)) . stop("No repr_* for mimetype ", mime, " in repr::mime2repr") . rpr <- repr::mime2repr[mime] . if (is.null(rpr)) . return(NULL) . prepare_content(is.raw(rpr), rpr) . }, error = error_handler), error = outer_handler)
  2. tryCatchList(expr, classes, parentenv, handlers)
  3. tryCatchOne(expr, names, parentenv, handlers[[1L]])
  4. doTryCatch(return(expr), name, parentenv, handler)
  5. withCallingHandlers({ . if (!mime %in% names(repr::mime2repr)) . stop("No repr_* for mimetype ", mime, " in repr::mime2repr") . rpr <- repr::mime2repr[mime] . if (is.null(rpr)) . return(NULL) . prepare_content(is.raw(rpr), rpr) . }, error = error_handler)
  6. repr::mime2repr[mime]
  7. repr_text.default(obj)
  8. paste(capture.output(print(obj)), collapse = "\n")
  9. capture.output(print(obj))
  10. withVisible(...elt(i))
  11. print(obj)
  12. print.ggplot(obj)
  13. ggplot_build(x)
  14. ggplot_build.ggplot(x)
  15. layout$setup(data, plot$data, plot$plot_env)
  16. setup(..., self = self)
  17. self$facet$compute_layout(data, self$facet_params)
  18. compute_layout(..., self = self)
  19. combine_vars(data, params$plot_env, rows, drop = params$drop)
  20. cli::cli_abort("Faceting variables must have at least one value")
  21. rlang::abort(message, ..., call = call, use_cli_format = TRUE, . .frame = .frame)
  22. signal_abort(cnd, .file) Error in file(con, "rb"): cannot open the connection Traceback: plot without title