We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can I load data from a .hic file for Compartments and TADs detection?
The text was updated successfully, but these errors were encountered:
Hi, We don't support .hic directly but you have two simple options:
from pytadbit import Chromosome, Experiment cool_file = 'matrix=my_matrix.mcool' exp = Experiment('exp1', hic_data=cool_file, resolution=my_resolution) hic_data = exp.hic_data[0]
and then use the hic_data object to find compartments and tads like in https://3dgenomes.github.io/TADbit/tutorial/tutorial_8-Compartments_and_TADs_detection.html
from pytadbit import HiC_data filename = 'my_matrix.dat' resolution=my_resolution size = int(full_size_in_bp/resolution) my_chroms={'chr_name1':chr_size1_in_bp/resolution,'chr_name2':chr_size2_in_bp/resolution} hic_tup = {int(int(line.split()[0])/resolution)+int(int(line.split()[1])/resolution)*size:int(line.split()[2]) for line in open(filename)} hic_data = HiC_data(hic_tup,size=size,resolution=resolution,chromosomes=my_chroms)
The advantage of option 2 is that is faster than option 1 if you are just interested in a single chromosome.
Regards
Sorry, something went wrong.
Great, thanks!
No branches or pull requests
How can I load data from a .hic file for Compartments and TADs detection?
The text was updated successfully, but these errors were encountered: