public static int[] genomesIdListOfSubGroupFromJsonArray(JSONArray organizedJson, String key){
		int len = organizedJson.length();
		int i,j,k,l;
		ArrayList<Integer> id_list = new ArrayList<Integer>();
		boolean ok = false;
		for(i = 0; i < len && !ok; i++)
		{
			JSONArray groups = organizedJson.getJSONObject(i).getJSONArray("groups");
			int leng = groups.length();
			for(j = 0; j < leng && !ok; j++)
			{
				JSONArray subgroups = groups.getJSONObject(j).getJSONArray("subgroups");
				int lens = subgroups.length();
				for(k = 0; k < lens && !ok; k++)
				{
					JSONObject subgroup = subgroups.getJSONObject(k);
					if((subgroup.getString("subgroup")).equals(key)){
						JSONArray genomes = subgroups.getJSONObject(k).getJSONArray("genomes");
						int lenc = genomes.length();
						for(l = 0; l < lenc; l++)
						{						
							JSONObject genome = genomes.getJSONObject(l);
							id_list.add(new Integer(genome.getInt("genome_id")));
						}
						ok = true;
					}
				}
			}
		}
		
		int i_tab[] = new int[id_list.size()];
		
		for(i = 0; i < id_list.size(); i++){
			i_tab[i] = id_list.get(i).intValue();
		}
		
		return i_tab;
	}