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

pedigree data file does not contain a field labeled Person or Individual #3

Open
rowan-christie21 opened this issue Jul 20, 2020 · 9 comments

Comments

@rowan-christie21
Copy link

I've been running into an issue where running the Kinship function, I run into this error message.

ArgumentError: The pedigree data file does not contain a field
labeled Person or Individual. One such field is required.

The pedigree file that I used does appear to have a Person field, so I am not sure what could be causing this issue.
Here is the following code I used to run it.

using Pkg
Pkg.add(PackageSpec(url="https://github.com/OpenMendel/MendelKinship.jl.git"))

using MendelKinship

Kinship("control_just_theoretical_29a.txt")

Here is the control_just_theoretical_29a.txt and the pedigree file associated with it.

control_just_theoretical_29a.txt
[Ped29a.in]
(https://github.com/OpenMendel/Tutorials/blob/master/Kinship/Ped29a.in)

Thanks,

Rowan Christie

@biona001 biona001 changed the title Kinship error pedigree data file does not contain a field labeled Person or Individual Jul 20, 2020
@biona001
Copy link
Member

Hi Rowan,

I just tested your code and I cannot reproduce your error on my machine. The first few rows of output is:

julia> using MendelKinship
julia> Kinship("control_just_theoretical_29a.txt")


     Welcome to OpenMendel's
     Kinship analysis option


Reading the data.

The current working directory is "/Users/biona001/Desktop".

Keywords modified by the user:

  control_file = control_just_theoretical_29a.txt
  kinship_output_file = just_theoretical_output.txt
  pedigree_file = Ped29a.in


Analyzing the data.

1833×14 DataFrames.DataFrame. Omitted printing of 1 columns
│ Row  │ Pedigree │ Person1 │ Person2 │ Kinship │ Delta7  │ delta1  │ delta2  │ delta3  │ delta4  │ delta5  │ delta6  │ delta7  │ delta8  │
│      │ String   │ String  │ String  │ Float64 │ Float64 │ Float64 │ Float64 │ Float64 │ Float64 │ Float64 │ Float64 │ Float64 │ Float64 │
├──────┼──────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤
│ 1    │ 1        │ 16      │ 16      │ 0.5     │ 1.0     │ 0.0     │ 0.0     │ 0.0     │ 0.0     │ 0.0     │ 0.0     │ 1.0     │ 0.0     │
│ 2    │ 1        │ 16      │ 17008   │ 0.0     │ 0.0     │ 0.0     │ 0.0     │ 0.0     │ 0.0     │ 0.0     │ 0.0     │ 0.0     │ 0.0     │

Can you remove MendelKinship.jl and MendelBase.jl and try again?

using Pkg
Pkg.rm("MendelBase")
Pkg.rm("MendelKinship")
Pkg.add(PackageSpec(url="https://github.com/OpenMendel/MendelBase.jl.git"))
Pkg.add(PackageSpec(url="https://github.com/OpenMendel/MendelKinship.jl.git"))

@rowan-christie21
Copy link
Author

I removed them, but I still got the same error.


    Welcome to OpenMendel's
    Kinship analysis option


Reading the data.

The current working directory is "C:\Users\smc9227\Documents\BIG Summer\Tutorials-master\Tutorials-master\Kinship".

Keywords modified by the user:

 control_file = control_just_theoretical_29a.txt
 kinship_output_file = just_theoretical_output.txt
 pedigree_file = Ped29a.in

ArgumentError: The pedigree data file does not contain a field
labeled Person or Individual. One such field is required.



Stacktrace:
[1] pedigree_information(::DataFrames.DataFrame) at C:\Users\smc9227\.julia\packages\MendelBase\y8mGn\src\read_data.jl:1309
[2] read_external_data_files(::Dict{AbstractString,Any}) at C:\Users\smc9227\.julia\packages\MendelBase\y8mGn\src\read_data.jl:97
[3] Kinship(::String; args::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{,Tuple{}}}) at C:\Users\smc9227\.julia\packages\MendelKinship\qkdi5\src\MendelKinship.jl:81
[4] Kinship(::String) at C:\Users\smc9227\.julia\packages\MendelKinship\qkdi5\src\MendelKinship.jl:33
[5] top-level scope at In[42]:1

@biona001
Copy link
Member

biona001 commented Jul 20, 2020

This is strange. You have the same MendelKinship (qkdi5) and MendelBase (y8mGn) version as I do, so this is probably an OS problem. Unfortunately, I don't have access to a windows machine.

Do you have access to a Mac or Linux system?

@biona001
Copy link
Member

biona001 commented Jul 28, 2020

I realize this is because names in MendelBase (e.g. this line) actually returns a Vector{String} on windows 10 while on mac it returns a Vector{Symbol}.

I filed JuliaData/DataFrames.jl#2336 to see if they have any long-term solution. Fow now, a quick fix is to change all names() in that file to propertynames(). Let me know if you run into more problems, and I'll leave this issue open until we know how to proceed with DataFrames

@bkamins
Copy link

bkamins commented Jul 28, 2020

The problem is not Win/Mac issue, but that you have a different version of DataFrames.jl installed. Use 0.21 or later where names returns AbstractVector{String}. Earlier versions did not support string indexing, so Symbol was returned.

@biona001
Copy link
Member

biona001 commented Aug 7, 2020

Yes, upon testing @bkamins is correct. Leaving this open until MendelBase resolves this issue.

@fingerfen
Copy link

Hey, I am running into the same problem on my Windows10. I have "DataFrames" => v"0.21.8" installed and still got the same problem as described above. Wondering how @biona001 was able to confirmed that using v0.21 and above of DataFrames was able to solve the problem.

Thanks

@biona001
Copy link
Member

biona001 commented Oct 14, 2020

For now we require DataFrames to be at 0.20 (until MendelBase fixes this problem). You can pin DataFrames to an older version by pressing ] and then:

(@v1.5) pkg> pin DataFrames@v0.20.2

This should resolve the issue. Let me know if you run into problems

@fingerfen
Copy link

Yep! Pinning DataFrame to 0.20.2 resolved the problem for me.

Thank you

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

4 participants