This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Error ploting with ggbio: Error in min(c(x, xmin), na.rm = TRUE) : invalid 'type' (list) of argument

Hello everyone. I'm a beginner in bioinformatics tool, and recently I started using R and ggbio to graph my genomic data. I used a script that had run well until yesterday when I download the R version 3.5.1 and updated packages.

Now, I try to run my script and this error appears:

Error in min(c(x, xmin), na.rm = TRUE) : invalid 'type' (list) of argument

I don´t know how to solve that error.

How can I solve it?

This is what I have:

>Filename <- "cromosoma.txt"

> datos1 <- read.delim2 (filename, sep = "\t", header = TRUE )

> library (GenomicRanges)
>library (ggbio)

>plot <- GRanges(datos1, seqnames = c(datos1$Cromosoma), strand = NULL,
ranges = IRanges(start = c (datos1$Inicio), end = c(datos1$Fin)))

>seqinfo = (plot)

>head (plot)

GRanges object with 6 ranges and 3 metadata columns:
      seqnames            ranges strand | Cromosoma    Inicio       Fin     Tipo
         <Rle>         <IRanges>  <Rle> | <integer> <integer> <integer> <factor>
  [1]        1   1206795-1209661      * |         1   1206795   1209661        1
  [2]        1   1282655-1285210      * |         1   1282655   1285210        1
  [3]        1 36697173-36701229      * |         1  36697173  36701229       1
  [4]        1 36745980-36754273      * |         1  36745980  36754273       2
  [5]        1 36678915-36683111      * |         1  36678915  36683111       2
  [6]        1 36802140-36804641      * |         1  36802140  36804641       2    

  seqinfo: 10 sequences from an unspecified genome; no seqlengths

>seqlengths(plot) <- c (37320000, 41240000, 36360000, 31930000, 39370000,
26300000, 21610000, 19590000, 38630000, 21820000)

>plot <- renameSeqlevels (plot, paste0("Chr", c(1:10)))

>autoplot(plot, layout = "karyogram", aes(color = Tipo, fill = Tipo))
Error in min(c(x, xmin), na.rm = TRUE) :
 invalid 'type' (list) of argument

Thanks very much

r gene

This is the issue with updated ggplot and old ggbio package. Here is the relevant GitHub issue.

0 answers

No answers yet.

Log in to answer this question.