Coder Social home page Coder Social logo

paulsengroup / hictkpy Goto Github PK

View Code? Open in Web Editor NEW
7.0 2.0 0.0 27.17 MB

Python bindings for hictk: read and write .cool and .hic files directly from Python

License: MIT License

CMake 29.84% Python 15.20% C++ 54.96%
bindings bioinformatics cooler hic hictk python3

hictkpy's Introduction

hictkpy

License CI Download from Bioconda docs Zenodo DOI

Python bindings for hictk, a blazing fast toolkit to work with .hic and .cool files.

Installing hictkpy

hictkpy can be installed in various ways. The simples method is using pip: pip install hictkpy.

Refer to Installation for alternative methods.

Using hictkpy

import hictkpy

path_to_clr = "file.mcool"  # "file.hic"

clr = hictkpy.File(path_to_clr, 100_000)
sel = clr.fetch("chr1")

df = sel.to_df()     # Get interactions as a pd.DataFrame
m1 = sel.to_numpy()  # Get interactions as a numpy matrix
m2 = sel.to_coo()    # Get interactions as a scipy.sparse.coo_matrix

For more detailed examples refer to Quickstart.

The complete documentation for hictkpy API is available here.

Citing

If you use hictkpy in you reaserch, please cite the following publication:

Roberto Rossini, Jonas Paulsen hictk: blazing fast toolkit to work with .hic and .cool files. bioRxiv 2023.11.26.568707. https://doi.org/10.1101/2023.11.26.568707

BibTex
@article {hictk,
	author = {Roberto Rossini and Jonas Paulsen},
	title = {hictk: blazing fast toolkit to work with .hic and .cool files},
	elocation-id = {2023.11.26.568707},
	year = {2023},
	doi = {10.1101/2023.11.26.568707},
	publisher = {Cold Spring Harbor Laboratory},
	URL = {https://www.biorxiv.org/content/early/2023/11/27/2023.11.26.568707},
	eprint = {https://www.biorxiv.org/content/early/2023/11/27/2023.11.26.568707.full.pdf},
	journal = {bioRxiv}
}

hictkpy's People

Contributors

dependabot[bot] avatar robomics avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

hictkpy's Issues

Review cooler attribute handling

TODOs:

  • Use dash in cooler attribute names
  • Ensure missing values are handled properly (e.g. missing bin-type implies bin-type=fixed

[bug] query mirroring is not always correct

Fix mirroring logic for queries like fetch("4:0-987474", "4:0-920561").to_df(), where the start position is the same, but the end position it is not (and the end position of the first set of coordinates is greater than the second one).

This bug was uncovered by the fuzzy tests run as part of hictk's CI, see paulsengroup/hictk#173.

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.