formbio / laava

LAAVA: Long-read AAV Analysis
MIT License
5 stars 0 forks source link

Sporadic error in RepCap plot generation #18

Closed etal closed 1 month ago

etal commented 1 month ago

Originally reported in: https://github.com/Magdoll/AAV/issues/1#issuecomment-1197347769

In report.Rmd, the section that generates RepCap plots will sometimes fail with the error:

Error: Must request at least one colour from a hue palette.

This seems to be due to NA values in the dataframe. To do: figure out why those are occurring and mitigate them.

etal commented 1 month ago

Root cause: the ggplot2 aesthetics attempt to colorize histogram bars by read subtype, but those subtypes are only assigned and meaningful for vector alignments; in repcap, they're all NA so colorization fails.

This error only appears in samples where repcap_name is given, annotation.txt does not include RANGE for repcap (default behavior within LAAVA), and >10 reads are aligned to repcap.

Fix: remove "fill=" from aes().

Workaround: don't provide the repcap_name input.