Changeset 8292 for trunk

Show
Ignore:
Timestamp:
09/12/11 13:43:29 (6 months ago)
Author:
westram
Message:
  • ptserver crashed when designing probes for species with empty data (only gaps) or too few nucs (less than probe len) [fixed and print warnings]
Location:
trunk/PROBE
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/PROBE/PT_new_design.cxx

    r8041 r8292  
    907907        int used_idx = 0; 
    908908        for (int name = 0; name < psg.data_count; name++) { 
    909             if (psg.data[name].inside_group()) { 
    910                 group_idx[used_idx++]                  = name; // store marked group indices 
    911                 unsigned long size                     = psg.data[name].get_size(); 
    912                 datasize                              += size; 
    913                 if (datasize<size) datasize            = ULONG_MAX; // avoid overflow! 
    914                 if (size > maxseqlength) maxseqlength  = size; 
     909            const probe_input_data& pid = psg.data[name]; 
     910 
     911            if (pid.inside_group()) { 
     912                group_idx[used_idx++] = name;                  // store marked group indices 
     913 
     914                unsigned long size  = pid.get_size(); 
     915                datasize           += size; 
     916 
     917                if (size<1 || (unsigned long)size<pdc->probelen) { 
     918                    fprintf(stderr, "Warning: impossible design request for '%s' (contains only %lu bp)\n", pid.get_name(), size); 
     919                } 
     920 
     921                if (datasize<size) datasize           = ULONG_MAX;  // avoid overflow! 
     922                if (size > maxseqlength) maxseqlength = size; 
    915923            } 
    916924        } 
     
    946954    char partstring[256]; 
    947955    PT_init_base_string_counter(partstring, PT_A, partsize); 
     956 
    948957    while (!PT_base_string_counter_eof(partstring)) { 
    949958#if defined(DEBUG) 
     
    962971 
    963972        for (int g = 0; g<group_count; ++g) { 
    964             int      name             = group_idx[g]; 
    965             long     possible_tprobes = psg.data[name].get_size()-pdc->probelen+1; 
     973            int  name             = group_idx[g]; 
     974            long possible_tprobes = psg.data[name].get_size()-pdc->probelen+1; 
     975 
     976            if (possible_tprobes<1) possible_tprobes = 1; // avoid wrong hash-size if no/not enough data 
     977 
    966978            GB_HASH *hash_one         = GBS_create_hash(possible_tprobes*hash_multiply, GB_MIND_CASE); // count tprobe occurrences for one group/sequence 
    967979            ptnd_add_sequence_to_hash(pdc, hash_one, psg.data[name].get_data(), psg.data[name].get_size(), pdc->probelen, partstring, partsize); 
  • trunk/PROBE/probe.h

    r8041 r8292  
    105105    char *data;       // sequence 
    106106    long  checksum;   // checksum of sequence 
    107     int   size; 
     107    int   size; // @@@ misleading (contains 1 if no bases in sequence) 
    108108 
    109109    char   *name;