private static void writeTTestFile(String tissue, 
			HashMap<String, MetadataFileLine> metaMap, OtuWrapper wrapper)
		throws Exception
	{
		System.out.println(tissue);
		// the key is the cage
		// the outer list has one entry for each OTU
		// the inner list has one entry for each cage
		HashMap<String, List<List<Double>>> lowSachData = new HashMap<String, List<List<Double>>>();
		HashMap<String, List<List<Double>>> highSachData = new HashMap<String, List<List<Double>>>();
		
		BufferedWriter writer = new BufferedWriter(new FileWriter(new File(
				ConfigReader.getSaccharineRatDir() + 
					File.separator + "otuTTests"  + tissue + ".txt")));
		
		for( int x=0; x < wrapper.getSampleNames().size(); x++)
		{
			MetadataFileLine mfl = metaMap.get(wrapper.getSampleNames().get(x));
			
			if( mfl.getTissue().equals(tissue))
			{
				if( mfl.getPhenotype().equals("Low"))
				{
					addToMap(lowSachData, wrapper, mfl.getCage(), x);
				}
				else if( mfl.getPhenotype().equals("High"))
				{

					addToMap(highSachData, wrapper, mfl.getCage(), x);
				}
				else throw new Exception("No");
			}
			
		}
		
		List<Holder> list = new ArrayList<Holder>();
		
		for( int x=0; x < wrapper.getOtuNames().size(); x++)
		{
			List<Number> mediansHi = new ArrayList<Number>();
			List<Number> mediansLow = new ArrayList<Number>();
			
			for(List<List<Double>> aList : lowSachData.values())
			{
				mediansLow.add( MedianOfCage.getMedian(aList.get(x)));
			}
			
			for(List<List<Double>> aList : highSachData.values())
			{
				mediansHi.add( MedianOfCage.getMedian(aList.get(x)));
			}
			
			Holder h = new Holder();
			h.taxa = wrapper.getOtuNames().get(x);
			h.averageLowSach = new Avevar(mediansLow).getAve();
			h.avergeHighSach = new Avevar(mediansHi).getAve();
			
			try
			{
				h.pValue = TTest.ttestFromNumberUnequalVariance(mediansHi, mediansLow).getPValue();
			}
			catch(Exception ex)
			{
				
			}
			list.add(h);
		}
		
		writer.write("taxa\tlowAverage\thiAverage\tpValue\tfdrPValue\n");
		
		Collections.sort(list);
		
		int rank=1;
		for( Holder h : list)
		{
			writer.write(h.taxa + "\t");
			writer.write(h.averageLowSach + "\t");
			writer.write(h.avergeHighSach + "\t");
			writer.write(h.pValue + "\t");
			writer.write(list.size() * h.pValue / rank + "\n");
			rank++;
		}
		
		writer.flush();  writer.close();
	}