Java FileWriter Write saveCCS(Map contributionScore, String diseaseState, String file)

Here you can find the source of saveCCS(Map contributionScore, String diseaseState, String file)

Description

save CCS

License

Open Source License

Declaration

public static void saveCCS(Map<String, Double> contributionScore, String diseaseState, String file)
            throws IOException 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.io.BufferedWriter;
import java.io.File;

import java.io.FileWriter;
import java.io.IOException;

import java.util.Map;

public class Main {
    public static void saveCCS(Map<String, Double> contributionScore, String diseaseState, String file)
            throws IOException {

        File f = new File(file);
        if (!f.exists()) {
            f.createNewFile();/*from   ww w. j av  a2 s  .c o m*/
        }
        FileWriter fw = new FileWriter(f.getAbsoluteFile());
        BufferedWriter bw = new BufferedWriter(fw);
        bw.write("expression" + "\t" + diseaseState);
        bw.newLine();
        boolean column = false;
        for (String gene : contributionScore.keySet()) {
            bw.write(gene + "\t" + contributionScore.get(gene));
            bw.newLine();
        }

        bw.close();
    }
}

Related

  1. save_array(double[] array, String fname)
  2. saveAllToFile(String filename, String... strings)
  3. saveArrayNames(int[] array, String[] names, String fname)
  4. saveAuthFile(String fileName, String raw)
  5. saveBufferInFile(String buffer, File filename)
  6. saveColumn(int[] density, String filename)
  7. saveConfig(File conf, Map data)
  8. saveContent(String context, String filename)
  9. saveData(Map> data, File file)