Open hcph opened 1 year ago
I want to know all the targets of TF-TF pairs and to construct an integrated regulatory network. I am new in python, and I find the protocol only tell us how to get the location of one TF pair. Could you please help me to get all pairs locations? Whether you can help, thank you very much for build such wonderful tool to analysis co-occur TFs.
I successfully achieve it by the following commands: i = 0 while i < 167: TF1, TF2 = C.rules.iloc[i, [1,2]] pairs = C.get_pair_locations((TF1, TF2)) pairs.write_bed(str(i)+".bed", fmt="bedpe") i += 1
Hi @hcph ,
Great that you figured it out. For reference to other people as well, here is a full solution using the test data:
from tfcomb import CombObj
C = CombObj()
C.TFBS_from_motifs(regions="../data/GM12878_hg38_chr4_ATAC_peaks.bed",
motifs="../data/HOCOMOCOv11_HUMAN_motifs.txt",
genome="../data/hg38_chr4.fa.gz",
threads=4)
C.market_basket(threads=4)
for i in range(10):
TF1, TF2 = C.rules.iloc[i, [0,1]]
pairs = C.get_pair_locations((TF1, TF2))
pairs.write_bed(f"{TF1}_{TF2}_sites.bedpe", fmt="bedpe")
This will create files called <TF1>_<TF2>_sites.bedpe
for the top 10 co-occurring TF pairs.
I want to know all the targets of TF-TF pairs and to construct an integrated regulatory network. I am new in python, and I find the protocol only tell us how to get the location of one TF pair. Could you please help me to get all pairs locations? Whether you can help, thank you very much for build such wonderful tool to analysis co-occur TFs.