Revision e9558dc11b31b908f3af142e403d33e91d417b8a authored by Albert Tian Chen on 24 January 2021, 10:43:42 UTC, committed by Albert Tian Chen on 24 January 2021, 10:43:42 UTC
1 parent 86cf54a
Raw File
merge_pymol_interactions.py
#!/usr/bin/env python3
# coding: utf-8

'''Merge interactions from pymol_interacting_nab.py into spike_structures.csv

Author: Albert Chen (Deverman Lab - Broad Institute)
'''

import pandas as pd

from pathlib import Path

project_root_path = Path(__file__).resolve().parent.parent
data_dir = (project_root_path / 'data').resolve() # Resolve any symlinks --> absolute path

df = pd.read_csv(data_dir / 'spike_structures.csv')
interact_df = pd.read_csv(data_dir / 'spike_interactions.csv')

df['interacting_residues'] = df['PDB ID'].map(
    pd.Series(
        interact_df['interacting_residues'].values,
        index=interact_df['pdb_id']
    )
)

df.to_csv(data_dir / 'spike_structures.csv', index=False)
back to top