tfmindi.load_motif_collection#
- tfmindi.load_motif_collection(motif_dir, motif_names=None)#
Load motif collection from directory of .cb files.
Converts motif PWM matrices to PPM (position probability matrix) format.
- Parameters:
- Return type:
- Returns:
dict[tuple[str, str], np.ndarray] Dictionary mapping motif names to PWM matrices (4 x length)
Examples
>>> motifs = load_motif_collection("./motif_collection/") >>> print(list(motifs.keys())) [("filename_1", "motif_1"), ("filename_1", "motif_2"), ("filename_1", "motif_4")] >>> print(motifs[("filename_1", "motif_1")].shape) (4, 12)
>>> # Load only specific motifs >>> selected_motifs = load_motif_collection("./motif_collection/", ["motif1", "motif2"]) >>> print(list(selected_motifs.keys())) ['motif1', 'motif2']