-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
27652cf
commit 4b852a5
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env python | ||
|
||
import os | ||
import sys | ||
import re | ||
|
||
# Defaults | ||
out_dir = os.path.dirname(os.path.realpath(__file__)) | ||
root_dir = os.path.join(out_dir, os.pardir) | ||
|
||
# Append JASPAR-profile-inference to path | ||
sys.path.append(root_dir) | ||
|
||
# Import globals | ||
from __init__ import Jglobals, CisBP2Pfam, ReadSRModel | ||
|
||
cisbp = {} | ||
|
||
for json_file in os.listdir("cisbp"): | ||
model = ReadSRModel(os.path.join("cisbp", json_file)) | ||
cisbp.setdefault(CisBP2Pfam[model["Family_Name"]], model) | ||
|
||
for pfam in cisbp: | ||
if cisbp[pfam]["Model.Class"] == "SimilarityRegression": | ||
hmm_file = os.path.join("pfam", f"{pfam}.hmm") | ||
for line in Jglobals.parse_file(hmm_file): | ||
m = re.search("^LENG\s+(\d+)", line) | ||
if m: | ||
print( | ||
pfam, | ||
int(m.group(1)) == len(cisbp[pfam]["SR.FeatureScales.mean"]) | ||
) |