annotate NGSrich_0.5.5/src/_main/NGSrichEvaluate.java @ 0:89ad0a9cca52 default tip

Uploaded
author pfrommolt
date Mon, 21 Nov 2011 08:12:19 -0500
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
1 package _main;
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
2
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
3 import java.io.BufferedInputStream;
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
4 import java.io.File;
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
5 import java.io.FileInputStream;
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
6 import java.io.FileWriter;
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
7 import java.io.IOException;
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
8 import java.sql.Time;
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
9 import java.util.Properties;
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
10 import middlewares.Misc;
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
11 import exceptions.ChromosomeMismatchException;
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
12 import exceptions.FileFormatException;
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
13
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
14 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
15 * This is the Main-class of the evaluation part of the software. This class
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
16 * uses the Enrichment-class to process the phases (the parts) of the pipeline.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
17 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
18 * @author Ali Abdallah
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
19 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
20
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
21 public class NGSrichEvaluate {
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
22
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
23 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
24 * An array of arguments containing the following option elements in the
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
25 * following order:
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
26 * -r <readsFile> (-a|-g) <annotation> -t <target> [-s <sName>]
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
27 * [-T <tmpDir>][-o <outDir>][-p <poor> -h <high>][-no_details]
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
28 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
29 * Required:
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
30 * <readsFile> Path to read alignment file in SAM or BAM format.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
31 * <annotation> UCSC genome version name.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
32 * <target> Path to target file in BED format.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
33 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
34 * Optional:
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
35 * <sName> Sample name [default: prefix of <readsFile>].
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
36 * <tmpDir> Temporary directory [default: '/tmp'].
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
37 * <outDir> Output directory [default: '<pathToReadsFile>/enrichment'].
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
38 * <poor> Cutoff for poor coverage [default: 2].
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
39 * <high> Cutoff for high coverage [default: 200].
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
40 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
41 String[] args;
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
42
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
43 public NGSrichEvaluate(String[] args) {
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
44 this.args = args;
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
45 }
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
46
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
47 public void evaluate() throws IOException, FileFormatException,
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
48 InterruptedException {
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
49 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
50 * Ordered List of Parameter (left/right): readFName genomeFName
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
51 * targetFName tmpDir outDir
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
52 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
53 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
54
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
55 int alen = args.length;
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
56 String[] params = new String[10];
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
57
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
58 String usagestr =
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
59 "\nUsage: java NGSrich evaluate -r <readsFile> "
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
60 + "-u <genome-name> -t <target> [(-a|-g) "
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
61 + "<annotation>] [-s <sName>] [-T <tmpDir>] "
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
62 + "[-o <outDir>] [-p <poor> -h <high>][--no-details>]\n\n\tRequired:\n\t"
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
63 + "<readsFile>\tPath to read alignment file in SAM or BAM format."
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
64 + "\n\t<genome-name>\tUCSC genome version name.\n\t<target>\tPath "
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
65 + "to target file in BED format.\n\n\tOptional:\n\t<sName>\t\t"
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
66 + "Sample name [default: prefix of <readsFile>].\n\t<annotation>\t\t"
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
67 + "path of the annotation file [default: the genome is "
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
68 + "downloaded based on the genome version name].\n\t<tmpDir>\t"
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
69 + "Temporary directory [default: '/tmp'].\n\t<outDir>\tOutput "
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
70 + "directory [default: '<pathToReadsFile>/enrichment'].\n\t"
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
71 + "<poor>\t\tCutoff for poor coverage [default: 2].\n\t<high>"
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
72 + "\t\tCutoff for high coverage [default: 200]. \n\t--no-details\tto repress the computation of the" +
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
73 " evaluation details\n";
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
74
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
75 if (alen == 0) {
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
76 System.out.println(usagestr);
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
77 System.exit(0);
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
78 }
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
79
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
80 boolean t = false, o = false, h = false, po = false, sname = false, u = false, r = false, g = false,
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
81 a = false, T = false;
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
82 params[9] = "1";
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
83 for (int i = 0; i < alen; i = i + 2) {
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
84 if ((args[i].length() == 2 && args[i].charAt(0) == '-') || args[i].equals("--no-details")) {
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
85 char flag = (args[i].length()==2)?args[i].charAt(1):args[i].charAt(2);
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
86 switch (flag) {
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
87 case 'r': params[0] = args[i + 1];r = true;break;
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
88 case 'g': params[1] = args[i + 1];g = true;break;
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
89 case 'a': params[1] = args[i + 1];a = true;break;
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
90 case 't': params[2] = args[i + 1];t = true;break;
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
91 case 'T': params[3] = args[i + 1];T = true;break;
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
92 case 'o': params[4] = args[i + 1];o = true;break;
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
93 case 'p': params[5] = args[i + 1];po = true;break;
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
94 case 'h': params[6] = args[i + 1];h = true;break;
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
95 // Added by PF 2011-07-12
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
96 case 's': params[7] = args[i + 1];sname = true;break;
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
97 case 'u': params[8] = args[i+1]; u = true;break;
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
98 case 'n': params[9]="0";break;
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
99 }
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
100 } else {
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
101 System.out.println(usagestr);
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
102 System.exit(0);
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
103 }
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
104 }
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
105
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
106 boolean required = r && t && u;
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
107
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
108 if(!required){
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
109 System.out.println("Some required arguments are missing.\n");
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
110 System.out.println(usagestr);
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
111 System.exit(0);
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
112 }
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
113
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
114 String default_properties_file = createDefaultPropertiesFile();
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
115 Properties p = new Properties();
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
116 BufferedInputStream stream =
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
117 new BufferedInputStream(
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
118 new FileInputStream(default_properties_file));
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
119
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
120 p.load(stream);
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
121 stream.close();
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
122 if (!T)params[3] = p.getProperty("tmpDir");
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
123 if (!o) {
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
124 String oPath = p.getProperty("outDirPath");
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
125 if (oPath.equals(""))oPath = Misc.path(params[0]);
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
126 params[4] = oPath + Misc.slash(oPath) + p.getProperty("outDir");
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
127 new File(params[4]).mkdir();
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
128 }
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
129 if (!po)params[5] = p.getProperty("poor");
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
130 if (!h)params[6] = p.getProperty("high");
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
131 if (!sname)params[7] = "none";
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
132 if (!(a||g))params[1] = "none";
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
133
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
134 Enrichment ngs = new Enrichment(params);
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
135 // Convert BAM to SAM if necessary.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
136 String infile = params[0];
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
137 if (infile.endsWith(".bam")) {
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
138 System.out.println("======================0======================");
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
139 System.out.println("\n>>> Found BAM file: converting to SAM\n");
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
140 infile = ngs.bam2sam();
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
141 }
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
142 ngs.readFileName = infile;
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
143
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
144 // File timeReport =
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
145 // new File(params[3] + Misc.slash(params[3])+"TimeReport.txt");
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
146 // FileWriter trWriter = new FileWriter(timeReport);
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
147
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
148 // Reduce the files.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
149 System.out.println("======================1======================");
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
150 System.out.println(">>> STEP 1: reducing files\n");
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
151 try {
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
152 long start = System.currentTimeMillis();
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
153 ngs.reduceFiles();
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
154 long rtime = System.currentTimeMillis() - start;
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
155 Time time = new Time(rtime);
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
156 //trWriter.write("Reducing files took: " + time + "\n");
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
157
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
158 } catch (ChromosomeMismatchException e) {
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
159 e.printStackTrace();
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
160 }
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
161
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
162 // Compute the target coverage files.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
163 System.out.println("\n======================2======================");
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
164 System.out.println(">>> STEP 2: computing target coverage data\n");
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
165 long start = System.currentTimeMillis();
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
166 ngs.computeTargetCoverageFiles();
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
167 long rtime = System.currentTimeMillis() - start;
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
168 Time time = new Time(rtime);
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
169 // trWriter.write("Computing target coverage data took: " + time + "\n");
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
170
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
171 // Evaluate enrichment.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
172 System.out.println("\n======================3======================");
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
173 System.out.println(">>> STEP 3: evaluating enrichment files\n");
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
174 start = System.currentTimeMillis();
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
175 ngs.evaluate();
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
176 rtime = System.currentTimeMillis() - start;
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
177 time = new Time(rtime);
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
178 //trWriter.write("Evaluating enrichment files took: " + time + "\n");
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
179 Thread.sleep(10000);
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
180
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
181 // Compute the target wiggle files.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
182 System.out.println("\n======================4======================");
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
183 System.out.println(">>> STEP 4: computing targets wiggle data\n");
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
184 start = System.currentTimeMillis();
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
185 ngs.computeWiggleFile();
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
186 rtime = System.currentTimeMillis() - start;
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
187 time = new Time(rtime);
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
188 //trWriter.write("Computing targets wiggle data took: " + time + "\n");
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
189
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
190 // Compute the overall wiggle files.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
191 System.out.println("\n======================5======================");
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
192 System.out.println(">>> STEP 5: computing overall wiggle data\n");
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
193 ngs.computeOverallWiggleFile();
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
194 start = System.currentTimeMillis();
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
195 ngs.computeOverallWiggleFile();
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
196 rtime = System.currentTimeMillis() - start;
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
197 time = new Time(rtime);
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
198 //trWriter.write("Computing targets wiggle data took: " + time + "\n");
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
199 System.out.println("\n=============================================");
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
200 //trWriter.close();
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
201 }
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
202
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
203 private String createDefaultPropertiesFile() throws IOException {
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
204 String default_properties_file =
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
205 Misc.binDir()+Misc.slash(Misc.binDir())+"DEFAULT.properties";
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
206 if(!new File(default_properties_file).exists()){
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
207 String default_str =
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
208 "! Path of the temporary directory.\n" +
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
209 "tmpDir: /tmp\n" +
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
210 "! Path of the father directory of the output directory. " +
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
211 "When empty the output directory is placed in the directory " +
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
212 "containing the reads alignment file.\n" +
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
213 "outDirPath:\n" +
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
214 "! Name of the output directory (not the path).\n" +
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
215 "outDir: enrichment\n" +
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
216 "! Define poorly covered genes.\n" +
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
217 "poor: 2\n" +
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
218 "! Defines highly covered genes.\n" +
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
219 "high: 200";
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
220 FileWriter properties_writer =
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
221 new FileWriter(default_properties_file);
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
222 properties_writer.write(default_str);
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
223 properties_writer.close();
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
224 }
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
225 return default_properties_file;
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
226 }
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
227 }