@staticmethod
def _get_mainchain(df, invert):
    """Return only main chain atom entries from a DataFrame"""
    if invert:
        mc = df[(df['atom_name'] != 'C') & (df['atom_name'] != 'O') & (df[
            'atom_name'] != 'N') & (df['atom_name'] != 'CA')]
    else:
        mc = df[(df['atom_name'] == 'C') | (df['atom_name'] == 'O') | (df[
            'atom_name'] == 'N') | (df['atom_name'] == 'CA')]
    return mc
