Giter VIP home page Giter VIP logo

meth5py's People

Contributors

zyndagj avatar

Watchers

 avatar  avatar

meth5py's Issues

Need to flush the output pretty frequently to keep memory usage down

                        H5.create_dataset(chrom, (chrom_len, 6), compression='gzip', compression_opts=6, chunks=(mi
n(chrom_len,100000),6), fillvalue=-1, dtype='i')
                # Skip the first line
                firstLine = IM.readline()
                #chr     pos     strand  context ratio   eff_CT_count    C_count CT_count        rev_G_count     re
v_GA_count    CI_lower        CI_upper
                #test1   14      -       CHG     0.000   1.00    0       1       0       0       0.000   0.793
                for i,line in enumerate(filter(lambda x: x[0] != "#", IM)):
                        tmp = line.split('\t')
                        chrom, pos, strandIndex = (tmp[0], int(tmp[1])-1, self.strands.index(tmp[2]))
                        cIndex = self.contexts.index(tmp[3])
                        c, ct, g, ga = map(int, tmp[6:10])
                        # Set record
                        H5[chrom][pos] = (cIndex, strandIndex, c, ct, g, ga)
                        if i%100 == 0:                                                                             
                                H5.flush()

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.