def get_chain_ids(self, pdb_id = None, safe_call = False):
        '''If the FASTA file only has one PDB ID, pdb_id does not need to be specified. Otherwise, the list of chains identifiers for pdb_id is returned.'''

        if pdb_id == None and len(self.keys()) == 1:
            return self[self.keys()[0]].keys()

        pdbID = pdbID.upper()
        if not self.get(pdbID):
            if not safe_call:
                raise Exception("FASTA object does not contain sequences for PDB %s." % pdbID)
            else:
                return []
        return self[pdbID].keys()
If the FASTA file only has one PDB ID, pdb_id does not need to be specified. Otherwise, the list of chains identifiers for pdb_id is returned.