def name_filter(sum_dict, align_dict, name_list):
 new_sum_dict = FSSP.FSSPSumDict()
 new_align_dict = copy.deepcopy(align_dict)
 for cur_pdb_name in name_list:
  for prot_num in sum_dict:
   if ((sum_dict[prot_num].pdb2 + sum_dict[prot_num].chain2) == cur_pdb_name):
    new_sum_dict[prot_num] = sum_dict[prot_num]
 prot_numbers = sorted(new_sum_dict)
 for pos_num in new_align_dict.abs_res_dict:
  new_align_dict.abs(pos_num).pos_align_dict = {}
  for prot_num in prot_numbers:
   new_align_dict.abs(pos_num).pos_align_dict[prot_num] = align_dict.abs(pos_num).pos_align_dict[prot_num]
 return (new_sum_dict, new_align_dict)

def name_filter ( sum_dict , align_dict , name_list ) : new_sum_dict = FSSP . FSSPSumDict ( ) new_align_dict = copy . deepcopy ( align_dict ) for cur_pdb_name in name_list : for prot_num in sum_dict : if ( ( sum_dict [ prot_num ] . pdb2 + sum_dict [ prot_num ] . chain2 ) == cur_pdb_name ) : new_sum_dict [ prot_num ] = sum_dict [ prot_num ] prot_numbers = sorted ( new_sum_dict ) for pos_num in new_align_dict . abs_res_dict : new_align_dict . abs ( pos_num ) . pos_align_dict = { } for prot_num in prot_numbers : new_align_dict . abs ( pos_num ) . pos_align_dict [ prot_num ] = align_dict . abs ( pos_num ) . pos_align_dict [ prot_num ] return ( new_sum_dict , new_align_dict )
accepts a list of names .