Changeset 1211


Ignore:
Timestamp:
Mar 26, 2010, 11:22:14 AM (12 years ago)
Author:
Jari Häkkinen
Message:

Addresses #248 and #252. Do not use 'externalId' field if save to file is not requested.

File:
1 edited

Legend:

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

    r1210 r1211  
    197197    private int externalIdIndex;
    198198    private int positionIndex;
     199    // keep track if to save to file since externalId is only
     200    // available when saving of background expression values is
     201    // requested (avoid left joins in SQL).
     202    private Boolean saveBG;
    199203
    200204    /**
     
    210214      this.intensity=sd.intensity;
    211215    }
    212     public SData(DynamicResultIterator dri) throws SQLException
    213     {
     216    public SData(DynamicResultIterator dri, Boolean sBG) throws SQLException
     217    {
     218      saveBG=sBG;
    214219      ch1Index = dri.getIndex(VirtualColumn.channelIntensity(1).getName());
    215       externalIdIndex = dri.getIndex("externalId");
     220      externalIdIndex = (saveBG ? dri.getIndex("externalId") : -1);
    216221      positionIndex = dri.getIndex(VirtualColumn.POSITION.getName());
    217222    }
     
    219224    {
    220225      intensity  = sr.getFloat(ch1Index);
    221       externalId = new String(sr.getString(externalIdIndex));
     226      externalId = (saveBG ? new String(sr.getString(externalIdIndex)) : null);
    222227      return sr.getInt(positionIndex);
    223228    }
     
    409414    int nofSpots=0;
    410415    HashMap<Integer,SData> hmap=(saveBG ? new HashMap<Integer,SData>() : null);
    411     SData sdata=new SData(dri);
     416    SData sdata=new SData(dri,saveBG);
    412417
    413418    while (dri.hasNext())
     
    442447    float median=0;
    443448    HashMap<Integer,SData> hmap=(saveBG ? new HashMap<Integer,SData>() : null);
    444     SData sdata=new SData(dri);
     449    SData sdata=new SData(dri,saveBG);
    445450
    446451    while (dri.hasNext())
Note: See TracChangeset for help on using the changeset viewer.