alphafold_pytorch
alphafold_pytorch copied to clipboard
KeyError: 'X'
I found that an error for some input sequences is produced if an alignment during the feature generation pipeline contains the amino acid place holder X:
KeyError: 'X' Traceback (most recent call last): File "feature.py", line 263, in <module> feature_generation(SEQ_FILE, OUT_FILE) File "feature.py", line 194, in feature_generation non_gapped_profile[i, mapping[j]] += 1
I could solve the problem by replacing line 194 in feature.py with:
if (j!='X'):
non_gapped_profile[i, mapping[j]] += 1
I got the same error. Did you also get a segmentation fault when executing PSI-BLAST?
I had a segmentation fault with psi-blast 2.10 but it seems to work with ver 2.9 : You 'll find at -> ftp://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/2.9.0/ncbi-blast-2.9.0+-x64-linux.tar.gz
--- mapping = {aa: i for i, aa in enumerate('ARNDCQEGHILKMFPSTWYV-')}
+++ mapping = {aa: i for i, aa in enumerate('ARNDCQEGHILKMFPSTWYVX-')}
--- non_gapped_profile = np.zeros((L, 21), dtype=np.float32)
+++ non_gapped_profile = np.zeros((L, 22), dtype=np.float32)
for i in range(L):
for j in aln[:, i]:
non_gapped_profile[i, mapping[j]] += 1
non_gapped_profile[:, -1] = 0
+++ non_gapped_profile = np.delete(non_gapped_profile, non_gapped_profile.shape[1] - 1, 1)
non_gapped_profile /= non_gapped_profile.sum(-1).reshape(-1, 1)
Is this modification in feature.py better to handle the residue X?
I had this issue as well. The code change above fixed it. It would be nice to add it to the repository. If you would like, I can open a pull request with these changes.
- How to solute this problem.
- Anyone please give me solutions.