Skip to content

Commit

Permalink
Merge pull request #203 from tubiana/main
Browse files Browse the repository at this point in the history
Small fix to improve compatibility with starfiles & fix some SS annotation
  • Loading branch information
BradyAJohnston authored Apr 27, 2023
2 parents 6679b72 + aab35ca commit a17c75b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions MolecularNodes/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,11 @@ def get_secondary_structure(mol_array, file) -> np.array:

dssp_to_abc = {
"X" : 0,
"I" : 3, #"c",
"I" : 1, #"a",
"S" : 3, #"c",
"H" : 1, #"a",
"E" : 2, #"b",
"G" : 3, #"c",
"G" : 1, #"a",
"B" : 2, #"b",
"T" : 3, #"c",
"C" : 3 #"c"
Expand Down Expand Up @@ -508,6 +508,11 @@ def load_star_file(
df = star['particles'].merge(star['optics'], on='rlnOpticsGroup')

# get necessary info from dataframes
# Standard cryoEM starfile don't have rlnCoordinateZ. If this column is not present
# Set it to "0"
if "rlnCoordinateZ" not in df:
df['rlnCoordinateZ'] = 0

xyz = df[['rlnCoordinateX', 'rlnCoordinateY', 'rlnCoordinateZ']].to_numpy()
pixel_size = df['rlnImagePixelSize'].to_numpy().reshape((-1, 1))
xyz *= pixel_size
Expand Down

0 comments on commit a17c75b

Please sign in to comment.