~ubuntu-branches/ubuntu/raring/ncbi-tools6/raring

« back to all changes in this revision

Viewing changes to algo/blast/core/na_ungapped.c

  • Committer: Package Import Robot
  • Author(s): Aaron M. Ucko
  • Date: 2011-09-05 18:55:02 UTC
  • mfrom: (1.1.11 upstream)
  • Revision ID: package-import@ubuntu.com-20110905185502-iuvmoe65ytljhckn
Tags: 6.1.20110713-1
* New upstream release.
* debian/*.symbols: update accordingly.
* make/makeshlb.unx: link libcn3dOGL.so against -lm for sqrt.
* doc/man/*.1: update for new release.
* debian/rules:
  - (VIB): add asnmacro, as upstream takes care to publish binaries thereof.
  - Retire obsolete multiarch-unaware checks for libpthread.
  - Fully modernize Debhelper usage; in particular, transition to overrides.
* debian/compat: advance to 9 per rules modernization.
* debian/ncbi-tools-bin.install: add asnmacro.
* make/makenet.unx: link asnmacro only against libraries it directly needs.
* doc/man/asnmacro.1: give asnmacro a man page.
* doc/man/Psequin.1: list it in SEE ALSO.
* network/id1arch/idfetch.c: revert redundant change (from #295110).
* Convert to multiarch.
  - debian/rules: Install libraries (and ncbithr.o) to multiarch directories.
  - debian/lib*.install: match multiarch library paths.
  - debian/control:
    + Build-Depends: debhelper (>= 8.1.3~), implying a recent dpkg-dev.
    + Set Multi-Arch: as appropriate across the board, and specify
      Pre-Depends: ${misc:Pre-Depends} for runtime libraries.
* debian/*.lintian-overrides: drop leading slashes for Lintian 2.5.x.
* debian/control: Standards-Version: 3.9.2 (already compliant).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: na_ungapped.c,v 1.39 2010/07/27 18:24:31 kazimird Exp $
 
1
/* $Id: na_ungapped.c,v 1.43 2011/07/12 17:54:32 kazimird Exp $
2
2
 * ===========================================================================
3
3
 *
4
4
 *                            PUBLIC DOMAIN NOTICE
30
30
 
31
31
#ifndef SKIP_DOXYGEN_PROCESSING
32
32
static char const rcsid[] =
33
 
    "$Id: na_ungapped.c,v 1.39 2010/07/27 18:24:31 kazimird Exp $";
 
33
    "$Id: na_ungapped.c,v 1.43 2011/07/12 17:54:32 kazimird Exp $";
34
34
#endif                          /* SKIP_DOXYGEN_PROCESSING */
35
35
 
36
36
#include <algo/blast/core/na_ungapped.h>
710
710
            Int4 context = BSearchContextInfo(q_off, query_info);
711
711
            cutoffs = word_params->cutoffs + context;
712
712
            ungapped_data = &dummy_ungapped_data;
713
 
            s_NuclUngappedExtend(query, subject, matrix, q_off, s_end, s_off,
 
713
 
 
714
            /* 
 
715
             * Skip use of the scoring table and go straight to the matrix
 
716
             * based extension if matrix_only_scoring is set.  Used by
 
717
             * app rmblastn.
 
718
             * -RMH-
 
719
             */
 
720
            if ( word_params->options->program_number == eBlastTypeBlastn &&
 
721
                 word_params->matrix_only_scoring )
 
722
            {
 
723
               s_NuclUngappedExtendExact(query, subject, matrix, q_off,
 
724
                                  s_off, -(cutoffs->x_dropoff), ungapped_data);
 
725
            }else {
 
726
               s_NuclUngappedExtend(query, subject, matrix, q_off, s_end, s_off,
714
727
                                 -(cutoffs->x_dropoff), ungapped_data,
715
728
                                 word_params->nucl_score_table,
716
729
                                 cutoffs->reduced_nucl_cutoff_score);
 
730
            }
717
731
 
718
732
            if (off_found || ungapped_data->score >= cutoffs->cutoff_score) {
719
733
                BlastUngappedData *final_data =
865
879
            Int4 context = BSearchContextInfo(q_off, query_info);
866
880
            cutoffs = word_params->cutoffs + context;
867
881
            ungapped_data = &dummy_ungapped_data;
868
 
            s_NuclUngappedExtend(query, subject, matrix, q_off, s_end,
 
882
 
 
883
            /* 
 
884
             * Skip use of the scoring table and go straight to the matrix
 
885
             * based extension if matrix_only_scoring is set.  Used by
 
886
             * app rmblastn.
 
887
             * -RMH-
 
888
             */
 
889
            if ( word_params->options->program_number == eBlastTypeBlastn &&                          word_params->matrix_only_scoring )
 
890
            {
 
891
                s_NuclUngappedExtendExact(query, subject, matrix, q_off,
 
892
                                  s_off, -(cutoffs->x_dropoff), ungapped_data);
 
893
            }else {
 
894
                s_NuclUngappedExtend(query, subject, matrix, q_off, s_end,
869
895
                                 s_off, -(cutoffs->x_dropoff),
870
896
                                 ungapped_data,
871
897
                                 word_params->nucl_score_table,
872
898
                                 cutoffs->reduced_nucl_cutoff_score);
 
899
            }
 
900
 
873
901
            if (off_found || ungapped_data->score >= cutoffs->cutoff_score) {
874
902
                BlastUngappedData *final_data =
875
903
                    (BlastUngappedData *) malloc(sizeof(BlastUngappedData));
1350
1378
           technically be negative, but the compressed version
1351
1379
           of the query has extra pad bytes before q[0] */
1352
1380
 
1353
 
        if (s_offset > 0) {
 
1381
        if ( (s_offset > 0) && (q_offset > 0) ) {
1354
1382
            Uint1 q_byte = q[q_offset - 4];
1355
1383
            Uint1 s_byte = s[s_offset / COMPRESSION_RATIO - 1];
1356
1384
            ext_left = s_ExactMatchExtendLeft[q_byte ^ s_byte];
1359
1387
 
1360
1388
        /* look for up to 4 exact matches to the right of the seed */
1361
1389
 
1362
 
        if (ext_left < ext_to) {
 
1390
        if ((ext_left < ext_to) && ((q_offset + lut_word_length) < query->length)) {
1363
1391
            Uint1 q_byte = q[q_offset + lut_word_length];
1364
1392
            Uint1 s_byte = s[(s_offset + lut_word_length) / COMPRESSION_RATIO];
1365
1393
            Int4 ext_right = s_ExactMatchExtendRight[q_byte ^ s_byte];
1583
1611
    scan_range[2] = subject->length - lut_word_length; /*end pos (inclusive) of scan*/
1584
1612
 
1585
1613
    /* if sequence is masked, fall back to generic scanner and extender */
1586
 
    if (subject->mask_type) {
1587
 
        scansub = (TNaScanSubjectFunction) 
 
1614
    if (subject->mask_type != eNoSubjMasking) {
 
1615
        if (lookup_wrap->lut_type == eMBLookupTable &&
 
1616
            ((BlastMBLookupTable *) lookup_wrap->lut)->discontiguous) {
 
1617
            /* discontiguous scan subs assumes any (non-aligned starting offset */
 
1618
        } else {
 
1619
            scansub = (TNaScanSubjectFunction) 
1588
1620
                  BlastChooseNucleotideScanSubjectAny(lookup_wrap);
1589
 
        if (extend != (TNaExtendFunction)s_BlastNaExtendDirect) {
1590
 
             extend = (lookup_wrap->lut_type == eSmallNaLookupTable) 
 
1621
            if (extend != (TNaExtendFunction)s_BlastNaExtendDirect) {
 
1622
                 extend = (lookup_wrap->lut_type == eSmallNaLookupTable) 
1591
1623
                    ? (TNaExtendFunction)s_BlastSmallNaExtend
1592
1624
                    : (TNaExtendFunction)s_BlastNaExtend;
 
1625
            }
1593
1626
        }
1594
1627
        /* generic scanner permits any (non-aligned) starting offset */
1595
1628
        scan_range[1] = subject->seq_ranges[0].left + word_length - lut_word_length;