// Path: src/thesaurus/util/ThesaurusLog.java
// public class ThesaurusLog {
// 
//     private final static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//     private final PrintStream logstream;
//     private boolean verbose = false;
// 
//     public ThesaurusLog(PrintStream logstream) {
//         this.logstream = logstream;
//     }
// 
//     public ThesaurusLog() {
//         this.logstream = System.out;
//     }
// 
//     public boolean isVerbose() {
//         return verbose;
//     }
// 
//     public void setVerbose(boolean verbose) {
//         this.verbose = verbose;
//     }
// 
//     /**
//      * output comment, but only if verbose level for this log has been set to
//      * true
//      *
//      * @param s
//      *
//      * comment string to display in the log
//      */
//     public void log(String s) {
//         if (verbose) {
//             logstream.println("[Thesaurus][" + sdf.format(new Date()) + "] " + s);
//             logstream.flush();
//         }
//     }
// 
//     /**
//      * output comment
//      *
//      * @param verbose
//      *
//      * verbose level for this comment. will temporarily override verbose level
//      * for the class.
//      *
//      * @param s
//      *
//      * comment string to display in the log
//      *
//      */
//     public void log(boolean verbose, String s) {
//         if (verbose) {
//             logstream.println("[Thesaurus][" + sdf.format(new Date()) + "] " + s);
//             logstream.flush();
//         }
//     }
// }
// 
// Path: src/thesaurus/util/ThesaurusIO.java
// public class ThesaurusIO {
// 
//     private static String spaceRepeat(int n) {
//         StringBuilder sb = new StringBuilder();
//         for (int i = 0; i < n; i++) {
//             sb.append(" ");
//         }
//         return (sb.toString());
//     }
// 
//     public static void printHelpItem(String key, String description) {
//         int keylength = key.length();
// 
//         // split the description into multiple lines
//         String[] dtokens = description.split(" ");
//         ArrayList<String> dlines = new ArrayList<String>();
//         String nowline = "";
//         int nowtoken = 0;
//         while (nowtoken < dtokens.length) {
//             if (nowline.length() > 50) {
//                 dlines.add(nowline + "\n");
//                 nowline = "";
//             }
//             nowline += dtokens[nowtoken] + " ";
//             nowtoken++;
//         }
//         dlines.add(nowline + "\n");
// 
// 
//         StringBuilder sb = new StringBuilder();
//         if (key.length() < 30) {
//             sb.append("  ").append(key);
//             sb.append(spaceRepeat(26 - keylength));
//         } else {
//             sb.append("  ").append(key).append("\n");
//             sb.append(spaceRepeat(28));
//         }
//         sb.append("- ").append(dlines.get(0));
//         for (int i = 1; i < dlines.size(); i++) {
//             sb.append(spaceRepeat(30)).append(dlines.get(i));
//         }
// 
//         System.out.print(sb.toString());
//     }
// }


import thesaurus.util.ThesaurusLog;
import thesaurus.util.ThesaurusIO;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.OutputStream;
import java.util.HashMap;
import joptsimple.OptionParser;
import joptsimple.OptionSet;
import jsequtils.file.BufferedReaderMaker;
import jsequtils.file.OutputStreamMaker;
import jsequtils.genome.GenomeInfo;
import jsequtils.genome.GenomePositionComparator;
import jsequtils.variants.VCFEntry;
import jsequtils.variants.VCFEntrySet;
                }

                // check for thesaurus status anyway (to keep synonyms on track)                
                if (hasFilter(nowentry.getFilter(), "thesaurus") && synonymsfile != null) {
                    // check that the synonyms are synced with the vcf file
                    String entrycode = vcfEntryString(nowentry);
                    String[] synonyms = synline.split("\t");
                    if (!synonyms[0].equals(entrycode)) {
                        System.out.println("Desynced vcf and synonyms files: " + synonyms[0] + " " + entrycode);
                        return;
                    }

                    // try if the synonyms are in the reference set
                    int synlen = synonyms.length;
                    int syntrue = -1;
                    boolean nowTPthes = false;
                    for (int i = 0; i < synlen; i++) {
                        if (refset.containsPosition(synonyms[i])) {
                            FNmap.put(synonyms[i], false);
                            syntrue = i;
                            nowTPthes = true;
                            i = synlen;
                        }
                    }

                    if (!nowTP) {
                        if (nowTPthes) {
                            outTPthes.write(nowentry.toString().getBytes());
                            countTPthes++;
                        } else {
// Path: src/thesaurus/util/ThesaurusLog.java
// public class ThesaurusLog {
// 
//     private final static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//     private final PrintStream logstream;
//     private boolean verbose = false;
// 
//     public ThesaurusLog(PrintStream logstream) {
//         this.logstream = logstream;
//     }
// 
//     public ThesaurusLog() {
//         this.logstream = System.out;
//     }
// 
//     public boolean isVerbose() {
//         return verbose;
//     }
// 
//     public void setVerbose(boolean verbose) {
//         this.verbose = verbose;
//     }
// 
//     /**
//      * output comment, but only if verbose level for this log has been set to
//      * true
//      *
//      * @param s
//      *
//      * comment string to display in the log
//      */
//     public void log(String s) {
//         if (verbose) {
//             logstream.println("[Thesaurus][" + sdf.format(new Date()) + "] " + s);
//             logstream.flush();
//         }
//     }
// 
//     /**
//      * output comment
//      *
//      * @param verbose
//      *
//      * verbose level for this comment. will temporarily override verbose level
//      * for the class.
//      *
//      * @param s
//      *
//      * comment string to display in the log
//      *
//      */
//     public void log(boolean verbose, String s) {
//         if (verbose) {
//             logstream.println("[Thesaurus][" + sdf.format(new Date()) + "] " + s);
//             logstream.flush();
//         }
//     }
// }
// 
// Path: src/thesaurus/util/ThesaurusIO.java
// public class ThesaurusIO {
// 
//     private static String spaceRepeat(int n) {
//         StringBuilder sb = new StringBuilder();
//         for (int i = 0; i < n; i++) {
//             sb.append(" ");
//         }
//         return (sb.toString());
//     }
// 
//     public static void printHelpItem(String key, String description) {
//         int keylength = key.length();
// 
//         // split the description into multiple lines
//         String[] dtokens = description.split(" ");
//         ArrayList<String> dlines = new ArrayList<String>();
//         String nowline = "";
//         int nowtoken = 0;
//         while (nowtoken < dtokens.length) {
//             if (nowline.length() > 50) {
//                 dlines.add(nowline + "\n");
//                 nowline = "";
//             }
//             nowline += dtokens[nowtoken] + " ";
//             nowtoken++;
//         }
//         dlines.add(nowline + "\n");
// 
// 
//         StringBuilder sb = new StringBuilder();
//         if (key.length() < 30) {
//             sb.append("  ").append(key);
//             sb.append(spaceRepeat(26 - keylength));
//         } else {
//             sb.append("  ").append(key).append("\n");
//             sb.append(spaceRepeat(28));
//         }
//         sb.append("- ").append(dlines.get(0));
//         for (int i = 1; i < dlines.size(); i++) {
//             sb.append(spaceRepeat(30)).append(dlines.get(i));
//         }
// 
//         System.out.print(sb.toString());
//     }
// }


// Path: src/thesaurus/make/ThesaurusCompare.java
import thesaurus.util.ThesaurusLog;
import thesaurus.util.ThesaurusIO;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.OutputStream;
import java.util.HashMap;
import joptsimple.OptionParser;
import joptsimple.OptionSet;
import jsequtils.file.BufferedReaderMaker;
import jsequtils.file.OutputStreamMaker;
import jsequtils.genome.GenomeInfo;
import jsequtils.genome.GenomePositionComparator;
import jsequtils.variants.VCFEntry;
import jsequtils.variants.VCFEntrySet;

                }

                // check for thesaurus status anyway (to keep synonyms on track)                
                if (hasFilter(nowentry.getFilter(), "thesaurus") && synonymsfile != null) {
                    // check that the synonyms are synced with the vcf file
                    String entrycode = vcfEntryString(nowentry);
                    String[] synonyms = synline.split("\t");
                    if (!synonyms[0].equals(entrycode)) {
                        System.out.println("Desynced vcf and synonyms files: " + synonyms[0] + " " + entrycode);
                        return;
                    }

                    // try if the synonyms are in the reference set
                    int synlen = synonyms.length;
                    int syntrue = -1;
                    boolean nowTPthes = false;
                    for (int i = 0; i < synlen; i++) {
                        if (refset.containsPosition(synonyms[i])) {
                            FNmap.put(synonyms[i], false);
                            syntrue = i;
                            nowTPthes = true;
                            i = synlen;
                        }
                    }

                    if (!nowTP) {
                        if (nowTPthes) {
                            outTPthes.write(nowentry.toString().getBytes());
                            countTPthes++;
                        } else {
                            outFP.write(nowentry.toString().getBytes());