コード例 #1
0
 public BiNGOOntologyDefaultReader(String filename, HashMap synonymHash)
     throws IllegalArgumentException, IOException, Exception {
   this.filename = filename;
   this.synonymHash = synonymHash;
   try {
     if (filename.trim().startsWith("jar:")) {
       BiNGOJarReader reader = new BiNGOJarReader(filename);
       reader.read();
       fullText = reader.getText();
     } else if (filename.trim().startsWith("http://")) {
       TextHttpReader reader = new TextHttpReader(filename);
       reader.read();
       fullText = reader.getText();
     } else {
       TextFileReader reader = new TextFileReader(filename);
       reader.read();
       fullText = reader.getText();
     }
   } catch (IOException e0) {
     System.err.println("-- Exception while reading ontology default file " + filename);
     System.err.println(e0.getMessage());
     throw e0;
     // return;
   }
   this.goMap = new HashMap();
   lines = fullText.split("\n");
   parseHeader();
   parse();
 } // ctor
コード例 #2
0
  public BiNGOConsortiumAnnotationReader(
      String filename,
      HashMap synonymHash,
      BingoParameters params,
      String annotationType,
      String curator)
      throws IllegalArgumentException, IOException, Exception {
    // System.out.println ("AnnotationFlatFileReader on " + filename);
    this.filename = filename;
    try {
      if (filename.trim().startsWith("jar:")) {
        BiNGOJarReader reader = new BiNGOJarReader(filename);
        reader.read();
        fullText = reader.getText();
      } else if (filename.trim().startsWith("http://")) {
        TextHttpReader reader = new TextHttpReader(filename);
        reader.read();
        fullText = reader.getText();
      } else {
        TextFileReader reader = new TextFileReader(filename);
        reader.read();
        fullText = reader.getText();
      }
    } catch (IOException e0) {
      System.err.println("-- Exception while reading annotation flat file " + filename);
      System.err.println(e0.getMessage());
      throw e0;
    }

    this.species = filename;
    this.annotationType = annotationType;
    this.curator = curator;
    this.synonymHash = synonymHash;
    this.deleteCodes = params.getDeleteCodes();
    lines = fullText.split("\n");

    int start = parseHeader();
    parse(start);
  }