def get_ca_atoms(chain):
    """
    Returns the CA atoms of a chain, or all the atoms in case it doesn't have CA atoms.
    Arguments:
        - chain - Bio.PDB.Chain, the chain to get the atoms
    """
    result = []
    if chain.child_list[0].has_id("CA"):
        for fixed_res in chain:
            if fixed_res.has_id("CA"):
                result.append(fixed_res['CA'])
    else:
        result = list(chain.get_atoms())
    return result