public DrugBank(String database) throws JAXBException {
		JAXBContext context = JAXBContext.newInstance(Drugs.class);
		Unmarshaller um = context.createUnmarshaller();
		drugs = (Drugs) um.unmarshal(new File(database+DATAFILE));
		drugList = drugs.getDrug();

		name2idx = new HashMap<String, Integer>();
		synonyms2idx = new HashMap<String, HashSet<Integer>>();
		pubChemCom2idx = new HashMap<Integer, HashSet<Integer>>();
		id2idx = new HashMap<String, Integer>();
		for (int i=0; i<size(); i++) {
			//if (name2idx.containsKey(getName(i).toLowerCase()))
			//	System.out.println("Name conflict at "+i+"th drug.");
			name2idx.put(getName(i).toLowerCase(), i);
			for (String name: getSynonyms(i)) {
				name = name.toLowerCase();
				//if (synonyms2idx.containsKey(name) && synonyms2idx.get(name)!=i)
				//	System.out.println("Synonyms "+name+" conflict at "+
				//			getName(i)+" with "+getName(synonyms2idx.get(name)));
				if (!synonyms2idx.containsKey(name))
					synonyms2idx.put(name, new HashSet<Integer>());
				synonyms2idx.get(name).add(i);
			}
			Integer compound = getPubChemCompound(i);
			if (compound != null) {
				//if (pubChemCom2idx.containsKey(compound))
				//	System.out.println("PubChem Compound "+compound+" conflict at "+
				//			getName(i)+" with "+getName(pubChemCom2idx.get(compound)));
				if (!pubChemCom2idx.containsKey(compound))
					pubChemCom2idx.put(compound, new HashSet<Integer>());
				pubChemCom2idx.get(compound).add(i);
			}
			for (String id: getIDs(i))
				id2idx.put(id, i);
		}
		//getSynonyms(idx)
		//getBrands(idx)
		System.out.println("DrugBank contains "+size()+" drugs.");
	}