private static void writeForLevel(String level) throws Exception
	{
		System.out.println(level);
		BufferedWriter writer =new BufferedWriter(new FileWriter(new File(ConfigReader.getVanderbiltDir() + File.separator + 
				"spreadsheets" + File.separator + 
				"mergedKrakenRDP_" + level + ".txt")));
		writer.write("sample\tisStoolOrSwab\ttaxa\tkrakenLevel\trdpLevel\tkraken16SLevel\tmaxKrakenFraction\n");
		
		OtuWrapper rdpWrapper = new OtuWrapper(ConfigReader.getVanderbiltDir() + File.separator + "spreadsheets" + 	
							File.separator + "pivoted_"+ level  + "asColumns.txt");
		
		OtuWrapper krakenWrapper = new OtuWrapper(ConfigReader.getVanderbiltDir() + File.separator + "spreadsheets" + 	
				File.separator + "kraken_" + level + "_taxaAsColumns.txt");
		
		OtuWrapper kraken16SWrapper = new OtuWrapper(ConfigReader.getVanderbiltDir() 
					+ File.separator + 
					"spreadsheets" + File.separator + 
					"kraken_" + level +"_taxaAsColumnsFor16S.txt");
		
		HashSet<String> samples = new HashSet<String>();
		samples.addAll(kraken16SWrapper.getSampleNames());
		samples.retainAll(krakenWrapper.getSampleNames());
		samples.retainAll(rdpWrapper.getSampleNames());
		HashSet<String> taxa = getTaxaToInclude(rdpWrapper, krakenWrapper, kraken16SWrapper, samples);
		
		for(String s : samples)
		{
			int rdpSampleKey = rdpWrapper.getIndexForSampleName(s);
			int krakenSampleKey = krakenWrapper.getIndexForSampleName(s);
			int kraken16SSampleKey = kraken16SWrapper.getIndexForSampleName(s);
			
			for(String otu : taxa)
			{
				writer.write(s + "\t");
				
				if( s.startsWith("ST"))
					writer.write("stool\t");
				else if ( s.startsWith("SW"))
					writer.write("swab\t");
				else throw new Exception(s);
				
				writer.write(otu + "\t");
				writer.write( getVal(krakenWrapper, krakenSampleKey, otu) + "\t" );
				writer.write( getVal(rdpWrapper, rdpSampleKey, otu) + "\t" );
				writer.write( getVal(kraken16SWrapper, kraken16SSampleKey, otu) + "\t" );
				
				double krakenFraction = 0;
				
				if( krakenWrapper.getIndexForOtuName(otu) != -1  )
				{
					krakenFraction = (double)krakenWrapper.getCountsForTaxa(otu) /
							krakenWrapper.getTotalCounts();

				}
				
				double kraken16Fraction = 0;
				
				if( kraken16SWrapper.getIndexForOtuName(otu) != -1 )
				{
					kraken16Fraction = (double)kraken16SWrapper.getCountsForTaxa(otu) /
							kraken16SWrapper.getTotalCounts();
					
				}
				
				
				writer.write(Math.max(krakenFraction , kraken16Fraction )+ "\n");
			}
		}
		
		writer.flush();  writer.close();
	}