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

fitdiscrete error with new String7 from CSV #205

Closed
crsl4 opened this issue Nov 7, 2023 · 1 comment
Closed

fitdiscrete error with new String7 from CSV #205

crsl4 opened this issue Nov 7, 2023 · 1 comment

Comments

@crsl4
Copy link
Member

crsl4 commented Nov 7, 2023

If you read the trait data with CSV.read, it automatically makes the strings String7 type, which throws an error when running fitdiscrete:

julia> s1 = fitdiscrete(net1, :ERSM, species, df; optimizeQ=false)
ERROR: MethodError: no method matching fitdiscrete(::HybridNetwork, ::Symbol, ::Vector{String7}, ::DataFrame; optimizeQ::Bool)

Closest candidates are:
  fitdiscrete(::HybridNetwork, ::Symbol, ::Array{String}, ::DataFrame) got unsupported keyword argument "optimizeQ"
   @ PhyloNetworks ~/.julia/packages/PhyloNetworks/Upx5A/src/traitsLikDiscrete.jl:467
  fitdiscrete(::HybridNetwork, ::Symbol, ::Array{String}, ::DataFrame, ::Any; kwargs...)
   @ PhyloNetworks ~/.julia/packages/PhyloNetworks/Upx5A/src/traitsLikDiscrete.jl:467
  fitdiscrete(::HybridNetwork, ::PhyloNetworks.SubstitutionModel, ::RateVariationAcrossSites, ::DataFrame; kwargs...)
   @ PhyloNetworks ~/.julia/packages/PhyloNetworks/Upx5A/src/traitsLikDiscrete.jl:433
  ...

Stacktrace:
 [1] top-level scope
   @ REPL[69]:1

julia> typeof(species)
Vector{String7} (alias for Array{String7, 1})

In here, they provide a solution when reading the data frame (use stringtype=String), but they also suggest using AbstractString rather than String in the definition of the function.

@cecileane
Copy link
Member

Do you have a reproducible example? I can't reproduce the error you got.

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

2 participants