Changeset 3107


Ignore:
Timestamp:
Feb 6, 2007, 3:26:22 PM (15 years ago)
Author:
Johan Enell
Message:

Fixes #439

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/plugins/core/net/sf/basedb/plugins/BioAssaySetExporter.java

    r3098 r3107  
    2626
    2727import net.sf.basedb.core.AnnotationType;
    28 import net.sf.basedb.core.AnyToAny;
    2928import net.sf.basedb.core.BaseException;
    3029import net.sf.basedb.core.BioAssay;
     
    6564import net.sf.basedb.core.plugin.Request;
    6665import net.sf.basedb.core.plugin.Response;
    67 import net.sf.basedb.core.query.Aggregations;
    6866import net.sf.basedb.core.query.Dynamic;
    69 import net.sf.basedb.core.query.Expression;
    70 import net.sf.basedb.core.query.Expressions;
    7167import net.sf.basedb.core.query.Hql;
    7268import net.sf.basedb.core.query.JoinType;
     
    113109{
    114110
    115   public BioAssaySetExporter()
    116   {
    117   }
    118 
    119 
    120111  public void configure(GuiContext context, Request request, Response response)
    121112  {
     
    194185
    195186 
    196   void exportBaseFileMatrix(BioAssaySet bas, File file, Map<String, String> parameters,
     187  public void exportBaseFileMatrix(BioAssaySet bas, File file, Map<String, String> parameters,
    197188    List<String> reporterFields, List<String> spotFields, Boolean mergeReporters)
    198189    throws IOException, SQLException
     
    200191    DbControl dc = bas.getDbControl();
    201192    PrintWriter out = new PrintWriter(file.getUploadStream(false));
    202     Map<String, QueryItem> qis = getBaseFileQIMap(dc, bas);
    203 
    204     exportBaseFileSectionHead(out, parameters);
    205     exportBaseFileSectionAssays(out, dc, bas);
    206 
    207     DynamicSpotQuery query = bas.getSpotData();
    208     for (String field : reporterFields)
    209     {
    210       QueryItem qi = qis.get(field);
    211       query.select(Selects.expression(BioAssaySetUtil.createJepExpression(dc, bas, qi.getJep(), true), field));
    212     }
    213     for (String field : spotFields)
    214     {
    215       QueryItem qi = qis.get(field);
    216       query.select(Selects.expression(BioAssaySetUtil.createJepExpression(dc, bas, qi.getJep(), true), field));
    217     }
    218     if (mergeReporters)
    219     {
    220       // not implemented
    221     }   
    222     exportBaseFileSectionSpots(out, dc, bas, query, reporterFields, spotFields, bas.getBioAssays().list(dc));
    223   }
    224  
    225  
    226   private void exportBaseFileSectionHead(PrintWriter out, Map<String, String> parameters)
    227   {
    228     out.println("BASEfile");
    229     if (!parameters.isEmpty())
    230     {
    231       for (String key : parameters.keySet())
    232       {
    233         out.println(key+"\t"+parameters.get(key));
    234       }
    235       out.println("%");
    236       out.println();
     193    try
     194    {
     195      Map<String, QueryItem> qis = getBaseFileQIMap(dc, bas);
     196 
     197      exportBaseFileSectionHead(out, parameters);
     198      exportBaseFileSectionAssays(out, dc, bas);
     199 
     200      DynamicSpotQuery query = bas.getSpotData();
     201      for (String field : reporterFields)
     202      {
     203        QueryItem qi = qis.get(field);
     204        if (qi == null)
     205        {
     206          throw new BaseException("Unknown field in reporter fields: "+field);
     207        }
     208        query.select(Selects.expression(BioAssaySetUtil.createJepExpression(dc, bas, qi.getJep(), true), field));
     209      }
     210      for (String field : spotFields)
     211      {
     212        QueryItem qi = qis.get(field);
     213        if (qi == null)
     214        {
     215          throw new BaseException("Unknown field in spot fields: "+field);
     216        }
     217        query.select(Selects.expression(BioAssaySetUtil.createJepExpression(dc, bas, qi.getJep(), true), field));
     218      }
     219      if (mergeReporters)
     220      {
     221        throw new BaseException("'Merge on reporter' not implemented");
     222      }   
     223      exportBaseFileSectionSpots(out, dc, bas, query, reporterFields, spotFields, bas.getBioAssays().list(dc));
     224    }
     225    finally
     226    {
     227      if (out != null) out.close();
    237228    }
    238229  }
     
    264255    out.println();
    265256  }
    266 
    267  
     257 
     258 
     259  private void exportBaseFileSectionHead(PrintWriter out, Map<String, String> parameters)
     260  {
     261    out.println("BASEfile");
     262    if (!parameters.isEmpty())
     263    {
     264      for (String key : parameters.keySet())
     265      {
     266        out.println(key+"\t"+parameters.get(key));
     267      }
     268      out.println("%");
     269      out.println();
     270    }
     271  }
     272 
     273 
     274  public void exportBaseFileSerial(BioAssaySet bas, File file, Map<String, String> parameters,
     275    List<String> reporterFields, List<String> spotFields, Boolean mergeReporters)
     276    throws IOException, SQLException
     277  {
     278    DbControl dc = bas.getDbControl();
     279    PrintWriter out = new PrintWriter(file.getUploadStream(false));
     280    try
     281    {
     282      Map<String, QueryItem> qis = getBaseFileQIMap(dc, bas);
     283 
     284      exportBaseFileSectionHead(out, parameters);
     285      exportBaseFileSectionAssays(out, dc, bas);
     286     
     287      for (BioAssay ba : bas.getBioAssays().list(dc))
     288      {
     289        DynamicSpotQuery query = ba.getSpotData();
     290        for (String field : reporterFields)
     291        {
     292          QueryItem qi = qis.get(field);
     293          query.select(Selects.expression(BioAssaySetUtil.createJepExpression(dc, bas, qi.getJep(), true), field));
     294        }
     295        for (String field : spotFields)
     296        {
     297          QueryItem qi = qis.get(field);
     298          query.select(Selects.expression(BioAssaySetUtil.createJepExpression(dc, bas, qi.getJep(), true), field));
     299        }
     300        if (mergeReporters)
     301        {
     302          throw new BaseException("'Merge on reporter' not implemented");
     303        }
     304 
     305        exportBaseFileSectionSpots(out, dc, bas, query, reporterFields, spotFields, Collections.singletonList(ba));
     306       
     307        out.println();
     308      }
     309    }
     310    finally
     311    {
     312      if (dc != null) dc.close();
     313      if (out != null) out.close();
     314    }
     315  }
     316
     317
    268318  private void exportBaseFileSectionSpots(PrintWriter out, DbControl dc, BioAssaySet bas, DynamicSpotQuery query,
    269319    List<String> reporterFields, List<String> spotFields, List<BioAssay> assays)
     
    287337    }
    288338    out.println("\tassayData");
    289     out.print("assays\t");
     339    out.print("assays");
    290340    for (BioAssay ba : assays)
    291341    {
    292       out.print(ba.getId());
     342      out.print("\t" + ba.getId());
    293343    }
    294344    out.println();
     
    378428 
    379429 
    380   void exportBaseFileSerial(BioAssaySet bioAssaySet, File file, Map<String, String> parameters,
    381     List<String> reporterFields, List<String> spotFields, Boolean mergeReporters)
    382     throws IOException, SQLException
    383   {
    384     DbControl dc = sc.newDbControl();
    385     BioAssaySet bas = BioAssaySet.getById(dc, bioAssaySet.getId());
    386     PrintWriter out = new PrintWriter(file.getUploadStream(false));
    387     Map<String, QueryItem> qis = getBaseFileQIMap(dc, bas);
    388 
    389     exportBaseFileSectionHead(out, parameters);
    390     exportBaseFileSectionAssays(out, dc, bas);
    391    
    392     for (BioAssay ba : bas.getBioAssays().list(dc))
    393     {
    394       DynamicSpotQuery query = ba.getSpotData();
    395       for (String field : reporterFields)
    396       {
    397         QueryItem qi = qis.get(field);
    398         query.select(Selects.expression(BioAssaySetUtil.createJepExpression(dc, bas, qi.getJep(), true), field));
    399       }
    400       for (String field : spotFields)
    401       {
    402         QueryItem qi = qis.get(field);
    403         query.select(Selects.expression(BioAssaySetUtil.createJepExpression(dc, bas, qi.getJep(), true), field));
    404       }
    405       if (mergeReporters)
    406       {
    407         // not implemented
    408       }
    409 
    410       exportBaseFileSectionSpots(out, dc, bas, query, reporterFields, spotFields, Collections.singletonList(ba));
    411      
    412       out.println();
    413     }
    414   }
    415 
    416 
    417430  public void exportMeV(BioAssaySet bioassayset, OutputStream to,
    418431                         ProgressReporter progress)
     
    572585
    573586
     587  public About getAbout()
     588  {
     589    return about;
     590  }
     591 
     592 
     593  private List<QueryItem> getBaseFileExtraQI(DbControl dc, BioAssaySet bas)
     594  {
     595    List<QueryItem> items = new ArrayList<QueryItem>();
     596    ItemQuery<ExtraValue> query = bas.getExtraValues();
     597    query.order(Orders.asc(Hql.property("extraValueType.name")));
     598    for (ExtraValue ev : query.list(dc))
     599    {
     600      ExtraValueType evt = ev.getExtraValueType();
     601      items.add(new QueryItem("_xc_"+evt.getExternalId(), "[Extra] "+evt.getName(), "xtra('" + evt.getExternalId() + "')"));
     602    }
     603    Collections.sort(items, new QueryItemTitleComparator());
     604    return items;
     605  }
     606 
     607 
     608  private List<QueryItem> getBaseFileFormulaQI(DbControl dc, BioAssaySet bas)
     609  {
     610    List<QueryItem> items = new ArrayList<QueryItem>();
     611    ItemQuery<Formula> queryFormula = Formula.getQuery(Formula.Type.COLUMN_EXPRESSION, bas.getRawDataType());
     612    queryFormula.include(Include.MINE, Include.SHARED, Include.IN_PROJECT, Include.OTHERS);
     613    queryFormula.order(Orders.asc(Hql.property("name")));
     614    for (Formula f : queryFormula.list(dc))
     615    {
     616      items.add(new QueryItem(f.getName(), "[Formula] "+f.getName(), f.getFormula(0)));
     617    }
     618    Collections.sort(items, new QueryItemTitleComparator());
     619    return items;
     620  }
     621 
     622 
     623  private Map<String, QueryItem> getBaseFileQIMap(DbControl dc, BioAssaySet bas)
     624  {
     625    Map<String, QueryItem> items = new HashMap<String, QueryItem>();
     626    for (QueryItem qi : getBaseFileExtraQI(dc, bas)) items.put(qi.getName(), qi);
     627    for (QueryItem qi : getBaseFileFormulaQI(dc, bas)) items.put(qi.getName(), qi);
     628    for (QueryItem qi : getBaseFileRawQI(bas)) items.put(qi.getName(), qi);
     629    for (QueryItem qi : getBaseFileReporterQI()) items.put(qi.getName(), qi);
     630    for (QueryItem qi : getBaseFileSpotQI(bas)) items.put(qi.getName(), qi);
     631    return items;
     632  }
     633 
     634 
     635  private List<QueryItem> getBaseFileRawQI(BioAssaySet bas)
     636  {
     637    List<QueryItem> items = new ArrayList<QueryItem>();
     638    items.add(new QueryItem("rawPosition", "[Raw] Position", "raw('position')"));
     639    items.add(new QueryItem("block", "[Raw] Array block", "raw('block')"));
     640    items.add(new QueryItem("metaGridX", "[Raw] Meta grid X", "raw('metaGridX')"));
     641    items.add(new QueryItem("metaGridY", "[Raw] Meta grid Y", "raw('metaGridY')"));
     642    items.add(new QueryItem("numRow", "[Raw] Row in block", "raw('row')"));
     643    items.add(new QueryItem("numCol", "[Raw] Column in block", "raw('column')"));
     644    items.add(new QueryItem("x", "[Raw] X coordinate", "raw('x')"));
     645    items.add(new QueryItem("y", "[Raw] Y coordinate", "raw('y')"));
     646    for (RawDataProperty rdp : bas.getRawDataType().getProperties())
     647    {
     648      items.add(new QueryItem(rdp.getName(), "[Raw] "+rdp.getTitle(), "raw('"+rdp.getName()+"')"));
     649    }
     650    Collections.sort(items, new QueryItemTitleComparator());
     651    return items;
     652  }
     653 
     654 
     655  private List<QueryItem> getBaseFileReporterQI()
     656  {
     657    List<QueryItem> items = new ArrayList<QueryItem>();
     658    items.add(new QueryItem("reporter", "Reporter (internal id)", "rep('id')"));
     659    items.add(new QueryItem("reporterName", "Reporter Name", "rep('name')"));
     660    items.add(new QueryItem("reporterId", "Reporter ID", "rep('externalId')"));
     661    items.add(new QueryItem("geneSymbol", "Gene symbol", "rep('symbol')"));
     662    items.add(new QueryItem("description", "Description", "rep('description')"));
     663    items.add(new QueryItem("lastUpdate", "Last updated", "rep('lastUpdate')"));
     664    for (ExtendedProperty ep : ExtendedProperties.getProperties(ReporterData.class.toString()))
     665    {
     666      items.add(new QueryItem(ep.getName(), ep.getTitle(), "rep('"+ep.getName()+"')"));
     667    }
     668    Collections.sort(items, new QueryItemTitleComparator());
     669    return items;
     670  }
     671 
     672 
     673  private List<QueryItem> getBaseFileSpotQI(BioAssaySet bas)
     674  {
     675    List<QueryItem> items = new ArrayList<QueryItem>();
     676    items.add(new QueryItem("position", "Position", "pos()"));
     677    int channels = bas.getRawDataType().getChannels();
     678    for (int channel = 1; channel <= channels; ++channel)
     679    {
     680      items.add(new QueryItem("intensity"+channel, "Int ch"+channel, "ch("+channel+")"));
     681    }
     682    Collections.sort(items, new QueryItemTitleComparator());
     683    return items;
     684  }
     685
     686 
     687  private RequestInformation getConfigureBasefileParameters(GuiContext context)
     688  {
     689    if (configureJobBasefile == null)
     690    {
     691      DbControl dc = null;
     692      try
     693      {
     694        dc = sc.newDbControl();
     695        List<PluginParameter<?>> parameters = new ArrayList<PluginParameter<?>>();
     696        geneAveragesParameter = new PluginParameter<Boolean>
     697          ( "geneAverages",
     698            "Average on reporters",
     699            "Average on reporters within each assay.",
     700            new BooleanParameterType(false, true));
     701       
     702        Enumeration<Boolean, String> serialFormat = new Enumeration<Boolean, String>();
     703        serialFormat.add(false, "Normal BASEfile (one big matrix)");
     704        serialFormat.add(true, "Serial BASEfile (one section per assay)");
     705        serialFormatParameter = new PluginParameter<Boolean>
     706          ( "serialFormat",
     707            "Export as matrix or serial basefile.",
     708            "The data can be exported as a matrix with all data in the same section or in a " +
     709            "serial format where the data is separated for each assay.",
     710            new BooleanParameterType(false, true, 1, serialFormat));
     711       
     712        Enumeration<String, String> fields = new Enumeration<String, String>();
     713        BioAssaySet bas = (BioAssaySet) job.getValue(bioAssaySetParameter.getName());
     714        for (QueryItem qi : getBaseFileSpotQI(bas))
     715        {
     716          fields.add(qi.getName(), qi.getTitle());
     717        }
     718        for (QueryItem qi : getBaseFileFormulaQI(dc, bas))
     719        {
     720          fields.add(qi.getName(), qi.getTitle());
     721        }
     722        for (QueryItem qi : getBaseFileExtraQI(dc, bas))
     723        {
     724          fields.add(qi.getName(), qi.getTitle());
     725        }
     726        for (QueryItem qi : getBaseFileRawQI(bas))
     727        {
     728          fields.add(qi.getName(), qi.getTitle());
     729        }
     730        //Limsfields???
     731        usedFieldsParameter = new PluginParameter<String>(
     732          "usedFields",
     733          "Fields",
     734          "The spot information that is exporter. The position is allways exported when avarage on reporter is false.",
     735          new StringParameterType(null, null, true, 0, 0, 0, fields));
     736
     737        Enumeration<String, String> columns = new Enumeration<String, String>();
     738        for (QueryItem qi : getBaseFileReporterQI())
     739        {
     740          columns.add(qi.getName(), qi.getTitle());
     741        }
     742        usedColumnsParameter = new PluginParameter<String>(
     743          "usedColumns",
     744          "Reporter",
     745          "The reporter information that is exported. An internal reporter id is allways exported.",
     746          new StringParameterType(null, null, false, 0, 0, 0, columns));
     747       
     748        parameters.add(geneAveragesParameter);
     749        parameters.add(serialFormatParameter);
     750        parameters.add(usedFieldsParameter);
     751        parameters.add(usedColumnsParameter);
     752 
     753        configureJobBasefile = new RequestInformation
     754          ( COMMAND_CONFIGURE_BASEFILE,
     755            "Configure BASEfile export.",
     756            "Here you configure the parameter for the BASEfile format.",
     757            parameters );
     758      }
     759      finally
     760      {
     761        if (dc != null)
     762        {
     763          dc.close();
     764        }
     765      }
     766    }
     767    return configureJobBasefile;
     768  }
     769
     770
     771 
    574772  private RequestInformation getConfigureJobParameters(GuiContext context)
    575773  {
     
    620818 
    621819 
    622   private RequestInformation getConfigureBasefileParameters(GuiContext context)
    623   {
    624     if (configureJobBasefile == null)
    625     {
    626       DbControl dc = null;
    627       try
    628       {
    629         dc = sc.newDbControl();
    630         List<PluginParameter<?>> parameters = new ArrayList<PluginParameter<?>>();
    631         geneAveragesParameter = new PluginParameter<Boolean>
    632           ( "geneAverages",
    633             "Average on reporters",
    634             "Average on reporters within each assay.",
    635             new BooleanParameterType(false, true));
    636        
    637         Enumeration<Boolean, String> serialFormat = new Enumeration<Boolean, String>();
    638         serialFormat.add(false, "Normal BASEfile (one big matrix)");
    639         serialFormat.add(true, "Serial BASEfile (one section per assay)");
    640         serialFormatParameter = new PluginParameter<Boolean>
    641           ( "serialFormat",
    642             "Export as matrix or serial basefile.",
    643             "The data can be exported as a matrix with all data in the same section or in a " +
    644             "serial format where the data is separated for each assay.",
    645             new BooleanParameterType(false, true, 1, serialFormat));
    646        
    647         Enumeration<String, String> fields = new Enumeration<String, String>();
    648         BioAssaySet bas = (BioAssaySet) job.getValue(bioAssaySetParameter.getName());
    649         for (QueryItem qi : getBaseFileSpotQI(bas))
    650         {
    651           fields.add(qi.getName(), qi.getTitle());
    652         }
    653         for (QueryItem qi : getBaseFileFormulaQI(dc, bas))
    654         {
    655           fields.add(qi.getName(), qi.getTitle());
    656         }
    657         for (QueryItem qi : getBaseFileExtraQI(dc, bas))
    658         {
    659           fields.add(qi.getName(), qi.getTitle());
    660         }
    661         for (QueryItem qi : getBaseFileRawQI(bas))
    662         {
    663           fields.add(qi.getName(), qi.getTitle());
    664         }
    665         //Limsfields???
    666         usedFieldsParameter = new PluginParameter<String>(
    667           "usedFields",
    668           "Fields",
    669           "The spot information that is exporter. The position is allways exported when avarage on reporter is false.",
    670           new StringParameterType(null, null, true, 0, 0, 0, fields));
    671 
    672         Enumeration<String, String> columns = new Enumeration<String, String>();
    673         for (QueryItem qi : getBaseFileReporterQI())
    674         {
    675           columns.add(qi.getName(), qi.getTitle());
    676         }
    677         usedColumnsParameter = new PluginParameter<String>(
    678           "usedColumns",
    679           "Reporter",
    680           "The reporter information that is exported. An internal reporter id is allways exported.",
    681           new StringParameterType(null, null, false, 0, 0, 0, columns));
    682        
    683         parameters.add(geneAveragesParameter);
    684         parameters.add(serialFormatParameter);
    685         parameters.add(usedFieldsParameter);
    686         parameters.add(usedColumnsParameter);
    687  
    688         configureJobBasefile = new RequestInformation
    689           ( COMMAND_CONFIGURE_BASEFILE,
    690             "Configure BASEfile export.",
    691             "Here you configure the parameter for the BASEfile format.",
    692             parameters );
    693       }
    694       finally
    695       {
    696         if (dc != null)
    697         {
    698           dc.close();
    699         }
    700       }
    701     }
    702     return configureJobBasefile;
    703   }
    704 
    705 
    706   public About getAbout()
    707   {
    708     return about;
    709   }
    710  
    711  
    712   private List<QueryItem> getBaseFileExtraQI(DbControl dc, BioAssaySet bas)
    713   {
    714     List<QueryItem> items = new ArrayList<QueryItem>();
    715     ItemQuery<ExtraValue> query = bas.getExtraValues();
    716     query.order(Orders.asc(Hql.property("extraValueType.name")));
    717     for (ExtraValue ev : query.list(dc))
    718     {
    719       ExtraValueType evt = ev.getExtraValueType();
    720       items.add(new QueryItem("_xc_"+evt.getExternalId(), "[Extra] "+evt.getName(), "xtra('" + evt.getExternalId() + "')"));
    721     }
    722     Collections.sort(items, new QueryItemTitleComparator());
    723     return items;
    724   }
    725  
    726  
    727   private List<QueryItem> getBaseFileFormulaQI(DbControl dc, BioAssaySet bas)
    728   {
    729     List<QueryItem> items = new ArrayList<QueryItem>();
    730     ItemQuery<Formula> queryFormula = Formula.getQuery(Formula.Type.COLUMN_EXPRESSION, bas.getRawDataType());
    731     queryFormula.include(Include.MINE, Include.SHARED, Include.IN_PROJECT, Include.OTHERS);
    732     queryFormula.order(Orders.asc(Hql.property("name")));
    733     for (Formula f : queryFormula.list(dc))
    734     {
    735       items.add(new QueryItem(f.getName(), "[Formula] "+f.getName(), f.getFormula(0)));
    736     }
    737     Collections.sort(items, new QueryItemTitleComparator());
    738     return items;
    739   }
    740  
    741  
    742   private List<QueryItem> getBaseFileSpotQI(BioAssaySet bas)
    743   {
    744     List<QueryItem> items = new ArrayList<QueryItem>();
    745     items.add(new QueryItem("position", "Position", "pos()"));
    746     int channels = bas.getRawDataType().getChannels();
    747     for (int channel = 1; channel <= channels; ++channel)
    748     {
    749       items.add(new QueryItem("intensity"+channel, "Int ch"+channel, "ch("+channel+")"));
    750     }
    751     Collections.sort(items, new QueryItemTitleComparator());
    752     return items;
    753   }
    754  
    755  
    756   private Map<String, QueryItem> getBaseFileQIMap(DbControl dc, BioAssaySet bas)
    757   {
    758     Map<String, QueryItem> items = new HashMap<String, QueryItem>();
    759     for (QueryItem qi : getBaseFileExtraQI(dc, bas)) items.put(qi.getName(), qi);
    760     for (QueryItem qi : getBaseFileFormulaQI(dc, bas)) items.put(qi.getName(), qi);
    761     for (QueryItem qi : getBaseFileRawQI(bas)) items.put(qi.getName(), qi);
    762     for (QueryItem qi : getBaseFileReporterQI()) items.put(qi.getName(), qi);
    763     for (QueryItem qi : getBaseFileSpotQI(bas)) items.put(qi.getName(), qi);
    764     return items;
    765   }
    766  
    767   private List<QueryItem> getBaseFileRawQI(BioAssaySet bas)
    768   {
    769     List<QueryItem> items = new ArrayList<QueryItem>();
    770     items.add(new QueryItem("rawPosition", "[Raw] Position", "raw('position')"));
    771     items.add(new QueryItem("block", "[Raw] Array block", "raw('block')"));
    772     items.add(new QueryItem("metaGridX", "[Raw] Meta grid X", "raw('metaGridX')"));
    773     items.add(new QueryItem("metaGridY", "[Raw] Meta grid Y", "raw('metaGridY')"));
    774     items.add(new QueryItem("numRow", "[Raw] Row in block", "raw('row')"));
    775     items.add(new QueryItem("numCol", "[Raw] Column in block", "raw('column')"));
    776     items.add(new QueryItem("x", "[Raw] X coordinate", "raw('x')"));
    777     items.add(new QueryItem("y", "[Raw] Y coordinate", "raw('y')"));
    778     for (RawDataProperty rdp : bas.getRawDataType().getProperties())
    779     {
    780       items.add(new QueryItem(rdp.getName(), "[Raw] "+rdp.getTitle(), "raw('"+rdp.getName()+"')"));
    781     }
    782     Collections.sort(items, new QueryItemTitleComparator());
    783     return items;
    784   }
    785  
    786  
    787   private List<QueryItem> getBaseFileReporterQI()
    788   {
    789     List<QueryItem> items = new ArrayList<QueryItem>();
    790     items.add(new QueryItem("reporter", "Reporter (internal id)", "rep('id')"));
    791     items.add(new QueryItem("reporterName", "Reporter Name", "rep('name')"));
    792     items.add(new QueryItem("reporterId", "Reporter ID", "rep('externalId')"));
    793     items.add(new QueryItem("geneSymbol", "Gene symbol", "rep('symbol')"));
    794     items.add(new QueryItem("description", "Description", "rep('description')"));
    795     items.add(new QueryItem("lastUpdate", "Last updated", "rep('lastUpdate')"));
    796     for (ExtendedProperty ep : ExtendedProperties.getProperties(ReporterData.class.toString()))
    797     {
    798       items.add(new QueryItem(ep.getName(), ep.getTitle(), "rep('"+ep.getName()+"')"));
    799     }
    800     Collections.sort(items, new QueryItemTitleComparator());
    801     return items;
    802   }
    803  
    804 
    805820  public List<AnnotationType> getExperimentalFactors(DbControl dc, BioAssaySet bas)
    806821  {
     
    810825    return query.list(dc);
    811826  }
    812  
    813 
     827
     828 
    814829  public Set<GuiContext> getGuiContexts()
    815830  {
     
    843858  }
    844859
    845 
     860 
    846861  public RequestInformation getRequestInformation(GuiContext context, String command)
    847862    throws BaseException
     
    859874  }
    860875
    861 
     876 
    862877  public String isInContext(GuiContext context, Object item)
    863878  {
     
    874889  }
    875890
    876 
     891 
    877892  @Override
    878893  public boolean requiresConfiguration()
     
    881896  }
    882897
    883 
     898 
    884899  @SuppressWarnings("unchecked")
    885900  public void run(Request request, Response response, ProgressReporter progress)
     
    948963  }
    949964
    950 
     965 
    951966  @Override
    952967  public boolean supportsConfigurations()
     
    955970  }
    956971
    957 
     972 
    958973  private static final About about =
    959974    new AboutImpl
     
    9941009  private static final String FORMAT_MEV = "MeV";
    9951010 
    996  
    9971011
    9981012  public class QueryItem
Note: See TracChangeset for help on using the changeset viewer.