Giter Club home page Giter Club logo

snpy's Introduction

   _____ _   _ _____
  / ____| \ | |  __ \
 | (___ |  \| | |__) |   _
  \___ \| . ` |  ___/ | | |
  ____) | |\  | |   | |_| |
 |_____/|_| \_|_|    \__, |
                      __/ |
                     |___/

An easy to use wrapper-library for working with openSNP data. The current implementation only supports local or downloaded files, but JSON API interaction is planned.

All you need to remember at this point is a single function:

>>> import sn
>>> snps = sn.parse("72.ftdna-illumina.36")
>>> sns
>>> snps[:1]
[_SNP(name='rs3094315', variation=None, chromosome='1', position=742429, strand=None, genotype='AA')]

snpy's People

Contributors

arvkevi avatar superbobry avatar

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

snpy's Issues

VCF Files

HI ,

I downloaded the last version of the bulk of openSNP.
It's actually 4700 files of raw data from various companies.
I tested your library with all the openSNP file and they're is some file with
I tested them with python 3.7.

user6020_file4548_yearofbirth_unknown_sex_unknown.ancestry.txt

I also installed pyVCF parser

Here the Traceback outputed by python using a file of one user:


user6020_file4548_yearofbirth_unknown_sex_unknown.ancestry.txt

Traceback (most recent call last):
  File "/home/yoan/Bureau/ADN/openSNP_rawdata/opensnp_datadump.current/parser.py", line 13, in <module>
    for i in snps:
  File "/usr/local/lib/python3.7/dist-packages/sn.py", line 78, in _23andme_ancestry
    for row in handle:
  File "/usr/lib/python3.7/csv.py", line 112, in __next__
    row = next(self.reader)
  File "/usr/lib/python3.7/codecs.py", line 322, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xbb in position 12: invalid start byte

the code:

import sn
import os

folder_content = os.listdir(os.getcwd())
for i in folder_content:
    print(i)
    if os.path.isfile(i):
        #try:
        snps = sn.parse(i)
        cpt = 0
        for i in snps:
            print(i)
            cpt += 1
            if cpt == 10:
                break

Thanks in advance for our help !

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.