Changeset 3098


Ignore:
Timestamp:
Feb 5, 2007, 11:52:51 AM (15 years ago)
Author:
Nicklas Nordborg
Message:

References #10: Hierarchical clustering

Added servlet for downloading bioassay set data in Mev format

Location:
trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/build.xml

    r3029 r3098  
    670670  <target
    671671    name="web.init"
    672     depends="core.init"
     672    depends="core.init,coreplugins.init"
    673673    >
    674674    <property name="web.src" location="${src}/clients/web"
     
    681681      <path refid="core.classpath"/>
    682682      <pathelement location="${core.build}"/>
     683      <pathelement location="${coreplugins.build}" />
    683684      <fileset dir="${lib}/servlet">
    684685        <include name="**/*.jar"/>
  • trunk/config/dist/web.xml

    r2994 r3098  
    127127  </servlet-mapping>
    128128
    129  
     129  <!-- The MevExport servlet used to download bioassay data to Mev -->
     130  <servlet>
     131    <servlet-name>mevexport</servlet-name>
     132    <servlet-class>
     133      net.sf.basedb.clients.web.servlet.MevExport
     134    </servlet-class>
     135  </servlet>
     136  <servlet-mapping>
     137    <servlet-name>mevexport</servlet-name>
     138    <url-pattern>/plugins/org/tigr/microarray/mev/export</url-pattern>
     139  </servlet-mapping>
     140
    130141  <!-- The CompileAll servlet used to compile all JSP pages -->
    131142  <!-- EXPERIMENTAL!! -->
  • trunk/src/plugins/core/net/sf/basedb/plugins/BioAssaySetExporter.java

    r3068 r3098  
    7878
    7979import java.io.IOException;
     80import java.io.OutputStream;
    8081import java.io.PrintWriter;
    8182import java.sql.SQLException;
     
    414415
    415416
    416   private void exportMeV(BioAssaySet bioassayset, File file,
     417  public void exportMeV(BioAssaySet bioassayset, OutputStream to,
    417418                         ProgressReporter progress)
    418419    throws IOException, SQLException
    419420  {
    420421    DbControl dc=bioassayset.getDbControl();
    421     PrintWriter out = new PrintWriter(file.getUploadStream(false));
     422    PrintWriter out = new PrintWriter(to);
    422423
    423424    // comment header
     
    466467    }
    467468
    468     progress.display(0, "Exporting ... performing database query");
     469    if (progress != null) progress.display(0, "Exporting ... performing database query");
    469470    // Reporter annotations and expression levels
    470471    int nofchannels=bioassayset.getRawDataType().getChannels();
     
    511512    while (spotData.hasNext())
    512513    {
    513       if (nof_processed_reporters%progress_report_interval == 0)
     514      if (progress != null && (nof_processed_reporters%progress_report_interval == 0))
    514515      {
    515516        progress.display(100 * nof_processed_reporters / nof_reporters,
     
    567568    }
    568569    out.write("\n");
    569 
    570     out.close();
     570    out.flush();
    571571  }
    572572
     
    907907      // Add other export formats here
    908908      String format = (String) job.getValue("fileformat");
    909       if (format.equals(FORMAT_MEV)) exportMeV(bioassayset,file,progress);
     909      if (format.equals(FORMAT_MEV))
     910      {
     911        OutputStream out = file.getUploadStream(false);
     912        exportMeV(bioassayset, out, progress);
     913        out.close();
     914      }
    910915      else if (format.equals(FORMAT_BASEFILE))
    911916      {
Note: See TracChangeset for help on using the changeset viewer.