Open shenlinyong opened 2 years ago
Sorry for the late response and thank you for your interests!
To align/compare between two domain sets, you first need to read the domain lists of two samples using the readHierDomain
function:
>>> from tadlib.hitad.aligner import *
>>> list1 = readHierDomain('sample1.txt')
>>> list2 = readHierDomain('sample2.txt')
After that, pass the above lists to DomainSet
, which will represent hierarchical domains in trees:
>>> sample1 = DomainSet('sample1', list1, 10000) # supposing your domains were called at the 10kb resolution
>>> sample2 = DomainSet('sample2', list2, 10000)
Finally, perform the alignment using DomainAligner
:
>>> test_align = DomainAligner(sample1, sample2)
>>> test_align.align('sample1', 'sample2')
Different types of domain-level alignments can be then accessed through this object:
>>> conserved = test_align.conserved('sample1', 'sample2') # Conserved TADs
>>> semi = test_align.inner_changed('sample1', 'sample2') # Semi-Conserved TADs
>>> merged = test_align.merged('sample1', 'sample2') # Merged TADs
>>> split = test_align.split('sample1', 'sample2') # Split TADs
Let me know if you have any further questions.
Thank you for developing such great software, I would like to use the class you wrote for
tadlib.hitad.aligner.DomainSet
class to find the difference TAD. However, I don't understand what the phrase "enstr: Unique identifier for input domain set" means, how should I prepare the enstr file for my data, and is the domainlistlist[['chr1', 150000, 360000, 0], ['chr1', 360000, 440000, 0], ['chr1', 440000, 860000, 0], ['chr1', 860000, 1200000, 0], ['chr1', 1200000, 1340000, 2], ['chr1', 1200000, 1590000, 1]]
I prepared correct?This is the python script I ran:
Thanks again for your help!