Debian Codegraph @

current/jgi/TrimContigs.java

raw symbols SCIP
1 package jgi;
2
3 import java.io.File;
4 import java.io.PrintStream;
5 import java.util.ArrayList;
6 import java.util.Collection;
7 import java.util.HashMap;
8
9 import dna.AminoAcid;
10 import fileIO.ByteFile;
11 import fileIO.ByteFile1;
12 import fileIO.ByteFile2;
13 import fileIO.ByteStreamWriter;
14 import fileIO.FileFormat;
15 import fileIO.ReadWrite;
16 import gff.GffLine;
17 import shared.LineParser4;
18 import shared.Parse;
19 import shared.Parser;
20 import shared.PreParser;
21 import shared.Shared;
22 import shared.Timer;
23 import shared.Tools;
24 import shared.TrimRead;
25 import stream.ConcurrentGenericReadInputStream;
26 import stream.ConcurrentReadInputStream;
27 import stream.ConcurrentReadOutputStream;
28 import stream.FASTQ;
29 import stream.FastaReadInputStream;
30 import stream.Read;
31 import structures.ByteBuilder;
32 import structures.ListNum;
33
34 /**
35 * Trims contigs to eliminate uncovered areas.
36 * @author Brian Bushnell
37 * @date September 28, 2024
38 *
39 */
40 public class TrimContigs {
41
42 public static void main(String[] args){
43 Timer t=new Timer();
44 TrimContigs x=new TrimContigs(args);
45 x.process(t);
46
47 //Close the print stream if it was redirected
48 Shared.closeStream(x.outstream);
49 }
50
51 public TrimContigs(String[] args){
52
53 {//Preparse block for help, config files, and outstream
54 PreParser pp=new PreParser(args, getClass(), false);
55 args=pp.args;
56 outstream=pp.outstream;
57 }
58
59 FASTQ.FORCE_INTERLEAVED=FASTQ.TEST_INTERLEAVED=false;
60
61 Shared.capBufferLen(20);
62 Shared.capBuffers(4);
63 ReadWrite.USE_PIGZ=ReadWrite.USE_UNPIGZ=true;
64 ReadWrite.setZipThreads(Shared.threads());
65
66
67 Parser parser=new Parser();
68 for(int i=0; i<args.length; i++){
69 String arg=args[i];
70 String[] split=arg.split("=");
71 String a=split[0].toLowerCase();
72 String b=split.length>1 ? split[1] : null;
73
74 if(parser.parse(arg, a, b)){
75 //do nothing
76 }else if(a.equals("verbose")){
77 verbose=Parse.parseBoolean(b);
78 ByteFile1.verbose=verbose;
79 ByteFile2.verbose=verbose;
80 stream.FastaReadInputStream.verbose=verbose;
81 ConcurrentGenericReadInputStream.verbose=verbose;
82 stream.FastqReadInputStream.verbose=verbose;
83 ReadWrite.verbose=verbose;
84 }else if(a.equals("coverage") || a.equals("cov") || a.equals("ranges") || a.equals("covranges")){
85 covRanges=b;
86 }else if(a.equals("minc") || a.equals("mincov") || a.equals("mincoverage")){
87 minCoverage=Double.parseDouble(b);
88 }else if(a.equals("minp") || a.equals("minpercent")){
89 minCoveredPercent=Double.parseDouble(b);
90 }else if(a.equals("minl") || a.equals("minlen") || a.equals("minlength")){
91 minLength=Integer.parseInt(b);
92 }else if(a.equals("trim") || a.equals("trimends") || a.equals("trimmin") || a.equals("mintrim")){
93 trimEndsMin=Tools.max(Integer.parseInt(b), 0);
94 }else if(a.equals("trimmax") || a.equals("maxtrim")){
95 if(Tools.startsWithLetter(b)) {
96 if(b.equalsIgnoreCase("big") || b.equalsIgnoreCase("2b") || b.equalsIgnoreCase("2g")) {
97 trimEndsMax=2000000000;
98 }else {
99 throw new RuntimeException("Unknown argument "+arg);
100 }
101 }else {
102 trimEndsMax=(int)Tools.min(Long.parseLong(b), 2000000000);
103 }
104 }else if(a.equals("trimextra") || a.equals("extra")){
105 trimEndsExtra=Integer.parseInt(b);
106 }else if(a.equals("maxuncovered")){
107 maxUncoveredLength=Integer.parseInt(b);
108 }else if(a.equals("break") || a.equals("breakcontigs")){
109 breakContigs=Parse.parseBoolean(b);
110 }else if(a.equals("breaklist")){
111 breakListFile=b;
112 }else if(a.equalsIgnoreCase("skippolyn")){
113 skipPolyN=Parse.parseBoolean(b);
114 }
115
116 else if(a.equalsIgnoreCase("gff")){
117 throw new RuntimeException("Please specify gffin or gffout.");
118 }else if(a.equalsIgnoreCase("gffin")){
119 gffIn=b;
120 }else if(a.equalsIgnoreCase("gffout")){
121 gffOut=b;
122 }
123
124 else if(a.equals("appendresults") || a.equals("logappend") || a.equals("appendlog") || a.equals("appendtolog")){
125 logappend=Parse.parseBoolean(b);
126 }else if(a.equals("log") || a.equals("results")){
127 logfile=b;
128 }else if(a.equals("logheader")){
129 logheader=Parse.parseBoolean(b);
130 }else if(a.equals("outd") || a.equals("outdirty") || a.equals("outb") || a.equals("outbad")){
131 outdirty=b;
132 }else if(parser.in1==null && i==0 && Tools.looksLikeInputStream(arg)){
133 parser.in1=arg;
134 }else if(parser.out1==null && i==1 && !arg.contains("=")){
135 parser.out1=arg;
136 }else{
137 outstream.println("Unknown parameter "+args[i]);
138 assert(false) : "Unknown parameter "+args[i];
139 // throw new RuntimeException("Unknown parameter "+args[i]);
140 }
141 }
142
143 {//Process parser fields
144 Parser.processQuality();
145
146 maxReads=parser.maxReads;
147
148 overwrite=parser.overwrite;
149 append=parser.append;
150
151 if(parser.minReadLength>0){minLength=parser.minReadLength;}
152
153 in1=parser.in1;
154 qfin1=parser.qfin1;
155
156 outclean=parser.out1;
157 qfoutclean=parser.qfout1;
158
159 extin=parser.extin;
160 extout=parser.extout;
161 }
162 minLength=Tools.max(1, minLength);
163
164 assert(FastaReadInputStream.settingsOK());
165
166 if(in1==null){throw new RuntimeException("Error - at least one input file is required.");}
167 name=ReadWrite.stripToCore(in1);
168
169 if(!ByteFile.FORCE_MODE_BF2){
170 ByteFile.FORCE_MODE_BF2=false;
171 ByteFile.FORCE_MODE_BF1=true;
172 }
173
174 if(outclean!=null && outclean.equalsIgnoreCase("null")){outclean=null;}
175 if(outdirty!=null && outdirty.equalsIgnoreCase("null")){outdirty=null;}
176
177 if(!Tools.testOutputFiles(overwrite, append, false, outclean, outdirty)){
178 outstream.println((outclean==null)+", "+outclean+", "+(outdirty==null)+", "+outdirty);
179 throw new RuntimeException("\n\noverwrite="+overwrite+"; Can't write to output files "+outclean+", "+outdirty+"\n");
180 }
181
182 ffoutclean=FileFormat.testOutput(outclean, FileFormat.FASTA, extout, true, overwrite, append, false);
183 ffoutdirty=FileFormat.testOutput(outdirty, FileFormat.FASTA, extout, true, overwrite, append, false);
184
185 ffin1=FileFormat.testInput(in1, FileFormat.FASTA, extin, true, true);
186 ffRange=FileFormat.testInput(covRanges, FileFormat.TEXT, ".txt", true, false);
187
188 assert(ffRange!=null) : "No coverage file specified.";
189 }
190
191 void process(Timer t){
192
193 final HashMap<String, ArrayList<Range>> map=new HashMap<String, ArrayList<Range>>(1024);
194 final LineParser4 lp=new LineParser4("-\t");
195 if(ffRange!=null){
196 ByteFile tf=ByteFile.makeByteFile(ffRange);
197 int i=0;
198 String name=null;
199 ArrayList<Range> list=null;
200 for(byte[] s=tf.nextLine(); s!=null; s=tf.nextLine()){
201 if(s[0]=='#'){
202 name=new String(s, 1, s.length-1);
203 list=new ArrayList<Range>(2);
204 Object old=map.put(name, list);
205 assert(old==null) : "Duplicate contig name "+name;
206 }else{
207 lp.set(s);
208 int a=lp.parseInt(0);
209 int b=lp.parseInt(1);
210 float d=lp.parseFloat(2);
211 list.add(new Range(a, b, d));
212 }
213 i++;
214 }
215 tf.close();
216 }
217
218 if(gffIn!=null) {loadGff(gffIn);}
219
220 final ConcurrentReadInputStream cris;
221 {
222 cris=ConcurrentReadInputStream.getReadInputStream(maxReads, true, ffin1, null, qfin1, null);
223 if(verbose){outstream.println("Started cris");}
224 cris.start(); //4567
225 }
226 assert(!cris.paired());
227
228 final ConcurrentReadOutputStream rosClean;
229 if(outclean!=null){
230 final int buff=4;
231
232 assert(!outclean.equalsIgnoreCase(in1) && !outclean.equalsIgnoreCase(in1)) : "Input file and output file have same name.";
233
234 rosClean=ConcurrentReadOutputStream.getStream(ffoutclean, null, qfoutclean, null, buff, null, false);
235 rosClean.start();
236 }else{rosClean=null;}
237
238 final ConcurrentReadOutputStream rosDirty;
239 if(outdirty!=null){
240 final int buff=4;
241
242 assert(!outdirty.equalsIgnoreCase(in1) && !outdirty.equalsIgnoreCase(in1)) : "Input file and output file have same name.";
243
244 rosDirty=ConcurrentReadOutputStream.getStream(ffoutdirty, null, qfoutdirty, null, buff, null, false);
245 rosDirty.start();
246 }else{rosDirty=null;}
247
248 long readsProcessed=0;
249 long basesProcessed=0;
250
251 long basesTrimmed=0;
252 long contigsBroken=0;
253 long contigBreaks=0;
254 long contigsTrimmed=0;
255
256 long readsOut=0;
257 long basesOut=0;
258
259 long readsFiltered=0;
260 long basesFiltered=0;
261
262 long inputSeqs=0, outputSeqs=0, dirtySeqs=0;
263 long inputBases=0, outputBases=0;
264 long dirtyBases=0;
265
266 ByteStreamWriter bswBreaks=(breakListFile==null ? null :
267 ByteStreamWriter.makeBSW(breakListFile, overwrite, append, true));
268
269 {
270
271 ListNum<Read> ln=cris.nextList();
272 ArrayList<Read> reads=(ln!=null ? ln.list : null);
273
274 if(reads!=null && !reads.isEmpty()){
275 Read r=reads.get(0);
276 assert((ffin1==null || ffin1.samOrBam()) || (r.mate!=null)==cris.paired());
277 }
278
279 while(ln!=null && reads!=null && reads.size()>0){//ln!=null prevents a compiler potential null access warning
280
281 final ArrayList<Read> cleanList=new ArrayList<Read>(reads.size());
282 final ArrayList<Read> dirtyList=new ArrayList<Read>(reads.size());
283 for(int idx=0; idx<reads.size(); idx++){
284 final Read seq=reads.get(idx);
285 assert(seq.mate==null);
286
287 final int initialLength1=seq.length();
288
289 readsProcessed++;
290 basesProcessed+=initialLength1;
291
292 final ArrayList<Range> ranges=map.get(seq.id);
293 if(ranges!=null && ranges.size()>1) {
294 if(!breakContigs) {
295 Range r=toMaximalRange(ranges);
296 ranges.clear();
297 ranges.add(r);
298 }else if(skipPolyN || maxUncoveredLength>0) {
299 fixPolyN(seq, ranges);
300 }
301 }
302 ArrayList<GffLine> gffLines=(gffMap==null ? null : gffMap.get(seq.id));
303
304 if(ranges==null || ranges.isEmpty() || seq.length()-2*trimEndsMin<minLength){//Common case
305 // System.err.println("Discarding bad contig "+seq.name());
306 dirtyList.add(seq);
307 }else if(ranges.size()==1){//Common case
308 Range r=ranges.get(0);
309 r.name=seq.id;
310 Read processed=processSeq(seq, r, 1, ranges.size());
311 if(processed.discarded()) {dirtyList.add(processed);}
312 else {
313 contigsTrimmed+=processed.length()<seq.length() ? 1 : 0;
314 cleanList.add(processed);
315 processGff(ranges, gffLines, gffLinesOut);
316 }
317 contigsTrimmed+=(processed.length()==seq.length() ? 0 : 1);
318 }else {//Uncommon
319 contigsTrimmed++;
320 contigsBroken++;
321 for(int i=0; i<ranges.size(); i++) {
322 Range r=ranges.get(i);
323 Read processed=processSeq(seq, r, i, ranges.size());
324 contigBreaks++;
325 if(processed==null) {
326 //This doesn't actually happen
327 }else {
328 r.name=processed.name();
329 if(processed.discarded()) {dirtyList.add(processed);}
330 else {cleanList.add(processed);}
331 }
332 }
333 processGff(ranges, gffLines, gffLinesOut);
334 contigBreaks--;
335 // contigBreakList.add(seq.id);
336 if(bswBreaks!=null) {bswBreaks.println(seq.id);}
337 }
338 }
339
340 for(Read r : reads) {
341 inputSeqs++;
342 inputBases+=r.length();
343 }
344 for(Read r : cleanList) {
345 outputSeqs++;
346 outputBases+=r.length();
347 }
348 for(Read r : dirtyList) {
349 dirtySeqs++;
350 dirtyBases+=r.length();
351 }
352
353 if(rosClean!=null){rosClean.add(cleanList, ln.id);}
354 if(rosDirty!=null){rosDirty.add(dirtyList, ln.id);}
355
356 cris.returnList(ln);
357 ln=cris.nextList();
358 reads=(ln!=null ? ln.list : null);
359 }
360 if(ln!=null){
361 cris.returnList(ln.id, ln.list==null || ln.list.isEmpty());
362 }
363 }
364
365 readsOut=outputSeqs;
366 basesOut=outputBases;
367 readsFiltered=dirtySeqs;
368 basesFiltered=dirtyBases;
369 basesTrimmed=(inputBases-(basesOut+basesFiltered));
370
371 if(gffOut!=null) {
372 ByteStreamWriter bswGff=ByteStreamWriter.makeBSW(gffOut, overwrite, append, true);
373 bswGff.println("##gff-version 3");
374 final ByteBuilder bb=new ByteBuilder();
375 for(GffLine line : gffLinesOut) {
376 line.appendTo(bb).nl();
377 bswGff.print(bb);
378 bb.clear();
379 }
380 bswGff.poisonAndWait();
381 }
382 errorState=ReadWrite.closeStreams(cris, rosClean, rosDirty)||errorState;
383 if(bswBreaks!=null) {errorState=bswBreaks.poisonAndWait()||errorState;}
384
385 t.stop();
386
387 double rpnano=readsProcessed/(double)(t.elapsed);
388 double bpnano=basesProcessed/(double)(t.elapsed);
389
390 outstream.println("Time: "+t);
391 outstream.println("Scaffolds In: "+readsProcessed+" \t"+Tools.format("%.2fk reads/sec", rpnano*1000000));
392 outstream.println("Bases In: "+basesProcessed+" \t"+Tools.format("%.2fm bases/sec", bpnano*1000));
393 outstream.println("Scaffolds Out: "+readsOut);
394 outstream.println("Bases Out: "+basesOut);
395 outstream.println("Scaffolds Filtered: "+dirtySeqs);
396 outstream.println("Bases Filtered: "+dirtyBases);
397 outstream.println("Scaffolds Trimmed: "+contigsTrimmed);
398 outstream.println("Bases Trimmed: "+basesTrimmed);
399 outstream.println("Scaffolds Broken: "+contigsBroken);
400 outstream.println("Scaffold Breaks: "+contigBreaks);
401 // outstream.println("Broken Scaffolds: "+contigBreakList);
402
403 if(errorState){
404 throw new RuntimeException(getClass().getName()+" terminated in an error state; the output may be corrupt.");
405 }
406 }
407
408 private Read processSeq(Read seq, Range r, int partnum, int parts) {
409 // float cov=(r.depth*(r.b-r.a+1))/(seq.length());
410 float cov=r.depth;
411 r.name=seq.id;
412 if(parts==1) {//Common case
413 if(cov>=minCoverage && seq.length()>=minLength && trimEndsMin<1
414 && r.a<=maxUncoveredLength && seq.length()-r.b-1<=maxUncoveredLength) {
415 //Hopefully, common case.
416 // System.err.println("1) Returning good contig "+seq.name());
417 return seq;
418 }else if(seq.length()<minLength || cov<minCoverage) {
419 //Another common case
420 seq.setDiscarded(true);
421 // System.err.println("2) Returning bad contig "+seq.name());
422 return seq;
423 }else if(r.length()+2*maxUncoveredLength<minLength) {
424 // System.err.println("3) Returning bad contig "+seq.name());
425 //Another common case
426 seq.setDiscarded(true);
427 return seq;
428 }
429 }
430
431 if(r.a>=maxUncoveredLength) {r.a+=trimEndsExtra;}
432 else {r.a=0;}
433 r.a=Tools.mid(r.a, trimEndsMin, trimEndsMax);
434 if(seq.length()-r.b-1>maxUncoveredLength) {r.b-=trimEndsExtra;}
435 else {r.b=seq.length()-1;}
436 r.b=Tools.mid(r.b, seq.length()-trimEndsMin-1, seq.length()-trimEndsMax-1);
437
438 int trimmed=0;
439 if(r.a>0 || r.b<seq.length()-1) {
440 seq=seq.clone();
441 trimmed=TrimRead.trimToPosition(seq, r.a, r.b, 0);
442 if(parts>1) {seq.id=seq.id+"_part"+partnum;}
443 }
444
445 seq.setDiscarded(cov<minCoverage || seq.length()<minLength);
446 r.setDiscarded(seq.discarded());
447 // System.err.println("4) Returning "+(seq.discarded() ? "bad" : "good")+
448 // " contig "+seq.name()+", trimmed="+trimmed);
449 r.name=seq.id;
450 return seq;
451 }
452
453 private static void processGff(ArrayList<Range> ranges,
454 ArrayList<GffLine> gffLines, ArrayList<GffLine> gffLinesOut) {
455 if(ranges==null || gffLines==null || gffLines.isEmpty()) {return;}
456 for(Range r :ranges) {
457 // System.err.println("Processing "+r);
458 if(!r.discarded) {
459 int rlen=r.length();
460 for(GffLine line : gffLines) {
461 // System.err.println("Processing "+line);
462 int start=Tools.max(r.a+1, line.start);
463 int stop=Tools.min(r.b+1, line.stop);
464 if(start<=stop) {//Overlap
465 int a=start-1, b=stop-1;
466 int a2=a-r.a;
467 int b2=b-r.a;
468 int start2=a2+1, stop2=b2+1;
469 GffLine line2=line.clone();
470 line2.seqid=r.name;
471 line2.start=start2;
472 line2.stop=stop2;
473
474 if(line2.strand()==GffLine.PLUS) {
475 if(a<r.a && line2.phase>=0) {
476 int trimmed=r.a-a;
477 line2.phase=(line2.phase+trimmed)%3;
478 }
479 }else {
480 if(b>r.b && line2.phase>=0) {
481 int trimmed=b-r.b;
482 line2.phase=(line2.phase+trimmed)%3;
483 }
484 }
485
486 if(line2.length()>=line.length()/4) {gffLinesOut.add(line2);}
487 }
488 }
489 }
490 }
491 }
492
493 private static Range toMaximalRange(Collection<Range> ranges) {
494 assert(ranges.size()>1) : ranges.size();
495 int min=Integer.MAX_VALUE;
496 int max=-1;
497 double depthSum=0;
498 for(Range r : ranges) {
499 depthSum+=r.depthSum();
500 min=Tools.min(min, r.a);
501 max=Tools.max(max, r.b);
502 }
503 Range r=new Range(min, max);
504 r.depth=(float)(depthSum/r.length());
505 return r;
506 }
507
508 /** Fuses adjacent ranges separated by fewer than
509 * maxUncoveredLength uncovered defined bases. */
510 private int fixPolyN(Read seq, ArrayList<Range> ranges) {
511 assert(ranges.size()>1);
512 final byte[] bases=seq.bases;
513 ArrayList<Range> fixed=new ArrayList<Range>(ranges.size());
514 int fusions=0;
515 for(int i=0, j=1; j<ranges.size(); i++, j++) {
516 Range left=ranges.get(i), right=ranges.get(j);
517 int defined=0, undefined=0;
518 for(int k=left.b+1; k<right.a; k++) {
519 byte b=bases[k];
520 if(AminoAcid.isFullyDefined(b)) {
521 defined++;
522 }else {
523 undefined++;
524 }
525 }
526 if(!skipPolyN) {
527 defined+=undefined;
528 undefined=0;
529 }
530 if(defined<=maxUncoveredLength ||
531 (undefined>0 && defined<=maxUncoveredLength*2)) {//fuse
532 right.absorb(left);
533 fusions++;
534 }else {
535 fixed.add(left);
536 }
537 }
538 fixed.add(ranges.get(ranges.size()-1));
539 ranges.clear();
540 ranges.addAll(fixed);
541 return fusions;
542 }
543
544 /*--------------------------------------------------------------*/
545
546 private void loadGff(String s) {
547 gffLinesIn=GffLine.loadGffFile(gffIn, null, false);
548 gffMap=new HashMap<String, ArrayList<GffLine>>();
549 for(GffLine line : gffLinesIn) {
550 ArrayList<GffLine> list=gffMap.get(line.seqid);
551 if(list==null) {
552 list=new ArrayList<GffLine>();
553 gffMap.put(line.seqid, list);
554 }
555 list.add(line);
556 }
557 gffLinesOut=new ArrayList<GffLine>();
558 // assert(false) : gffMap.size()+", "+gffLinesIn.size();
559 }
560
561 private static class Range {
562 public Range(int a_, int b_) {
563 a=a_;
564 b=b_;
565 }
566 public Range(int a_, int b_, float depth_) {
567 a=a_;
568 b=b_;
569 depth=depth_;
570 }
571 public void absorb(Range r) {
572 float depthsum=depthSum()+r.depthSum();
573 a=Tools.min(a, r.a);
574 b=Tools.max(b, r.b);
575 depth=(depth==-1 ? -1 : depthsum/length());
576 }
577 public void setDiscarded(boolean discarded_) {
578 discarded=discarded_;
579 }
580 @Override
581 public String toString() {
582 return name+"("+a+"-"+b+")";
583 }
584 public int length() {return b-a+1;}
585 public float depthSum() {return depth*length();}
586 int a;
587 int b;
588 float depth=-1;
589 boolean discarded=false;
590 String name;
591 }
592
593 /*--------------------------------------------------------------*/
594
595 private String in1=null;
596 private String covRanges=null;
597 private String name=null;
598
599 private String qfin1=null;
600
601 private String outclean=null;
602 private String outdirty=null;
603
604 private String qfoutclean=null;
605 private String qfoutdirty=null;
606
607 private String extin=null;
608 private String extout=null;
609
610 private String gffIn=null;
611 private String gffOut=null;
612
613 /*--------------------------------------------------------------*/
614
615 private ArrayList<GffLine> gffLinesIn;
616 // private HashMap<StringNum, GffLine> lineMap;
617 private HashMap<String, ArrayList<GffLine>> gffMap;
618 private ArrayList<GffLine> gffLinesOut;
619
620 /*--------------------------------------------------------------*/
621
622 private long maxReads=-1;
623
624 /** Scaffolds shorter than this will be discarded. */
625 private int minLength=1;
626 /** Scaffolds with lower average coverage will be discarded. */
627 private double minCoverage=1;
628 /** Scaffolds with a lower percent of covered bases will be discarded. */
629 private double minCoveredPercent=0;
630
631 /** Trim this much from sequence ends, minimum */
632 private int trimEndsMin=0;
633
634 /** Trim this much from sequence ends, maximum */
635 private int trimEndsMax=2000000000;
636
637 /** Trim this far into covered areas */
638 private int trimEndsExtra=5;
639
640 /** Uncovered areas longer than this will trigger trimming */
641 private int maxUncoveredLength=3;
642
643 /** Permission to break apart contigs at uncovered areas */
644 boolean breakContigs=true;
645 boolean skipPolyN=true;
646 String breakListFile;
647
648 /*--------------------------------------------------------------*/
649
650 private final FileFormat ffin1;
651 // private final FileFormat ffCov;
652 private final FileFormat ffRange;
653
654 private final FileFormat ffoutclean;
655 private final FileFormat ffoutdirty;
656
657
658 /*--------------------------------------------------------------*/
659
660 private PrintStream outstream=System.err;
661 public static boolean verbose=false;
662 public boolean errorState=false;
663 private boolean overwrite=true;
664 private boolean append=false;
665 private boolean logappend=false;
666 private String logfile=null;
667 private boolean logheader=true;
668 private static boolean PRINT_SHORT_CONTIG_RESULTS=false;
669
670 }