Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion alphafold/common/protein.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,8 @@ def to_pdb(prot: Protein) -> str:
charge = ''
# PDB is a columnar format, every space matters here!
atom_line = (
f'{record_type:<6}{atom_index:>5} {name:<4}{alt_loc:>1}'
display_index = atom_index % 100000
f'{record_type:<6}{display_index:>5} {name:<4}{alt_loc:>1}'
f'{res_name_3:>3} {chain_ids[chain_index[i]]:>1}'
f'{residue_index[i]:>4}{insertion_code:>1} '
f'{pos[0]:>8.3f}{pos[1]:>8.3f}{pos[2]:>8.3f}'
Expand Down
5 changes: 5 additions & 0 deletions alphafold/data/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,11 @@ def parse_stockholm(stockholm_string: str) -> Msa:
keep_columns = [i for i, res in enumerate(query) if res != '-']

# Remove the columns with gaps in the query from all sequences.
if keep_columns and len(sequence) <= max(keep_columns):
raise ValueError(
f'Malformed MSA: Hit sequence length ({len(sequence)}) is strictly '
f'shorter than required columns ({max(keep_columns)}).'
)
aligned_sequence = ''.join([sequence[c] for c in keep_columns])

msa.append(aligned_sequence)
Expand Down