OpenMendel / MendelKinship.jl

This analysis option computes kinship and other identity coefficients.
MIT License
1 stars 1 forks source link

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

Open rowan-christie21 opened 4 years ago

rowan-christie21 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 https://github.com/JuliaData/DataFrames.jl/issues/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 commented 4 years ago

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 commented 4 years ago

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

fingerfen commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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

Thank you