ribosomeprofiling / ribor

R interface for .ribo files
4 stars 1 forks source link

plot_length_distribution does not work with non-integer values #3

Open hakanozadam opened 5 years ago

hakanozadam commented 5 years ago

The following code gives an error

rcounts <- get_length_distribution(ribo.object = alias.ribo,
                                  region      = "CDS",
                                  range.lower = 28,
                                  range.upper = 32)

rcounts$count = log(rcounts$count)
plot_length_distribution(rcounts , fraction = TRUE)

I think this is becuase, typeof(rcounts[[3]]) is "double" after log transformation.

Updating the function check_ld_input should solve the problem.

hakanozadam commented 5 years ago

It would be best if those consistency check functions would accept any type of numerical value that ggplot can take as input, instead of forcing them to be one type.