thierrygosselin / radiator

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

genomic_converter() does not work for with plink ,bed files #193

Open Npaffen opened 1 month ago

Npaffen commented 1 month ago

When I try to convert my bed-files to the genind-format the converter fails, stating some column is missing. This looks like to be a problem connected to the strata-format.

genomic_converter(data = "data/merged_array_1kg_hgdp_Rfiltered_maf_pruned_nokins_hwe.bed", output = "genind" ) ################################################################################ ######################### radiator::genomic_converter ########################## ################################################################################ Execution date@time: 20241020@1129 Folder created: -8_radiator_genomic_converter_20241020@1129 Function call and arguments stored in: radiator_genomic_converter_args_20241020@1129.tsv Filters parameters file generated: filters_parameters_20241020@1129.tsv Reading PLINK bed file...ed.file

Data summary: Number of individuals: 8490 Number of markers: 1837423 Error in dplyr::select(): 29.62GB/s, eta: 0s ! Can't select columns that don't exist. ✖ Column INDIVIDUALS doesn't exist. Run rlang::last_trace() to see where the error occurred.

Computation time, overall: 96 sec

Computation time, overall: 96 sec ######################### completed genomic_converter ########################## ✖ Importing data: plink.bed.file [1m 35.9s]

rlang::last_trace() <error/vctrs_error_subscript_oob> Error in dplyr::select(): ! Can't select columns that don't exist. ✖ Column INDIVIDUALS doesn't exist.

Backtrace: ▆

  1. ├─radiator::genomic_converter(...)
  2. │ └─radiator::tidy_genomic_data(...)
  3. │ └─radiator::tidy_plink(...)
  4. │ └─radiator::read_plink(...)
  5. │ └─... %$% strata
  6. ├─base::with(., strata)
  7. ├─radiator::read_strata(strata = .)
  8. │ └─strata %<>% dplyr::select(INDIVIDUALS, STRATA)
  9. ├─dplyr::select(., INDIVIDUALS, STRATA)
  10. └─dplyr:::select.data.frame(., INDIVIDUALS, STRATA) Run rlang::last_trace(drop = FALSE) to see 17 hidden frames.
thierrygosselin commented 2 weeks ago

Try this:

test1 <- radiator::read_plink(data = "data/merged_array_1kg_hgdp_Rfiltered_maf_pruned_nokins_hwe.bed")

Does it read your file correctly ?

Documentation