private void exportFramedDiffCatsSimStructVsMoa(String path, int level) throws Exception {
		SmilesParser smilesParser = new SmilesParser(SilentChemObjectBuilder.getInstance());

		DrugBank db = new DrugBank("data/tmp/drugbank.ser");

		Brain atc = new Brain();
		System.out.println("Learning ATC...");
		atc.learn("data/atc.owl");
		System.out.println("Learning done!");

		//DrugBanks compounds in the FTC
		List<String> drugs = brain.getSubClasses("FTC_C2", false);
		List<String> drugBankIds = new ArrayList<String>();

		//int iterations = 100;
		int iterations = drugs.size();

		//Gets only the compounds with a SMILES attached to them
		//Get only the drugs that have a MoA (super classes > 4)
		int notConsidered = 0;
		for (int i = 0; i < iterations; i++) {
			String drugId = drugs.get(i);
			Drug drug = db.getDrug(drugId);
			if(drug.getSmiles() != null){
				if(brain.getSuperClasses(drugId, false).size() > 4){
					drugBankIds.add(drugId);
				}else{
					notConsidered++;
				}
			}else{
				notConsidered++;
			}
		}

		System.out.println("number of compounds considered: " + drugBankIds.size() + " - Not considered: " + notConsidered);

		List<AtcSimilarityComparison> sims = new ArrayList<AtcSimilarityComparison>();

		for (int i = 0; i < drugBankIds.size(); i++) {
			String id1 = drugBankIds.get(i);
			System.out.println(i + "/" + drugBankIds.size());
			for (int j = i + 1; j < drugBankIds.size(); j++) {
				String id2 = drugBankIds.get(j);

				//Actual sorting
				boolean diff = false;
				try {
					diff = differentCategories(atc.getSubClasses(id1, true), atc.getSubClasses(id2, true), level);
				} catch (ClassExpressionException exception){
					diff = false;
				}


				if(diff){
					String smiles1 = db.getDrug(id1).getSmiles();
					String smiles2 = db.getDrug(id2).getSmiles();
					IMolecule mol1 = smilesParser.parseSmiles(smiles1);
					IMolecule mol2 = smilesParser.parseSmiles(smiles2);
					HybridizationFingerprinter fingerprinter = new HybridizationFingerprinter();
					BitSet bitset1 = fingerprinter.getFingerprint(mol1);
					BitSet bitset2 = fingerprinter.getFingerprint(mol2);
					float tanimoto = Tanimoto.calculate(bitset1, bitset2);
					float jaccard = brain.getJaccardSimilarityIndex(id1, id2);
					AtcSimilarityComparison sim = new AtcSimilarityComparison();
					sim.firstSim = jaccard;
					sim.secondSim = tanimoto;
					sim.id1 = id1;
					sim.id2 = id2;

					try {
						sim.atc2 = getCategory(atc.getSubClasses(id2, true), level);
					} catch (ClassExpressionException exception) {
						sim.atc2 = "NoCategory";
					}		

					try {
						sim.atc1 = getCategory(atc.getSubClasses(id1, true), level);
					} catch (ClassExpressionException exception) {
						sim.atc1 = "NoCategory";
					}				

					sims.add(sim);
				}
			}
		}
		CSVWriter writer = new CSVWriter(path);
		writer.write(sims);
		atc.sleep();
	}