Git Product home page Git Product logo

libplinkio's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

libplinkio's Issues

How to build

How do you build the C library?
The small blurb in the readme says to run configure, but there is no configure script, only the Makefile.am and .in

THanks

Segmentation fault (core dumped) in Python 3

Hi,

I am trying to do the following in Python:
'plink_obj = WritablePlinkFile(file_prefix,list_of_Samples)'

Then, I get the following error:
'Segmentation fault (core dumped)'

However, when I convert the file down to Python version 2.7 everything works fine. I have the same version of plinkio on both Python 2.7 and 3.5 (plinkio 0.9.7) so I am not quite sure what is happening here. Any help would be appreciated!

Thank you,

Myson

Installing plinkio on Windows machine

Pip does not install plinkio on Windows machine, apparently because C dependencies ("strings.h", "unistd.h","ansi.h") are not satisfied.

What needs to be done so that plinkio can be installed on a windows machine?

Instructions for static linkage of libplinkio

I would like to link libplinkio statically with my application. Do you have some instructions how to compile libplinkio into a static library? I'm not quite familiar with ./configure system - it might be an easy task...

Error in opening bim file

Hi!

The description of the problem is rather long and it just shows that I don't even know where is the error. In short, I am trying to run LDpred program that relies on plinkio to open .bed and .bim files. But I keep getting the following message, which I managed to trace to plinkio package.

OSError: Error while trying to open the BIM plink file

I have plinkio version 0.9.7 installed and I ran only these two codes: from plinkio import plinkfile and plinkfile.open("input_genetic_file"). I specify input_genetic_file without extensions. If I provide an extension (either .bim, .fam or .bed), the error message changes from "BIM" to "BED" plink file. The genetic files are valid as I am able to work with them using the command line PLINK.

I have been working with LDpred back in April and I did not have any of these problems back then. So, one thing I tried to do was to install a version of plinkio from Jan 22, 2019 (0.9.5 or 0.9.4). I failed to install version 0.9.4 due to some error with gcc. With 0.9.5 version, I cannot import the package in python as the following error is displayed:

Traceback (most recent call last):
File "", line 1, in
File "/home/rustich0/njandaro/.local/lib/python3.6/site-packages/plinkio/plinkfile.py", line 1, in
from . import cplinkio
ImportError: /home/rustich0/njandaro/.local/lib/python3.6/site-packages/plinkio/cplinkio.cpython-36m-x86_64-linux-gnu.so: undefined symbol: PyInt_AsLong

Any comment on the issue would be appreciated since I couldn't find much googling.

Thank you!

plinkfile import error due to GLIBC.214

Hi
I have been succesfully able to install plinkio on the server. However, when I import plinkfile, I get import error from cplinkio - glibc2.14 (see error below). How do I proceed with it ?

import ldpred
import plinkio
from plinkio import plinkfile
Traceback (most recent call last):
File "", line 1, in
File "/nv/hp10/snagpal3/.conda/envs/ldpred/lib/python3.6/site-packages/plinkio/plinkfile.py", line 1, in
from . import cplinkio
ImportError: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /nv/hp10/snagpal3/.conda/envs/ldpred/lib/python3.6/site-packages/plinkio/cplinkio.cpython-36m-x86_64-linux-gnu.so)

On running the command below, it shows that I have GLIBC on my system:
strings /lib64/libc.so.6|grep GLIBC
GLIBC_2.2.5
GLIBC_2.2.6
GLIBC_2.3
GLIBC_2.3.2
GLIBC_2.3.3
GLIBC_2.3.4
GLIBC_2.4
GLIBC_2.5
GLIBC_2.6
GLIBC_2.7
GLIBC_2.8
GLIBC_2.9
GLIBC_2.10
GLIBC_2.11
GLIBC_2.12
GLIBC_PRIVATE

Thanks

Memory leak?

Hi,

I am processing large number of plink files, with significant number of loci and individuals (5000000 x 1000). I am having some memory issues with plinkio, that the memory is not being cleared
after parsing/closing the file.

I managed to reproduce this on a minimal example

from plinkio import plinkfile
from memory_profiler import profile
@profile
def main():
    """docstring for main"""
    for i in xrange(100):
        plink_file = plinkfile.open("temp_ref")
        plink_file.close()
main()

This repeated reading of the temp_ref data set (10000 gts. x 230 individuals), ends
up in 236.3 Mib. This scales up linearly with the number of iterations.

Line #    Mem usage    Increment   Line Contents
================================================
     3      9.2 MiB      0.0 MiB   @profile
     4                             def main():
     5                                 """docstring for main"""
     6    245.5 MiB    236.3 MiB       for i in xrange(100):
     7    245.5 MiB      0.0 MiB           plink_file = plinkfile.open("temp_ref")
     8    245.5 MiB     -0.0 MiB           plink_file.close()

Do you have any workaround for this? Or suggestions where the memory leak is?

Thanks by the way for making this code public, it is has been really useful for me.

Best,
Hákon

FAM file parsing: Relation between phenotype and affection

We used as input a FAM file with 6 columns that are the following:
IID, FID, Mother ID, FatherID, Sex, Phenotype.
The latter, phenotype, is represented by 1 (controls), 2(cases), and -9 (missing) in according to PLINK documentation.

Once processed by plinkf.get_samples(), the output file we got has two properties that are:
Phenotype and affection.
Affection represents the original phenotype column of the FAM input file (with case =1, control = 0, missing = -9)
The phenotype property has values 0 and 1. How does phenotype property correlate with Affection? and How is phenotype property generated?

Thank you in advance for your reply

plinkio/plinkio.h file not found

Hello,

I am trying to build the bed2diffs program to convert from bed to a genetic dissimilarity matrix.

I installed plinkio with pip

pip install plinkio

I tried with versions 0.9.6, 0.9.7 and 0.9.8, to ensure this wasn't a version specific error.

this is what the plinkio folder looks like after installation

Screen Shot 2024-04-30 at 2 15 14 pm

This is what the dist-info folder looks like
Screen Shot 2024-04-30 at 2 15 01 pm

This is the output of pip show plinkio
Screen Shot 2024-04-30 at 2 20 14 pm

I modified the makefile for bed2diffs accordingly:
Screen Shot 2024-04-30 at 2 20 51 pm

But when I try to do make darwin i get the following error:
Screen Shot 2024-04-30 at 2 14 41 pm

I cannot see the plinkio.sh file anywhere, thus I assumed this is an issue with my plinkio installation, hence why i posted here and not on the bed2diffs github. Please correct me if I am wrong.

Kind regards,
Lorenzo

Memory leak when writing plink files via the Python interface

Hi,

Thanks for writing this neat little package!

I noticed that if I repeatedly create, write and close lots of identical plink (bed) files consecutively, via the python interface, the memory increases usage blows up, suggesting that the actual genotypes are copied and kept in memory.

Can't install plinkio on RHEL

Hello!

I've been trying to install plinkio and used the command pip install plinkio. But it throws an error message "command 'gcc' failed with exit status 1". I made sure gcc is installed and upgraded both pip and setuptools. The current version of installed pip is 10.0.1. I have python 2.7.

I would appreciate any help!

Thank you!

[request] Publish the module to anaconda

Anaconda is such a good package manager for scientific research and I would love to see your great work published to it. And it seems that others have posted outdated versions of the module on it.

undefined symbol: PyInt_AsLong

I compiled and installed with the "pip3 --install --user plinkio" command. However, when I try the command "from plinkio import plinkfile" I receive the error "/home/########/.local/lib/python3.4/site-packages/plinkio/cplinkio.cpython-34m.so: undefined symbol: PyInt_AsLong". The problem does not exist using python 2.7.9.

Error in importing plinkfile

Hi I was trying to work with this in Python.
I installed it using pip (as instructed in the Readme) and then tried to run the sample python code provided. However when I try to import plinkfile it is giving me this following error:
ImportError: /home/bose6/.local/lib/python2.7/site-packages/plinkio/cplinkio.so: undefined symbol: _intel_fast_memcpy

Do I have to configure anything else? Any help is appreciated.

Cannot install libplinkio on Windows

I am following page 385 of the book "An introduction to statistical genetic data analysis" to install the package libplinkio using the code pip install plinkio. Here is my code and what I was returned in Win 10 cmd:

C:\Users\Patrick Wen>pip install plinkio
Collecting plinkio
  Using cached plinkio-0.9.8.tar.gz (34 kB)
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: plinkio
  Building wheel for plinkio (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [14 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-3.10
      creating build\lib.win-amd64-3.10\plinkio
      copying py-plinkio\plinkio\plinkfile.py -> build\lib.win-amd64-3.10\plinkio
      copying py-plinkio\plinkio\__init__.py -> build\lib.win-amd64-3.10\plinkio
      creating build\lib.win-amd64-3.10\tests
      copying py-plinkio\tests\write_test.py -> build\lib.win-amd64-3.10\tests
      copying py-plinkio\tests\__init__.py -> build\lib.win-amd64-3.10\tests
      running build_ext
      building 'plinkio.cplinkio' extension
      error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for plinkio
  Running setup.py clean for plinkio
Failed to build plinkio
Installing collected packages: plinkio
  Running setup.py install for plinkio ... error
  error: subprocess-exited-with-error

  × Running setup.py install for plinkio did not run successfully.
  │ exit code: 1
  ╰─> [14 lines of output]
      running install
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-3.10
      creating build\lib.win-amd64-3.10\plinkio
      copying py-plinkio\plinkio\plinkfile.py -> build\lib.win-amd64-3.10\plinkio
      copying py-plinkio\plinkio\__init__.py -> build\lib.win-amd64-3.10\plinkio
      creating build\lib.win-amd64-3.10\tests
      copying py-plinkio\tests\write_test.py -> build\lib.win-amd64-3.10\tests
      copying py-plinkio\tests\__init__.py -> build\lib.win-amd64-3.10\tests
      running build_ext
      building 'plinkio.cplinkio' extension
      error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> plinkio

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

Any idea why the error? I have install the wheel package.

Add support for extra-chroms (string chromosomes)

Dear all,
I don't know if it possible or easy to implement at the current state of art of this library: will be possible to add support for the plink --allow-extra-chr option (more precisely deal with string chromosome like X,Y,Contig123456)? I saw in src/bim_parse.c that the chromosome field is converted in a integer value: will be sufficent to change this line and all the other chromosome declaration in code?
Many thanks

Fam file containing character phenotypes

If the fam file contain character phenotypes or contains solely of NA, libplinkio will return the following error message:

IOError: Error while trying to open the FAM plink file.

Will it be possible for one to read in this kind of FAM file? Providing that the users are also submitting a phenotype file.

compiler seems not recognize the variables declared in plinkio.h

I tried to install the C++ source and then use it with #include <plinkio/plinkio.h>. However, I found that the compiler does not recognize the variables declared in plinkio.h, errors are showed as following:

undefined reference to 'pio_open'
undefined reference to 'pio_one_locus_per_row'
undefined reference to 'pio_row_size'
undefined reference to 'pio_next_row'
undefined reference to 'pio_num_samples'
undefined reference to 'pio_get_sample'
undefined reference to 'pio_get_locus'
undefined reference to 'pio_close'

Could you please suggest a solution?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.