Changeset 584


Ignore:
Timestamp:
Feb 12, 2008, 9:46:22 AM (13 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #98: Implement validator and metadata extractor plug-in for BGX files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/net/sf/basedb/illumina/src/net/sf/basedb/illumina/filehandler/BgxFileHandler.java

    r582 r584  
    6464  private final int linesToParse = 100;
    6565  //The start of the heading that holds the number of controls
    66   private String controlsHeading = "Number of Controls\t";
     66  private String controlsHeading = "Number of Controls";
     67  private String probesHeading = "Number of Probes";
    6768 
    6869  //List to hold the parsed lines.
     
    212213  private int getNumFeatures(List<String> headings)
    213214  {
    214     int numControls = 0;
     215    int numFeatures = 0;
    215216    if (headings != null && !(headings.size() < 1))
    216217    {   
    217218      for (String s : headings)
    218219      {
     220        String num = null;
    219221        if (s.startsWith(controlsHeading))
     222        {
     223          num = s.substring(controlsHeading.length());
     224        }
     225        else if (s.startsWith(probesHeading))
     226        {
     227          num = s.substring(probesHeading.length());
     228        }
     229        if (num != null)
    220230        {
    221231          try
    222232          {
    223             numControls = Integer.parseInt(s.substring((controlsHeading.length()-1)).trim());
     233            numFeatures += Integer.parseInt(num.trim());
    224234          }
    225235          catch (NumberFormatException nex)
     
    230240      }
    231241    }
    232     return numControls;
     242    return numFeatures;
    233243  }
    234244}
Note: See TracChangeset for help on using the changeset viewer.