Biometris / statgenGWAS

See https://biometris.github.io/statgenGWAS for a full description
https://biometris.github.io/statgenGWAS/
12 stars 3 forks source link

Manhattan Plot Error #2

Closed jeremysutherland closed 3 years ago

jeremysutherland commented 3 years ago
> GWAS <- runSingleTraitGwas(gData = gDataDedup,
                           trials = c("NY.2019", "NY.2020", "NJ.2019", "NJ.2020", "PA.2019", "PA.2020"),
                           traits = "Anthracnose",
                           thrType = "fixed",
                           LODThr = 4,
                           GLSMethod = "multi",
                           kinshipMethod = "vanRaden")

> plot(GWAS, plotType = "manhattan", trial = "NY.2019", trait = "Anthracnose") + ggtitle("NY.2019") Error: breaks and labels must have the same length Run rlang::last_error() to see where the error occurred.

> rlang::last_error() <error/rlang_error> breaks and labels must have the same length Backtrace:

  1. graphics::plot(...)
  2. statgenGWAS:::plot.GWAS(...)
  3. ggplot2::scale_x_continuous(...)
  4. ggplot2::continuous_scale(...)
  5. ggplot2:::check_breaks_labels(breaks, labels) Run rlang::last_trace() to see the full context.

> rlang::last_trace() <error/rlang_error> breaks and labels must have the same length Backtrace: █

  1. ├─graphics::plot(...)
  2. └─statgenGWAS:::plot.GWAS(...)
  3. ├─base::do.call(...)
  4. └─(function (xValues, yValues, map, xLab = "Chromosomes", yLab = expression(-log10), ...
  5. └─ggplot2::scale_x_continuous(...)
  6. └─ggplot2::continuous_scale(...)
  7. └─ggplot2:::check_breaks_labels(breaks, labels)
jeremysutherland commented 3 years ago

Resolved: sapply(map, class) SNP.names chr pos "character" "factor" "integer"

map[2] <- lapply(map[2], as.character)

sapply(map, class) SNP.names chr pos "character" "character" "integer"