code: private static void setChainIdsInResidueNumbers(Chain c, String newChainName) {
  		for (Group g:c.getAtomGroups()) {
  			g.setResidueNumber(newChainName, g.getResidueNumber().getSeqNum(), g.getResidueNumber().getInsCode());
  		}
  		for (Group g:c.getSeqResGroups()) {
  			if (g.getResidueNumber()==null) continue;
  			g.setResidueNumber(newChainName, g.getResidueNumber().getSeqNum(), g.getResidueNumber().getInsCode());
  		}
  	}
docs: Auxiliary method to reset chain ids of residue numbers in a chain.
  Used when cloning chains and resetting their ids: one needs to take care of
  resetting the ids within residue numbers too.
  @param c
  @param newChainName