Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in purrr::map() #15

Open
dollykc opened this issue Jan 6, 2023 · 2 comments
Open

Error in purrr::map() #15

dollykc opened this issue Jan 6, 2023 · 2 comments

Comments

@dollykc
Copy link

dollykc commented Jan 6, 2023

Hi Dr. Gosselin,
I downloaded sticklebacks_Danish.vcf from https://datadryad.org/stash/dataset/doi:10.5061%2Fdryad.kp11q and the strata.stickleback.tsv from https://www.dropbox.com/s/ely3wp4j4tulkrc/strata.stickleback.tsv?dl=0. I executed the following code

library("grur")
ibm <- grur::missing_visualization(
data = "sticklebacks_Danish.vcf",
strata = "strata.stickleback.tsv", parallel.core = 1L)

And I get the following error
Analysing percentage missing ...
Error in purrr::map():
i In index: 1.
Caused by error in env_get():
! object 'term' not found
Run rlang::last_error() to see where the error occurred.
Warning message:
package ‘fstcore’ was built under R version 4.1.3

rlang::last_error()
Backtrace:

  1. grur::missing_visualization(...)
  2. tidyr:::pivot_wider.data.frame(...)
  3. tidyr::build_wider_spec(...)
  4. tidyselect::eval_select(enquo(names_from), data)
  5. tidyselect:::eval_select_impl(...)
  6. tidyselect:::vars_select_eval(...)
  7. tidyselect:::walk_data_tree(expr, data_mask, context_mask)
  8. tidyselect:::eval_sym(expr, data_mask, context_mask)
  9. rlang::env_get(env, name, default = missing_arg(), inherit = TRUE)

I tried again with a dataset of mine from Stacks population output and a popmap turned into a strata file and I got the same result.

The entire output I got is below

################################################################################
######################## grur::missing_visualization ###########################
################################################################################
Execution date/time: 20230106@1055

::grurmissing_visualization function call arguments:
data = sticklebacks_Danish.vcf
strata = strata.stickleback.tsv
strata.select = POP_ID
distance.method = euclidean
ind.missing.geno.threshold = 2, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90
filename = NULL
parallel.core = 1
write.plot = TRUE

Default "..." arguments assigned in ::grurmissing_visualization:
path.folder = NULL

Folder created: missing_visualization_20230106@1055
File written: grur_missing_visualization_data_args_20230106@1055.tsv

Importing data
Found more than one class "Annotated" in cache; using the first, from namespace 'RNeXML'
Also defined by ‘S4Vectors’
Found more than one class "Annotated" in cache; using the first, from namespace 'RNeXML'
Also defined by ‘S4Vectors’
Found more than one class "Annotated" in cache; using the first, from namespace 'RNeXML'
Also defined by ‘S4Vectors’
Found more than one class "Annotated" in cache; using the first, from namespace 'RNeXML'
Also defined by ‘S4Vectors’
Found more than one class "Annotated" in cache; using the first, from namespace 'RNeXML'
Also defined by ‘S4Vectors’
Found more than one class "Annotated" in cache; using the first, from namespace 'RNeXML'
Also defined by ‘S4Vectors’

Reading VCF...

Data summary:
number of samples: 177
number of markers: 31802

Filter monomorphic markers
Number of individuals / strata / chrom / locus / SNP:
Blacklisted: 0 / 0 / 0 / 0 / 0

Filter common markers:
Number of individuals / strata / chrom / locus / SNP:
Blacklisted: 0 / 0 / 0 / 0 / 0

Number of chromosome/contig/scaffold: 196
Number of locus: 17095
Number of markers: 31802
Number of strata: 8
Number of individuals: 177

Number of ind/strata:
HAD = 21
HAL = 19
KIB = 17
KRO = 20
MOS = 20
MAR = 20
NOR = 20
ODD = 40

Number of duplicate id: 0
radiator Genomic Data Structure (GDS) file: radiator_20230106@1055.gds
File written: individuals qc info and stats summary
File written: individuals qc plot

Informations:
Number of populations: 8
Number of individuals: 177
Number of ind/pop:
HAD = 21
HAL = 19
KIB = 17
KRO = 20
MOS = 20
MAR = 20
NOR = 20
ODD = 40

Number of duplicate id: 0
Number of chrom/scaffolds: 196
Number of locus: 17095
Number of SNPs: 31802

Proportion of missing genotypes (overall): 0.022169

Identity-by-missingness (IBM) analysis using
Principal Coordinate Analysis (PCoA)...
fstcore package v0.9.12
(OpenMP detected, using 12 threads)
Generating Identity by missingness plot
Redundancy analysis...
Redundancy Analysis using strata: POP_ID
RDA model formula: data.pcoa$vectors ~ POP_ID
Permutation test for Redundancy Analysis using strata: POP_ID

Hypothesis based on the strata provided
Null Hypothesis (H0): No pattern of missingness in the data between strata
Alternative Hypothesis (H1): Presence of pattern(s) of missingness in the data between strata

A tibble: 1 x 3

STRATA VARIANCE P_VALUE

1 POP_ID 0.00597 0.000999
note: low p-value -> reject the null hypothesis

Analysing percentage missing ...
Error in purrr::map():
i In index: 1.
Caused by error in env_get():
! object 'term' not found
Run rlang::last_error() to see where the error occurred.
Warning message:
package ‘fstcore’ was built under R version 4.1.3

Computation time, overall: 46 sec
############################ missing_visualization #############################

@clorenzo1
Copy link

Hi, I am getting the exact same error when trying to do the same thing with a vcf produced from STACKS2 and a popmap also turned into a strata file. Any updates on this?

Cheers

@thierrygosselin
Copy link
Owner

I'll have a look at it over the weekend thanks for reporting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants