public void createFormattedDataFile(File formattedDataFile, Map<String, List<MiRnaGenePair>> pairs) {
	BufferedOutputStream os = null;
	try {
	    os = new BufferedOutputStream(new FileOutputStream(formattedDataFile));
	    os.write("Label,miRnaGeneId,Features\n".getBytes());
	    int miRnaGeneId = 1;
	    Iterator<String> iter = pairs.keySet().iterator();
	    while (iter.hasNext()) {
		String miRna = iter.next();
		List<MiRnaGenePair> miRnaGenePairs = pairs.get(miRna);
		for (MiRnaGenePair miRnaGenePair : miRnaGenePairs) {
		    String miRnaGene = miRna + ":" + miRnaGenePair.getGene();
		    miRnaGeneIds.put(miRnaGeneId, miRnaGene);
		    
		    // Write miRna Gene Pair to output file
		    os.write(String.format("%d,%d", miRnaGenePair.getLabel(), miRnaGeneId++).getBytes());
		    List<String> pair = miRnaGenePair.getPairs();
		    
		    // Negative pair, so need to create true negative by removing positive binding
		    if (miRnaGenePair.getLabel() == 0) {
			createNegativePair(pair);
		    }
		    
		    for (int i = 0; i < 8; i++) {
//			int feature = dictionary.get(pair.get(i));
//			for (int j = 0; j < dictionary.size(); j++) {
//			    os.write(",".getBytes());
//			    int val = 0;
//			    if (feature == (j+1)) {
//				val = 1;
//			    }
//			    os.write(Integer.toString(val).getBytes());
//			}
		    }
		    for (int i = 0; i < pair.size(); i++) {
			os.write(",".getBytes());
			os.write(dictionary.get(pair.get(i)).toString().getBytes());
		    }
		    os.write("\n".getBytes());
		}
		
	    }
	} catch (FileNotFoundException e) {
	    e.printStackTrace();
	} catch (IOException e) {
	    e.printStackTrace();
	} finally {
	    if (os != null) {
		try {
		    os.close();
		} catch (IOException e) {
		    e.printStackTrace();
		}
		os = null;
	    }
	}
    }