code: private static int getPositionForPDBresunm(String pdbresnum, String authId , Atom[] atoms){
  		ResidueNumber residueNumber =  ResidueNumber.fromString(pdbresnum);
  		residueNumber.setChainName(authId);
  
  		boolean blankChain = authId == null || authId.equalsIgnoreCase("null") || authId.equals("_");
  
  		for ( int i =0; i< atoms.length ;i++){
  			Group g = atoms[i].getGroup();
  
  			// match _ to any chain
  			if( blankChain ) {
  				residueNumber.setChainName(g.getChain().getName());
  			}
  
  			//System.out.println(g.getResidueNumber() + "< ? >" + residueNumber +"<");
  			if ( g.getResidueNumber().equals(residueNumber)){
  				//System.out.println(g + " == " + residueNumber );
  				Chain c = g.getChain();
  				if ( blankChain || c.getName().equals(authId)){
  					return i;
  				}
  			}
  		}
  		return -1;
  	}
docs: get the position of PDB residue nr X in the ato marray
  
  @param pdbresnum pdbresidue number
  @param authId chain name
  @param atoms atom array
  @return