Giter VIP home page Giter VIP logo

hic_data_generator's Introduction

HiC_data_generator

A tf.keras data generator for HiC data

The input files are hiccups looplist and bedpe formatted files. The generator splits the input that into batches and uses pybedtools to extract reads overlapping the loops.
Generates batches of data of shape:
X is a matrix of shape (batch_size) * (radius/binsize2+1) * (radius/binsize2+1)
y is a 2d matrix, each row pertains to one input point from the HICCUPS looplist (and the augmentations if you have used it). Indexes in y are:

  • index0: whether it is a interaction or not (0/1). For the non-interactions set radius to -1 in the input hiccups file.
  • index1: radius of the interaction cluster detected by HICCUPS
    *index2,3: if the row indicates an interaction, second and third indices indicate the center of the interaction cluster as defined by HICCUPS (if it is not an interaction, disregard this indices).
    indices 1,2,3 are normalized between [0-1], i.e. they are based on the location and width within each window.

The main purpose of the class is to use the augmentator. You can specify the augmentation ratio, which will generate downsampled windows of the same size, proportional to the observed HiC count. If random_shifts is disabled, the hiccups cluster center falls at the center of the matrices in X. If random_shifts is set to True, the cluster center randomly moves in the window, and the matrix is completed by taking the first quantile of the diagonals.

To use the capability of in-memory batch generation, remember that you will need to have enough memory to hold the data generated by intersecting "hiccups" loop list with the hic matrix data. This data includes the HiC matrix surrounding the hiccups loops with the given radius. Currently if you are using this option, the hiccups loops have to be on autosomal chromosomes (sex chromosomes are not accepted). Finally, to start utilizing this option, you only need to pass in in_memory=True argument when initializing the data_generator instance (by default this parameter is set to False).

I will have to provide a better documentation later.

hic_data_generator's People

Contributors

armenabnousi avatar

Watchers

James Cloos avatar  avatar

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.