Changeset 4050


Ignore:
Timestamp:
Dec 7, 2007, 1:57:26 PM (15 years ago)
Author:
Martin Svensson
Message:

Fixes #864 Some core plug-ins report negative progress values in large experiments.

Location:
branches/2.5-stable/src
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • branches/2.5-stable/src/clients/web/net/sf/basedb/clients/web/plugins/SimpleExport.java

    r3991 r4050  
    468468    template.writeHeaders();
    469469   
    470     int numExported = 0;
     470    long numExported = 0;
    471471    ResultIterator result = null;
    472472    try
     
    506506          if (progress != null)
    507507          {
    508             int percent = (int)(100f * numExported / totalItems);
     508            int percent = (int)(100L * numExported / totalItems);
    509509            progress.display(percent, numExported + " of " + totalItems + " done.");
    510510          }
  • branches/2.5-stable/src/core/net/sf/basedb/core/Affymetrix.java

    r3820 r4050  
    357357      if (hasProgress && (index % progressInterval == 0))
    358358      {
    359         int percent = 5 + 90 * index / numProbesets;
     359        int percent = 5 + (int)(90L * (long)index / numProbesets);
    360360        int remain = numProbesets - index;
    361361        String created = create ? "; " + numCreated + " created" : "";
  • branches/2.5-stable/src/core/net/sf/basedb/core/RawBioAssay.java

    r4020 r4050  
    11221122      DataQuery<RawData> rawQuery = getRawData();
    11231123      DataResultIterator<RawData> result = rawQuery.iterate(dc);
    1124       int numValidated = 0;
     1124      long numValidated = 0;
    11251125      int numTotal = getNumDbSpots();
    11261126      while (result.hasNext())
     
    11831183        if (progress != null && numValidated % 100 == 0)
    11841184        {
    1185           int percent = 10 + (90 * numValidated) / numTotal;
     1185          int percent = 10 + ((int)(90L * numValidated) / numTotal);
    11861186          progress.display(percent, "Validated " + numValidated + " of " + numTotal + " spots.");
    11871187        }
  • branches/2.5-stable/src/core/net/sf/basedb/core/SpotImages.java

    r3820 r4050  
    472472          if (progress != null)
    473473          {
    474             int spotsDone = spotImagesPerImage*imageNumber;
    475             int percent = 10 + 90 * spotsDone / totalSpots;
     474            long spotsDone = spotImagesPerImage*imageNumber;
     475            int percent = 10 + (int)(90L * spotsDone / totalSpots);
    476476            progress.display(percent, "Generating spot images ("+spotsDone+" done)...");
    477477          }
  • branches/2.5-stable/src/core/net/sf/basedb/util/BioAssaySetFilterUtil.java

    r4017 r4050  
    123123    }
    124124   
    125     int spotsDone = 0;
     125    long spotsDone = 0;
    126126    int spotsAfter = 0;
    127127    if (progress != null) progress.display(10, "Filtering spots (0 done; "+spotsTotal+" total)...");
     
    139139      if (progress != null)
    140140      {
    141         int percent = 10 + 90 * spotsDone / spotsTotal;
     141        int percent = 10 + (int)(90L * spotsDone / spotsTotal);
    142142        progress.display(percent,
    143143          "Filtering spot intensities ("+spotsDone+" done; "+spotsTotal+" total)...");
     
    205205    // Prepare progress reporting
    206206    int interval = 10;  // Update progress after this many spots >= 10
    207     int spotsDone = 0;
     207    long spotsDone = 0;
    208208    int spotsAfter = 0;
    209209    if (progress != null)
     
    236236            if (spotsDone % interval == 0)
    237237            {
    238               int percent = 10 + 90 * spotsDone / spotsTotal;
     238              int percent = 10 + (int)(90L * spotsDone / spotsTotal);
    239239              progress.display(percent,
    240240                "Filtering spot intensities ("+spotsDone+" done; "+spotsTotal+" total)...");
  • branches/2.5-stable/src/core/net/sf/basedb/util/IntensityCalculatorUtil.java

    r4020 r4050  
    305305    int maxPosition = 0;
    306306   
    307     int spotsDone = 0; // Number of calculated spots
     307    long spotsDone = 0; // Number of calculated spots
    308308    int totalSpots = 0; // Total number of spots
    309309    int interval = 0; // Interval between reporter to the progress reporter
     
    426426          if (spotsDone % interval == 0)
    427427          {
    428             int percent = 10 + 90 * spotsDone / totalSpots;
     428            int percent = 10 + (int)((90L * spotsDone) / totalSpots);
    429429            progress.display(percent, "Calculating spot intensities ("+spotsDone+" done)...");
    430430          }
  • branches/2.5-stable/src/plugins/core/net/sf/basedb/plugins/BioAssaySetExporter.java

    r4044 r4050  
    685685    int nof_reporters=bioassayset.getNumReporters();
    686686    int progress_report_interval=nof_reporters/10;
    687     int nof_processed_reporters=0;
     687    long nof_processed_reporters=0;
    688688    while (spotData.hasNext())
    689689    {
    690690      if (progress != null && (nof_processed_reporters%progress_report_interval == 0))
    691691      {
    692         progress.display(100 * nof_processed_reporters / nof_reporters,
     692        progress.display((int)(100L * nof_processed_reporters / nof_reporters),
    693693                         "Exporting ... " + nof_processed_reporters + " of " +
    694694                         nof_reporters + " done.");
     
    781781    int nof_spots=bioassayset.getNumSpots();
    782782    int progress_spot_interval=nof_spots/10;
    783     int nof_processed_spots=0;
     783    long nof_processed_spots=0;
    784784    while (spotData.hasNext())
    785785    {
     
    791791          (nof_processed_spots%progress_spot_interval == 0))
    792792        {
    793           progress.display(100 * nof_processed_spots / nof_spots,
     793          progress.display((int)(100L * nof_processed_spots / nof_spots),
    794794                           "Exporting ..." + nof_processed_spots + " of " +
    795795                           nof_spots + " done.");
  • branches/2.5-stable/src/plugins/core/net/sf/basedb/plugins/LowessNormalization.java

    r4034 r4050  
    351351    query.restrict(intensityRestriction);
    352352    long numSpots = query.count(dc);
    353     int normalizedSpots = 0;
     353    long normalizedSpots = 0;
    354354    if (progress != null) progress.display((int)(normalizedSpots / numSpots * 100), normalizedSpots + " spots normalized");
    355355   
     
    431431            }
    432432            normalizedSpots += smoothCurve.size();
    433             if (progress != null) progress.display((int)((normalizedSpots * 100) / numSpots), normalizedSpots + " spots normalized");
     433            if (progress != null) progress.display((int)((normalizedSpots * 100L) / numSpots), normalizedSpots + " spots normalized");
    434434          }
    435435          fromBlock = toBlock + 1;
  • branches/2.5-stable/src/plugins/core/net/sf/basedb/plugins/MedianRatioNormalization.java

    r4040 r4050  
    349349    query.restrict(intensityRestriction);
    350350    long numSpots = query.count(dc);
    351     int normalizedSpots = 0;
     351    long normalizedSpots = 0;
    352352    if (progress != null) progress.display((int)(normalizedSpots / numSpots * 100), normalizedSpots + " spots normalized");
    353353   
     
    441441            }
    442442            normalizedSpots += toIndex - fromIndex;
    443             if (progress != null) progress.display((int)((normalizedSpots * 100) / numSpots), normalizedSpots + " spots normalized");
     443            if (progress != null) progress.display((int)((normalizedSpots * 100L) / numSpots), normalizedSpots + " spots normalized");
    444444          }
    445445          fromBlock = toBlock + 1;
Note: See TracChangeset for help on using the changeset viewer.