Package bnGUI.venn.geometry

Examples of bnGUI.venn.geometry.FileFormatException


                    header = false;
                    continue;
                }
                StringTokenizer tok = new StringTokenizer(line,"\t");          
                if( tok.countTokens() != 9 )
                    throw new FileFormatException("CategoryList: Error in line "+in.getLineNumber());
               
                int     groupID = 0,
                        nTotal = 0,
                        nChange = 0;
                double  Enrichment = 0.0,
                        pValue = 1.0,
                        FDR = 1.0;
                String term = null;
                String  groupName, keyName;
               
                try
                {
                    // category gene nTotal nChange enrichment pValue nCat CRMean FDR
                    groupName   = tok.nextToken().trim();
                   
                    if( groupName.length() < 3 || !groupName.startsWith("GO:") )
                        continue; // ignore unwanted records
                   
                    keyName     = tok.nextToken().trim();
                    nTotal      =  Integer.parseInt(tok.nextToken().trim());
                    nChange     =  Integer.parseInt(tok.nextToken().trim());
                    Enrichment =  Double.parseDouble(tok.nextToken().trim());                 
                    pValue     = Math.pow(10.0,Double.parseDouble(tok.nextToken().trim().replace(',','.')));
                    tok.nextToken();
                    tok.nextToken();
                    FDR         = Double.parseDouble(tok.nextToken().trim().replace(',','.'));
                   
                    int idx = groupName.indexOf('_');
                    if( idx < 0 )
                        continue;
                   
                    groupID = Integer.parseInt( groupName.substring(3,idx) );
                    term = groupName.substring( idx+1 );
                }
                catch( NumberFormatException e )
                {
                    throw new FileFormatException("Error in element file at line "+in.getLineNumber());
                }
                Integer gval = (Integer)groupMap.get(new Integer(groupID));
                if( gval == null )
                { // entry not found in category list -> create new entry
                  gval = new Integer(groupNumber);
View Full Code Here


          header = false;
          continue;
        }
        StringTokenizer tok = new StringTokenizer(line,"\t");     
        if( tok.countTokens() != 9 && tok.countTokens() != 12 )
          throw new FileFormatException("Gene summary export (.se) file in line "+in.getLineNumber()+ " wrong number of fields");
        if (numTokens == -1) {
          numTokens = tok.countTokens();
        } else {
          if (tok.countTokens() != numTokens) {
            throw new FileFormatException("Gene summary export (.se) file in line "+in.getLineNumber()+ " number of fields has changed");
          }
        }
       
        int   groupID = 0,
            nTotal = 0,
            nUnder = 0,
            nOver = 0,
            nChange = 0;
        double   pUnder = 1.0,
            pOver = 1.0,
            pChange = 1.0,
            fdrUnder = -777.0,
            fdrOver = -888.0,
            fdrChange = -999.0;
        String term = null;
        try
        {
          String tmp = tok.nextToken().trim();
          if( tmp.equalsIgnoreCase("null") )
            continue;
          if( tmp.equalsIgnoreCase("all") )
            groupID = 0;
          else
            groupID = Integer.parseInt(tmp);
          nTotal =  Integer.parseInt(tok.nextToken().trim());
          nUnder =  Integer.parseInt(tok.nextToken().trim());
          nOver =  Integer.parseInt(tok.nextToken().trim());
          nChange =  Integer.parseInt(tok.nextToken().trim());
          pUnder = Double.parseDouble(tok.nextToken().trim().replace(',','.'));
          pOver = Double.parseDouble(tok.nextToken().trim().replace(',','.'));
          pChange = Double.parseDouble(tok.nextToken().trim().replace(',','.'));
          if (numTokens == 12) {
            fdrUnder = Double.parseDouble(tok.nextToken().trim().replace(',','.'));
            fdrOver = Double.parseDouble(tok.nextToken().trim().replace(',','.'));
            fdrChange = Double.parseDouble(tok.nextToken().trim().replace(',','.'));
          }
          term = tok.nextToken().trim();
        }
        catch( NumberFormatException e )
        {
          System.err.println( e.getStackTrace() );
          throw new FileFormatException("Gene summary export (.se) file in line "+in.getLineNumber());
        }
//        double pValue = 1.0;
//        if( pUnder < pValue ) {
//          pValue = pUnder;
//        }
View Full Code Here

         
      if( line.length() > 0 )
      {     
        StringTokenizer tok = new StringTokenizer(line,"\t");     
        if( tok.countTokens() < 3 )
          throw new FileFormatException("Gene category summary (.gce) file at line "+in.getLineNumber() +" wrong number of fields");
       
        String   strID = tok.nextToken().trim();
        if( strID.length() < 3 || !strID.startsWith("GO:") )
          continue; // ignore unwanted records
       
        String   groupName = tok.nextToken().trim(),
            keyName = tok.nextToken().trim();
       
        if( strID.length() < 4 )
          throw new FileFormatException("Gene category summary (.gce) file at line "+in.getLineNumber());
        strID = strID.substring(3);
       
        int goID = 0;
        try {
          if( !strID.equalsIgnoreCase("all") )
            goID = Integer.parseInt(strID);
        }
        catch( NumberFormatException e )
        {
          throw new FileFormatException("Gene category summary (.gce) file in line "+in.getLineNumber()+" illegal field value in first column");
        }
       
        Integer gval = (Integer)groupMap.get(new Integer(goID));
        if( gval == null )
        { // entry not found in category list -> continue
View Full Code Here

                   
            if( line.length() > 0 )
            {          
                String[] L = line.split("\t");
                if( L.length != 2 )
                    throw new FileFormatException("List: Error in line "+in.getLineNumber()+": Wrong number of fields");
               
                String  keyName = L[0].trim(),
                        groupName = L[1].trim();
               
View Full Code Here

TOP

Related Classes of bnGUI.venn.geometry.FileFormatException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.