Changeset 3648


Ignore:
Timestamp:
Aug 9, 2007, 4:28:43 PM (14 years ago)
Author:
Peter Johansson
Message:

refs #639 removing the exportPlainMatrix method.

File:
1 edited

Legend:

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

    r3645 r3648  
    102102     use in MeV (available from http://www.tm4.org).
    103103   - BASEfile.
    104    - Plain Matrix
    105 
    106    @author enell, jari, peter
     104
     105   @author enell, jari
    107106   @version 2.1
    108107   @base.modified $Date$
     
    746745
    747746
    748   public void exportPlainMatrix(BioAssaySet bioassayset, OutputStream os,
    749                                 ProgressReporter progress)
    750     throws IOException, SQLException
    751   {
    752     DbControl dc=bioassayset.getDbControl();
    753     PrintWriter out = new PrintWriter(os);
    754     List<ExtendedProperty> reporterProperties =
    755       ExtendedProperties.getProperties("ReporterData");
    756 
    757     int nof_bioassays=0;
    758     nof_bioassays=bioassayset.getBioAssays().list(dc).size();
    759 
    760     if (progress != null)
    761       progress.display(0, "Exporting ... performing database query");
    762 
    763     DynamicSpotQuery query=bioassayset.getSpotData();
    764     query.select(Dynamic.select(VirtualColumn.POSITION));
    765     query.select(Dynamic.select(VirtualColumn.COLUMN));
    766     query.select(Dynamic.select(VirtualColumn.channel(1)));
    767    
    768     query.order(Orders.asc(Dynamic.column(VirtualColumn.POSITION)));
    769     query.order(Orders.asc(Dynamic.column(VirtualColumn.COLUMN)));
    770 
    771     DynamicResultIterator spotData = query.iterate(dc);
    772     int column_position=spotData.getIndex(VirtualColumn.POSITION.getName());
    773     int column_column=spotData.getIndex(VirtualColumn.COLUMN.getName());
    774     int column_channel=spotData.getIndex(VirtualColumn.channel(1).getName());
    775    
    776     int position=-1;
    777     int column=nof_bioassays;
    778     //double log2=Math.log(2.0);
    779     int nof_spots=bioassayset.getNumSpots();
    780     int progress_spot_interval=nof_spots/10;
    781     int nof_processed_spots=0;
    782     while (spotData.hasNext())
    783     {
    784       SqlResult item = spotData.next();
    785       int thisposition=item.getInt(column_position);
    786       short thiscolumn=item.getShort(column_column);
    787 
    788       if (progress != null &&
    789           (nof_processed_spots%progress_spot_interval == 0))
    790         {
    791           progress.display(100 * nof_processed_spots / nof_spots,
    792                            "Exporting ..." + nof_processed_spots + " of " +
    793                            nof_spots + " done.");
    794         }
    795         ++nof_processed_spots;
    796  
    797       if (position!=thisposition) // new position
    798       {
    799         // fill missing values before next spot
    800         while (column < nof_bioassays) {
    801           out.write("\t");
    802           ++column;
    803         }
    804         column=1;
    805         if (position != -1) // no leading newline in output
    806         {
    807           out.write("\n");
    808         }
    809         position=thisposition;
    810       }
    811 
    812       // fill missing values up to next available column (bioassay)
    813       while (column < thiscolumn)
    814       {
    815         ++column;
    816         out.write("\t");
    817       }
    818 
    819       // Calculate expression value
    820       String ch1=item.getString(column_channel);
    821       out.write(ch1);
    822     }
    823     out.flush();
    824   }
    825 
    826 
    827747  public About getAbout()
    828748  {
     
    1064984      formats.add(FORMAT_MEV, "MultiExperiment Viewer (MeV)");
    1065985      formats.add(FORMAT_BASEFILE, "BASEfile");
    1066       formats.add(FORMAT_PLAIN_MATRIX, "Plain Matrix");
    1067986      formatParameter = new PluginParameter<String>
    1068987        ( "fileformat",
     
    12191138        }
    12201139      }
    1221       else if (format.equals(FORMAT_PLAIN_MATRIX))
    1222       {
    1223         exportPlainMatrix(bas, out, progress);
    1224       }
    12251140      else
    12261141      {
     
    12601175      "- Tab Delimited, Multiple Sample Files (TDMS Format) for " +
    12611176      "use in MeV (available from http://www.tm4.org).\n"+
    1262       "- BASEfile, and Plain Matrix",
     1177      "- BASEfile",
    12631178      "2.0",
    12641179      "2006, Base 2 development team",
     
    12881203  private static final String FORMAT_BASEFILE = "BASEfile";
    12891204  private static final String FORMAT_MEV = "MeV";
    1290   private static final String FORMAT_PLAIN_MATRIX = "Plain Matrix";
    1291  
     1205
    12921206
    12931207  public class QueryItem
Note: See TracChangeset for help on using the changeset viewer.