jpayne@68: package sketch; jpayne@68: jpayne@68: import java.io.PrintStream; jpayne@68: import java.util.ArrayList; jpayne@68: import java.util.Arrays; jpayne@68: jpayne@68: import fileIO.ByteFile; jpayne@68: import fileIO.ByteStreamWriter; jpayne@68: import fileIO.FileFormat; jpayne@68: import fileIO.ReadWrite; jpayne@68: import shared.Parse; jpayne@68: import shared.Parser; jpayne@68: import shared.PreParser; jpayne@68: import shared.Shared; jpayne@68: import shared.Timer; jpayne@68: import shared.Tools; jpayne@68: import structures.ByteBuilder; jpayne@68: import tax.TaxTree; jpayne@68: jpayne@68: /** jpayne@68: * @author Brian Bushnell jpayne@68: * @date May 9, 2016 jpayne@68: * jpayne@68: */ jpayne@68: public class AddSSU { jpayne@68: jpayne@68: /*--------------------------------------------------------------*/ jpayne@68: /*---------------- Initialization ----------------*/ jpayne@68: /*--------------------------------------------------------------*/ jpayne@68: jpayne@68: /** jpayne@68: * Code entrance from the command line. jpayne@68: * @param args Command line arguments jpayne@68: */ jpayne@68: public static void main(String[] args){ jpayne@68: //Start a timer immediately upon code entrance. jpayne@68: Timer t=new Timer(); jpayne@68: jpayne@68: //Create an instance of this class jpayne@68: AddSSU x=new AddSSU(args); jpayne@68: jpayne@68: //Run the object jpayne@68: x.process(t); jpayne@68: jpayne@68: //Close the print stream if it was redirected jpayne@68: Shared.closeStream(x.outstream); jpayne@68: } jpayne@68: jpayne@68: /** jpayne@68: * Constructor. jpayne@68: * @param args Command line arguments jpayne@68: */ jpayne@68: public AddSSU(String[] args){ jpayne@68: jpayne@68: {//Preparse block for help, config files, and outstream jpayne@68: PreParser pp=new PreParser(args, /*getClass()*/null, false); jpayne@68: args=pp.args; jpayne@68: outstream=pp.outstream; jpayne@68: } jpayne@68: jpayne@68: //Set shared static variables prior to parsing jpayne@68: ReadWrite.USE_PIGZ=ReadWrite.USE_UNPIGZ=true; jpayne@68: ReadWrite.MAX_ZIP_THREADS=Shared.threads(); jpayne@68: jpayne@68: {//Parse the arguments jpayne@68: final Parser parser=parse(args); jpayne@68: overwrite=parser.overwrite; jpayne@68: append=parser.append; jpayne@68: jpayne@68: in1=parser.in1; jpayne@68: jpayne@68: out1=parser.out1; jpayne@68: } jpayne@68: jpayne@68: fixExtensions(); //Add or remove .gz or .bz2 as needed jpayne@68: checkFileExistence(); //Ensure files can be read and written jpayne@68: checkStatics(); //Adjust file-related static fields as needed for this program jpayne@68: jpayne@68: ffout1=FileFormat.testOutput(out1, FileFormat.SKETCH, null, true, overwrite, append, false); jpayne@68: ffin1=FileFormat.testInput(in1, FileFormat.SKETCH, null, true, false); jpayne@68: jpayne@68: if(verbose){ jpayne@68: System.err.println("Set r16SFile="+r16SFile); jpayne@68: System.err.println("Set r18SFile="+r18SFile); jpayne@68: } jpayne@68: jpayne@68: tree=(treeFile!=null && (preferSSUMapEuks || preferSSUMapProks || clear16SEuks || clear18SEuks || jpayne@68: clear16SProks || clear18SProks || useSSUMapOnlyEuks || useSSUMapOnlyProks) ? TaxTree.loadTaxTree(treeFile, outstream, false, false) : null); jpayne@68: jpayne@68: if(preferSSUMapEuks || preferSSUMapProks || clear16SEuks || clear18SEuks || clear16SProks || clear18SProks || useSSUMapOnlyEuks || useSSUMapOnlyProks){ jpayne@68: assert(tree!=null) : "preferSSUMapForEuks, clear16SEuks, and clear18SEuks require a TaxTree."; jpayne@68: } jpayne@68: } jpayne@68: jpayne@68: /*--------------------------------------------------------------*/ jpayne@68: /*---------------- Initialization Helpers ----------------*/ jpayne@68: /*--------------------------------------------------------------*/ jpayne@68: jpayne@68: /** Parse arguments from the command line */ jpayne@68: private Parser parse(String[] args){ jpayne@68: jpayne@68: Parser parser=new Parser(); jpayne@68: for(int i=0; i1 ? split[1] : null; jpayne@68: if(b!=null && b.equalsIgnoreCase("null")){b=null;} jpayne@68: jpayne@68: if(a.equalsIgnoreCase("16S") || a.equalsIgnoreCase("16Sfile")){ jpayne@68: r16SFile=b; jpayne@68: }else if(a.equalsIgnoreCase("18S") || a.equalsIgnoreCase("18Sfile")){ jpayne@68: r18SFile=b; jpayne@68: }else if(a.equalsIgnoreCase("tree") || a.equalsIgnoreCase("treefile")){ jpayne@68: treeFile=b; jpayne@68: }else if(a.equals("lines")){ jpayne@68: maxLines=Long.parseLong(b); jpayne@68: if(maxLines<0){maxLines=Long.MAX_VALUE;} jpayne@68: }else if(a.equals("verbose")){ jpayne@68: verbose=Parse.parseBoolean(b); jpayne@68: // ByteFile1.verbose=verbose; jpayne@68: // ByteFile2.verbose=verbose; jpayne@68: // ReadWrite.verbose=verbose; jpayne@68: } jpayne@68: jpayne@68: else if(a.equalsIgnoreCase("preferSSUMap")){ jpayne@68: preferSSUMap=Parse.parseBoolean(b); jpayne@68: }else if(a.equalsIgnoreCase("preferSSUMapForEuks") || a.equalsIgnoreCase("preferSSUMapEuks")){ jpayne@68: preferSSUMapEuks=Parse.parseBoolean(b); jpayne@68: }else if(a.equalsIgnoreCase("useSSUMapOnly")){ jpayne@68: useSSUMapOnly=Parse.parseBoolean(b); jpayne@68: }else if(a.equalsIgnoreCase("useSSUMapOnlyEuks") || a.equalsIgnoreCase("SSUMapOnlyEuks")){ jpayne@68: useSSUMapOnlyEuks=Parse.parseBoolean(b); jpayne@68: }else if(a.equalsIgnoreCase("useSSUMapOnlyProks") || a.equalsIgnoreCase("SSUMapOnlyProks")){ jpayne@68: useSSUMapOnlyProks=Parse.parseBoolean(b); jpayne@68: }else if(a.equalsIgnoreCase("preferSSUMapForProks") || a.equalsIgnoreCase("preferSSUMapProks")){ jpayne@68: preferSSUMapProks=Parse.parseBoolean(b); jpayne@68: } jpayne@68: jpayne@68: else if(a.equalsIgnoreCase("clearAll")){ jpayne@68: clear16S=clear18S=Parse.parseBoolean(b); jpayne@68: }else if(a.equalsIgnoreCase("clear16S")){ jpayne@68: clear16S=Parse.parseBoolean(b); jpayne@68: }else if(a.equalsIgnoreCase("clear18S")){ jpayne@68: clear18S=Parse.parseBoolean(b); jpayne@68: }else if(a.equalsIgnoreCase("clear16SEuks")){ jpayne@68: clear16SEuks=Parse.parseBoolean(b); jpayne@68: }else if(a.equalsIgnoreCase("clear18SEuks")){ jpayne@68: clear18SEuks=Parse.parseBoolean(b); jpayne@68: }else if(a.equalsIgnoreCase("clear16SProks")){ jpayne@68: clear16SProks=Parse.parseBoolean(b); jpayne@68: }else if(a.equalsIgnoreCase("clear18SProks")){ jpayne@68: clear18SProks=Parse.parseBoolean(b); jpayne@68: } jpayne@68: jpayne@68: else if(parser.parse(arg, a, b)){ jpayne@68: //do nothing jpayne@68: }else{ jpayne@68: outstream.println("Unknown parameter "+args[i]); jpayne@68: assert(false) : "Unknown parameter "+args[i]; jpayne@68: // throw new RuntimeException("Unknown parameter "+args[i]); jpayne@68: } jpayne@68: } jpayne@68: if("auto".equalsIgnoreCase(r16SFile)){r16SFile=TaxTree.default16SFile();} jpayne@68: if("auto".equalsIgnoreCase(r18SFile)){r18SFile=TaxTree.default18SFile();} jpayne@68: SSUMap.r16SFile=r16SFile; jpayne@68: SSUMap.r18SFile=r18SFile; jpayne@68: jpayne@68: return parser; jpayne@68: } jpayne@68: jpayne@68: /** Add or remove .gz or .bz2 as needed */ jpayne@68: private void fixExtensions(){ jpayne@68: in1=Tools.fixExtension(in1); jpayne@68: if(in1==null){throw new RuntimeException("Error - at least one input file is required.");} jpayne@68: } jpayne@68: jpayne@68: /** Ensure files can be read and written */ jpayne@68: private void checkFileExistence(){ jpayne@68: //Ensure output files can be written jpayne@68: if(!Tools.testOutputFiles(overwrite, append, false, out1)){ jpayne@68: outstream.println((out1==null)+", "+out1); jpayne@68: throw new RuntimeException("\n\noverwrite="+overwrite+"; Can't write to output file "+out1+"\n"); jpayne@68: } jpayne@68: jpayne@68: //Ensure input files can be read jpayne@68: if(!Tools.testInputFiles(false, true, in1, r16SFile, r18SFile)){ jpayne@68: throw new RuntimeException("\nCan't read some input files.\n"); jpayne@68: } jpayne@68: assert(in1!=null) : "Input sketch file is required"; jpayne@68: assert(r16SFile!=null || r18SFile!=null) : "Input SSU file is required"; jpayne@68: jpayne@68: //Ensure that no file was specified multiple times jpayne@68: if(!Tools.testForDuplicateFiles(true, in1, out1, r16SFile, r18SFile)){ jpayne@68: throw new RuntimeException("\nSome file names were specified multiple times.\n"); jpayne@68: } jpayne@68: } jpayne@68: jpayne@68: /** Adjust file-related static fields as needed for this program */ jpayne@68: private static void checkStatics(){ jpayne@68: //Adjust the number of threads for input file reading jpayne@68: if(!ByteFile.FORCE_MODE_BF1 && !ByteFile.FORCE_MODE_BF2 && Shared.threads()>2){ jpayne@68: ByteFile.FORCE_MODE_BF2=true; jpayne@68: } jpayne@68: jpayne@68: // if(!ByteFile.FORCE_MODE_BF2){ jpayne@68: // ByteFile.FORCE_MODE_BF2=false; jpayne@68: // ByteFile.FORCE_MODE_BF1=true; jpayne@68: // } jpayne@68: } jpayne@68: jpayne@68: /*--------------------------------------------------------------*/ jpayne@68: /*---------------- Outer Methods ----------------*/ jpayne@68: /*--------------------------------------------------------------*/ jpayne@68: jpayne@68: void process(Timer t){ jpayne@68: jpayne@68: ByteFile bf=ByteFile.makeByteFile(ffin1); jpayne@68: ByteStreamWriter bsw=makeBSW(ffout1); jpayne@68: jpayne@68: processInner(bf, bsw); jpayne@68: jpayne@68: errorState|=bf.close(); jpayne@68: if(bsw!=null){errorState|=bsw.poisonAndWait();} jpayne@68: jpayne@68: t.stop(); jpayne@68: jpayne@68: outstream.println(Tools.timeLinesBytesProcessed(t, linesProcessed, bytesProcessed, 8)); jpayne@68: outstream.println(Tools.linesBytesOut(linesProcessed, bytesProcessed, linesOut, bytesOut, 8, true)); jpayne@68: jpayne@68: outstream.println(); jpayne@68: outstream.println(Tools.number("Sketches:", sketchCount, 8)); jpayne@68: outstream.println(Tools.number("16S In:", r16Sin, 8)); jpayne@68: outstream.println(Tools.number("18S In:", r18Sin, 8)); jpayne@68: outstream.println(Tools.number("16S Added:", r16SfromMap, 8)); jpayne@68: outstream.println(Tools.number("18S Added:", r18SfromMap, 8)); jpayne@68: outstream.println(Tools.numberPercent("16S Out:", r16Sout, r16Sout*100.0/sketchCount, 2, 8)); jpayne@68: outstream.println(Tools.numberPercent("18S Out:", r18Sout, r18Sout*100.0/sketchCount, 2, 8)); jpayne@68: jpayne@68: if(errorState){ jpayne@68: throw new RuntimeException(getClass().getName()+" terminated in an error state; the output may be corrupt."); jpayne@68: } jpayne@68: } jpayne@68: jpayne@68: /*--------------------------------------------------------------*/ jpayne@68: /*---------------- Inner Methods ----------------*/ jpayne@68: /*--------------------------------------------------------------*/ jpayne@68: jpayne@68: private static ByteStreamWriter makeBSW(FileFormat ff){ jpayne@68: if(ff==null){return null;} jpayne@68: ByteStreamWriter bsw=new ByteStreamWriter(ff); jpayne@68: bsw.start(); jpayne@68: return bsw; jpayne@68: } jpayne@68: jpayne@68: // private void processInner_old(ByteFile bf, ByteStreamWriter bsw){ jpayne@68: // SSUMap.load(outstream); jpayne@68: // jpayne@68: // if(verbose){ jpayne@68: // System.err.println("Loaded SSUMap; |16S|="+SSUMap.r16SCount()+", |18S|="+SSUMap.r18SCount()); jpayne@68: // } jpayne@68: // jpayne@68: // byte[] line=bf.nextLine(); jpayne@68: //// ByteBuilder bb=new ByteBuilder(); jpayne@68: // jpayne@68: // final byte[] ssuBytes="SSU:".getBytes(); jpayne@68: // final byte[] r16SBytes="16S:".getBytes(); jpayne@68: // final byte[] r18SBytes="18S:".getBytes(); jpayne@68: // jpayne@68: // while(line!=null){ jpayne@68: // if(line.length>0){ jpayne@68: // if(maxLines>0 && linesProcessed>=maxLines){break;} jpayne@68: // linesProcessed++; jpayne@68: // bytesProcessed+=(line.length+1); jpayne@68: // jpayne@68: // final boolean header=(line[0]=='#'); jpayne@68: // jpayne@68: // linesOut++; jpayne@68: // bytesOut+=(line.length+1); jpayne@68: // jpayne@68: // if(header){ jpayne@68: // if(Tools.startsWith(line, "#SZ:")){ jpayne@68: // sketchCount++; jpayne@68: // jpayne@68: // bsw.print(line); jpayne@68: // jpayne@68: // final int tid=parseTaxID(line); jpayne@68: // final boolean has16S=Tools.contains(line, ssuBytes, 0) || Tools.contains(line, r16SBytes, 0); jpayne@68: // final boolean has18S=Tools.contains(line, r18SBytes, 0); jpayne@68: // jpayne@68: // if(verbose){ jpayne@68: // System.err.println("For line "+new String(line)+":"); jpayne@68: // System.err.println("tid="+tid+", has16S="+has16S+", has18S="+has18S); jpayne@68: // } jpayne@68: // jpayne@68: // if(tid>0){ jpayne@68: // final byte[] r16S=has16S ? null : SSUMap.r16SMap.get(tid); jpayne@68: // final byte[] r18S=has18S ? null : SSUMap.r18SMap.get(tid); jpayne@68: // if(r16S!=null){bsw.print("\t16S:").print(r16S.length); ssuOut++;} jpayne@68: // if(r18S!=null){bsw.print("\t18S:").print(r18S.length); ssuOut++;} jpayne@68: // if(r16S!=null){bsw.print("\n#16S:").print(r16S);} jpayne@68: // if(r18S!=null){bsw.print("\n#18S:").print(r18S);} jpayne@68: // jpayne@68: // if(verbose){System.err.println("Found 16S: "+(r16S!=null)+"; found 18S: "+(r18S!=null));} jpayne@68: // } jpayne@68: // bsw.println(); jpayne@68: // }else if(Tools.startsWith(line, "#16S:") || Tools.startsWith(line, "#18S:") || Tools.startsWith(line, "#SSU:")){ jpayne@68: // bsw.println(line); jpayne@68: // ssuIn++; jpayne@68: // ssuOut++; jpayne@68: // }else{ jpayne@68: // assert(Tools.startsWith(line, "##")) : new String(line); jpayne@68: // bsw.println(line); jpayne@68: // } jpayne@68: // }else{ jpayne@68: // bsw.println(line); jpayne@68: // } jpayne@68: // } jpayne@68: // line=bf.nextLine(); jpayne@68: // } jpayne@68: // } jpayne@68: jpayne@68: private void processInner(ByteFile bf, ByteStreamWriter bsw){ jpayne@68: SSUMap.load(outstream); jpayne@68: jpayne@68: if(verbose){ jpayne@68: System.err.println("Loaded SSUMap; |16S|="+SSUMap.r16SCount()+", |18S|="+SSUMap.r18SCount()); jpayne@68: } jpayne@68: jpayne@68: byte[] line=bf.nextLine(); jpayne@68: // ByteBuilder bb=new ByteBuilder(); jpayne@68: jpayne@68: // final byte[] ssuBytes="SSU:".getBytes(); jpayne@68: // final byte[] r16SBytes="16S:".getBytes(); jpayne@68: // final byte[] r18SBytes="18S:".getBytes(); jpayne@68: jpayne@68: SketchHeader header=null; jpayne@68: while(line!=null){ jpayne@68: if(line.length>0){ jpayne@68: if(maxLines>0 && linesProcessed>=maxLines){break;} jpayne@68: linesProcessed++; jpayne@68: bytesProcessed+=(line.length+1); jpayne@68: jpayne@68: final boolean isHeader=(line[0]=='#'); jpayne@68: jpayne@68: if(isHeader){ jpayne@68: if(Tools.startsWith(line, "#SZ:")){ jpayne@68: assert(header==null) : "\nReplacing this:\n"+header.toBytes()+"\nWith this:\n"+new String(line)+"\n"; jpayne@68: header=new SketchHeader(line); jpayne@68: sketchCount++; jpayne@68: }else if(Tools.startsWith(line, "##")){ jpayne@68: bsw.println(line); jpayne@68: jpayne@68: linesOut++; jpayne@68: bytesOut+=(line.length+1); jpayne@68: }else{ jpayne@68: header.addLine(line); jpayne@68: } jpayne@68: }else{ jpayne@68: if(header!=null){ jpayne@68: try { jpayne@68: processHeader(header); jpayne@68: } catch (Throwable e) { jpayne@68: e.printStackTrace(); jpayne@68: assert(false) : header.toBytes(); jpayne@68: } jpayne@68: r16Sout+=(header.r16S==null ? 0 : 1); jpayne@68: r18Sout+=(header.r18S==null ? 0 : 1); jpayne@68: linesOut+=1+(header.r16S==null ? 0 : 1)+(header.r18S==null ? 0 : 1); jpayne@68: ByteBuilder bb=header.toBytes(); jpayne@68: bytesOut+=(bb.length+1); jpayne@68: bsw.println(bb); jpayne@68: header=null; jpayne@68: } jpayne@68: bsw.println(line); jpayne@68: jpayne@68: linesOut++; jpayne@68: bytesOut+=(line.length+1); jpayne@68: } jpayne@68: } jpayne@68: line=bf.nextLine(); jpayne@68: } jpayne@68: } jpayne@68: jpayne@68: void processHeader(SketchHeader header){ jpayne@68: jpayne@68: if(verbose){System.err.println("Processing tid "+header.tid+":\n"+header.toBytes()+"\n");} jpayne@68: jpayne@68: final boolean euk=(tree!=null && header.tid>0 && header.tid0 && header.tid0){ jpayne@68: final boolean preferMap=(preferSSUMap || (preferSSUMapEuks && euk) || (preferSSUMapProks && prok)); jpayne@68: byte[] r16S=(SSUMap.r16SMap==null ? null : SSUMap.r16SMap.get(header.tid)); jpayne@68: byte[] r18S=(SSUMap.r18SMap==null ? null : SSUMap.r18SMap.get(header.tid)); jpayne@68: if(r16S!=null && (preferMap || header.r16S==null)){ jpayne@68: header.r16S=r16S; jpayne@68: r16SfromMap++; jpayne@68: } jpayne@68: if(r18S!=null && (preferMap || header.r18S==null)){ jpayne@68: header.r18S=r18S; jpayne@68: r18SfromMap++; jpayne@68: } jpayne@68: } jpayne@68: if(clear16S || (clear16SEuks && euk) || (clear16SProks && prok)){header.r16S=null;} jpayne@68: if(clear18S || (clear18SEuks && euk) || (clear18SProks && prok)){header.r18S=null;} jpayne@68: } jpayne@68: jpayne@68: int parseTaxID(byte[] line){ jpayne@68: String[] split=Tools.tabPattern.split(new String(line)); jpayne@68: for(String s : split){ jpayne@68: if(s.startsWith("ID:") || s.startsWith("TAXID:")){ jpayne@68: final int colon=s.indexOf(':'); jpayne@68: final String sub=s.substring(colon+1); jpayne@68: return Integer.parseInt(sub); jpayne@68: } jpayne@68: } jpayne@68: return -1; jpayne@68: } jpayne@68: jpayne@68: /*--------------------------------------------------------------*/ jpayne@68: jpayne@68: //A very limited parser jpayne@68: private class SketchHeader { jpayne@68: jpayne@68: SketchHeader(byte[] line){ jpayne@68: this(new String(line, 1, line.length-1)); jpayne@68: } jpayne@68: jpayne@68: SketchHeader(String line){ jpayne@68: if(line.charAt(0)=='#'){line=line.substring(1);} jpayne@68: assert(line.startsWith("SZ:")); jpayne@68: String[] split=Tools.tabPattern.split(line); jpayne@68: fields=new ArrayList(line.length()+2); jpayne@68: int tid_=-1; jpayne@68: for(String s : split){ jpayne@68: if(s.startsWith("16S:") || s.startsWith("18S:") || s.startsWith("SSU:")){ jpayne@68: //do nothing jpayne@68: }else{ jpayne@68: if(s.startsWith("ID:") || s.startsWith("TAXID:")){ jpayne@68: final int colon=s.indexOf(':'); jpayne@68: final String sub=s.substring(colon+1); jpayne@68: tid_=Integer.parseInt(sub); jpayne@68: } jpayne@68: fields.add(s); jpayne@68: } jpayne@68: } jpayne@68: tid=tid_; jpayne@68: } jpayne@68: jpayne@68: void addLine(byte[] line){ jpayne@68: assert(line[0]=='#'); jpayne@68: assert(line[1]=='1' || line[1]=='S') : new String(line); jpayne@68: if(Tools.startsWith(line, "#16S:") || Tools.startsWith(line, "#SSU:")){ jpayne@68: assert(r16S==null); jpayne@68: r16S=Arrays.copyOfRange(line, 5, line.length); jpayne@68: r16Sin++; jpayne@68: }else if(Tools.startsWith(line, "#18S:")){ jpayne@68: assert(r18S==null); jpayne@68: r18S=Arrays.copyOfRange(line, 5, line.length); jpayne@68: r18Sin++; jpayne@68: }else{ jpayne@68: assert(false) : new String(line); jpayne@68: } jpayne@68: } jpayne@68: jpayne@68: ByteBuilder toBytes(){ jpayne@68: ByteBuilder bb=new ByteBuilder(1000); jpayne@68: bb.append('#'); jpayne@68: for(int i=0; i0){bb.tab();} jpayne@68: bb.append(fields.get(i)); jpayne@68: } jpayne@68: if(r16S!=null){bb.tab().append("16S:").append(r16S.length);} jpayne@68: if(r18S!=null){bb.tab().append("18S:").append(r18S.length);} jpayne@68: jpayne@68: if(r16S!=null){bb.nl().append("#16S:").append(r16S);} jpayne@68: if(r18S!=null){bb.nl().append("#18S:").append(r18S);} jpayne@68: return bb; jpayne@68: } jpayne@68: jpayne@68: final int tid; jpayne@68: ArrayList fields; jpayne@68: byte[] r16S; jpayne@68: byte[] r18S; jpayne@68: } jpayne@68: jpayne@68: /*--------------------------------------------------------------*/ jpayne@68: /*---------------- Fields ----------------*/ jpayne@68: /*--------------------------------------------------------------*/ jpayne@68: jpayne@68: private String in1=null; jpayne@68: private String out1=null; jpayne@68: private String r16SFile="auto"; jpayne@68: private String r18SFile="auto"; jpayne@68: private String treeFile="auto"; jpayne@68: jpayne@68: boolean preferSSUMap=false; jpayne@68: boolean preferSSUMapEuks=false; jpayne@68: boolean preferSSUMapProks=false; jpayne@68: boolean useSSUMapOnly=false; jpayne@68: boolean useSSUMapOnlyEuks=false; jpayne@68: boolean useSSUMapOnlyProks=false; jpayne@68: boolean clear16S=false; jpayne@68: boolean clear18S=false; jpayne@68: boolean clear16SEuks=false; jpayne@68: boolean clear18SEuks=false; jpayne@68: boolean clear16SProks=false; jpayne@68: boolean clear18SProks=false; jpayne@68: jpayne@68: /*--------------------------------------------------------------*/ jpayne@68: jpayne@68: private long linesProcessed=0; jpayne@68: private long linesOut=0; jpayne@68: private long bytesProcessed=0; jpayne@68: private long bytesOut=0; jpayne@68: jpayne@68: private long sketchCount=0; jpayne@68: jpayne@68: private long r16Sin=0; jpayne@68: private long r16Sout=0; jpayne@68: private long r16SfromMap=0; jpayne@68: private long r18Sin=0; jpayne@68: private long r18Sout=0; jpayne@68: private long r18SfromMap=0; jpayne@68: jpayne@68: private long maxLines=Long.MAX_VALUE; jpayne@68: jpayne@68: /*--------------------------------------------------------------*/ jpayne@68: /*---------------- Final Fields ----------------*/ jpayne@68: /*--------------------------------------------------------------*/ jpayne@68: jpayne@68: private final FileFormat ffin1; jpayne@68: private final FileFormat ffout1; jpayne@68: jpayne@68: private final TaxTree tree; jpayne@68: jpayne@68: /*--------------------------------------------------------------*/ jpayne@68: /*---------------- Common Fields ----------------*/ jpayne@68: /*--------------------------------------------------------------*/ jpayne@68: jpayne@68: private PrintStream outstream=System.err; jpayne@68: public static boolean verbose=false; jpayne@68: public boolean errorState=false; jpayne@68: private boolean overwrite=false; jpayne@68: private boolean append=false; jpayne@68: jpayne@68: }