thierrygosselin / radiator

RADseq Data Exploration, Manipulation and Visualization using R
https://thierrygosselin.github.io/radiator/
GNU General Public License v3.0
58 stars 23 forks source link

Errors with creating tibbles when using genomic_converter #127

Closed andemexoax closed 3 years ago

andemexoax commented 3 years ago

In attempting to convert a vcf file (created by freebayes) to genepop file the following error pops up. Using RStudio on windows 10. It looks like everything is fine up until it says

Genotypes formats generated with 1052 SNPs: 
    GT_BIN (the dosage of ALT allele: 0, 1, 2 NA): TRUE
    GT_VCF (the genotype coding VCFs: 0/0, 0/1, 1/1, ./.): TRUE
    GT_VCF_NUC (the genotype coding in VCFs, but with nucleotides: A/C, ./.): TRUE
    GT (the genotype coding 'a la genepop': 001002, 001001, 000000): TRUE
Error: All columns in a tibble must be vectors.
x Column `GQ` is a `SeqVarDataList` object.

The same issue happens with tidy_vcf. After I deleted the GQ line in the header(there was no GQ info in the rest of the file), the following error popped up when using tidy_vcf,

Parsing and tidying genotypes metadata: GL, DP
DP column: cleaning and renaming to READ_DEPTH
GL column: cleaning Genotype Likelihood column
Error: Can't recycle `ID_SEQ` (size 41028) to match `GL_HOM_REF` (size 44889).
Run `rlang::last_error()` to see where the error occurred.
In addition: Warning message:
In if (gl > 0) { :
  the condition has length > 1 and only the first element will be used

Here is the traceback

> rlang::last_trace()
<error/vctrs_error_incompatible_size>
Can't recycle `ID_SEQ` (size 41028) to match `GL_HOM_REF` (size 44889).
Backtrace:
    x
 1. +-radiator::tidy_vcf(...)
 2. | \-radiator::parse_gds_metadata(...)
 3. |   \-res %<>% purrr::flatten_dfc(.)
 4. +-purrr::flatten_dfc(.)
 5. | \-dplyr::bind_cols(res)
 6. |   \-vctrs::vec_cbind(!!!dots, .name_repair = .name_repair)
 7. \-vctrs::stop_incompatible_size(...)
 8.   \-vctrs:::stop_incompatible(...)
 9.     \-vctrs:::stop_vctrs(...)
thierrygosselin commented 3 years ago

should work with latest release