Changeset 1085


Ignore:
Timestamp:
May 19, 2009, 9:46:17 AM (12 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #215: BGX reporter importer hangs if the [Controls] section has less than 6 columns

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/base2/net.sf.basedb.illumina/trunk/src/net/sf/basedb/illumina/plugins/BgxMergeControlsInputStream.java

    r941 r1085  
    3333import java.util.Map;
    3434import java.util.Set;
     35
     36import net.sf.basedb.core.signal.SignalException;
    3537
    3638/**
     
    225227    while (line != null && !line.startsWith("["))
    226228    {
     229      if (Thread.interrupted()) throw new SignalException("Aborted by user");
    227230      String[] cols = line.split("\\t");
    228       if (cols.length < 6) continue; // Ignore lines that have too few column
    229      
    230       String probeId = cols[0];               // Column 1 = Probe_ID
    231       String arrayAdressId = cols[1];         // Column 2 = Array_Address_Id
    232       String reporterGroupName = cols[2];     // Column 3 = Reporter_Group_Name
    233       String reporterGroupId = cols[3];       // Column 4 = Reporter_Group_Id
    234       String reporterCompositeMap = cols[4];  // Column 5 = Reporter_Composite_Map
    235       String sequence = cols[5];              // Column 6 = Probe_Sequence
    236        
    237       Control control = controls.get(probeId);
    238       if (control == null)
    239       {
    240         control = new Control(probeId, arrayAdressId, sequence);
    241         controls.put(probeId, control);
    242       }
    243       control.merge(reporterGroupName, reporterGroupId, reporterCompositeMap);
     231      if (cols.length >= 6)
     232      {
     233        // Ignore lines that have too few column
     234        String probeId = cols[0];               // Column 1 = Probe_ID
     235        String arrayAdressId = cols[1];         // Column 2 = Array_Address_Id
     236        String reporterGroupName = cols[2];     // Column 3 = Reporter_Group_Name
     237        String reporterGroupId = cols[3];       // Column 4 = Reporter_Group_Id
     238        String reporterCompositeMap = cols[4];  // Column 5 = Reporter_Composite_Map
     239        String sequence = cols[5];              // Column 6 = Probe_Sequence
     240         
     241        Control control = controls.get(probeId);
     242        if (control == null)
     243        {
     244          control = new Control(probeId, arrayAdressId, sequence);
     245          controls.put(probeId, control);
     246        }
     247        control.merge(reporterGroupName, reporterGroupId, reporterCompositeMap);
     248      }
    244249      line = in.readLine();
    245250    }
Note: See TracChangeset for help on using the changeset viewer.