Ignore:
Timestamp:
Feb 22, 2012, 9:31:59 AM (10 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #361: MeV TDMS exporter should only include reporter fields that are present in the experiment

Location:
extensions/net.sf.basedb.mev/trunk/src/server/net/sf/basedb/mev
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.mev/trunk/src/server/net/sf/basedb/mev/Mev.java

    r1443 r1540  
    3636    The current version of this plug-in package.
    3737  */
    38   public static final String VERSION = "1.8";
     38  public static final String VERSION = "1.9-dev";
    3939
    4040  /**
  • extensions/net.sf.basedb.mev/trunk/src/server/net/sf/basedb/mev/export/TdmsExporter.java

    r1416 r1540  
    3131import net.sf.basedb.core.BioAssay;
    3232import net.sf.basedb.core.BioAssaySet;
     33import net.sf.basedb.core.ClonableProperty;
    3334import net.sf.basedb.core.DatabaseException;
    3435import net.sf.basedb.core.DbControl;
    3536import net.sf.basedb.core.DynamicResultIterator;
    3637import net.sf.basedb.core.DynamicSpotQuery;
    37 import net.sf.basedb.core.ExtendedProperties;
    38 import net.sf.basedb.core.ExtendedProperty;
    3938import net.sf.basedb.core.Formula;
    4039import net.sf.basedb.core.IntensityTransform;
     40import net.sf.basedb.core.ReporterCloneTemplate;
    4141import net.sf.basedb.core.Type;
    4242import net.sf.basedb.core.query.SqlResult;
     
    280280  /**
    281281    Adds position, externalId, symbol, plus all admin-defined extended
    282     properties as reporter fields.
     282    properties as reporter fields. If the experiment has cloned reporter annotations
     283    only fields that are present in the copy are exported.
    283284  */
    284285  protected void addReporterFields()
    285286  {
    286287    addReporterField(ExportableFieldFactory.jep("pos()", "id", Type.INT, Formula.AverageMethod.NONE, null));
    287     addReporterField(ExportableFieldFactory.reporter("externalId", null, Type.STRING, null, null));
    288     addReporterField(ExportableFieldFactory.reporter("symbol", null, Type.STRING, null, null));
    289     for (ExtendedProperty ep : ExtendedProperties.getProperties("ReporterData"))
    290     {
    291       addReporterField(ExportableFieldFactory.reporter(ep, null, null));
     288    ReporterCloneTemplate template = getSource().getExperiment().getVirtualDb().getReporterCloneTemplate();
     289   
     290    if (template.hasClonableProperty(ClonableProperty.EXTERNAL_ID))
     291    {
     292      addReporterField(ExportableFieldFactory.reporter(template.getClonableProperty(ClonableProperty.EXTERNAL_ID), null, null));
     293    }
     294
     295    if (template.hasClonableProperty(ClonableProperty.SYMBOL))
     296    {
     297      addReporterField(ExportableFieldFactory.reporter(template.getClonableProperty(ClonableProperty.SYMBOL), null, null));
     298    }
     299   
     300    List<ClonableProperty> properties = template == null ?
     301        ClonableProperty.getAll() : template.getClonableProperties();
     302    for (ClonableProperty ep : properties)
     303    {
     304      if (ep.isExtendedProperty())
     305      {
     306        addReporterField(ExportableFieldFactory.reporter(ep, null, null));
     307      }
    292308    }
    293309  }
Note: See TracChangeset for help on using the changeset viewer.