~ubuntu-branches/ubuntu/gutsy/ncbi-tools6/gutsy

« back to all changes in this revision

Viewing changes to tools/blastconcat.c

  • Committer: Bazaar Package Importer
  • Author(s): Barry deFreese
  • Date: 2005-09-27 15:38:20 UTC
  • mfrom: (1.1.3 upstream) (2.1.1 sarge)
  • Revision ID: james.westby@ubuntu.com-20050927153820-1t1sta0qirjpxaar
Tags: 6.1.20050429-1ubuntu1
GL/GLU Transition

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
static char const rcsid[] = "$Id: blastconcat.c,v 1.9 2004/04/21 19:25:04 coulouri Exp $";
 
1
static char const rcsid[] = "$Id: blastconcat.c,v 1.10 2005/01/10 18:52:29 coulouri Exp $";
2
2
 
3
3
/* ===========================================================================
4
4
*
33
33
          functionality.
34
34
 
35
35
******************************************************************************/
36
 
/* $Revision: 1.9 $ 
 
36
/* $Revision: 1.10 $ 
37
37
*  $Log: blastconcat.c,v $
 
38
*  Revision 1.10  2005/01/10 18:52:29  coulouri
 
39
*  fixes from morgulis to allow concatenation of >255 queries in [t]blastn
 
40
*
38
41
*  Revision 1.9  2004/04/21 19:25:04  coulouri
39
42
*  do not cast lvalues
40
43
*
532
535
          Uint4 i = 0;
533
536
          DenseSegPtr dsp = (DenseSegPtr)(sap->segs);
534
537
 
535
 
          for( ; i < dsp->numseg; ++i )
 
538
          for( ; i < (dsp->dim)*(dsp->numseg); i += dsp->dim )
536
539
          {
537
540
            start = dsp->starts[i];
538
541
            query = mult_queries->WhichQuery[start + 1] - 1;
539
 
            start = start - mult_queries->QueryStarts[query];
 
542
            
 
543
            if( start != -1 )
 
544
              start = start - mult_queries->QueryStarts[query];
 
545
 
540
546
            dsp->starts[i] = start;
541
547
          }
542
548
 
620
626
   AM: Changes to align on the byte boundaries.
621
627
*/
622
628
BioseqPtr LIBCALL 
623
 
BlastMakeFakeBspConcat PROTO((BspArray bsp_arr, Uint1 num_bsps, Boolean is_na, Uint4 num_spacers)){
 
629
BlastMakeFakeBspConcat PROTO((BspArray bsp_arr, Uint4 num_bsps, Boolean is_na, Uint4 num_spacers)){
624
630
        BioseqPtr tot;
625
631
        Int4 bsp_iter, letter_iter;
626
632
                /* "compact" len refers to #bytes to store the seq, not to #of letters */
830
836
         based on numbering beginning with 1, not 0 for queries and positions
831
837
*/
832
838
QueriesPtr LIBCALL 
833
 
BlastMakeMultQueries PROTO((BspArray bsp_arr, Uint1 num_queries, Boolean is_na, Uint1 spacer_len,
834
 
                            SeqLocPtr PNTR lcase_mask_arr)) {
 
839
BlastMakeMultQueries PROTO((BspArray bsp_arr, Uint4 num_queries, Boolean is_na, Uint4 num_spacers, SeqLocPtr PNTR lcase_mask_arr))
 
840
{
835
841
        QueriesPtr queries;
836
842
        Int4 bsp_iter, pos_iter;
837
843
        BioseqPtr curr_bsp;
879
885
                starts[bsp_iter] = curr_index;
880
886
                curr_index += curr_length;
881
887
                ends[bsp_iter] = curr_index - 1;
882
 
                curr_index += spacer_len;
 
888
                curr_index += num_spacers;
883
889
 
884
890
                if( is_na && bsp_iter != num_queries - 1 && curr_length%2 ) ++curr_index;
885
891
        }
886
 
        curr_index -= spacer_len;
 
892
        curr_index -= num_spacers;
887
893
        /* now curr_index = total number of letters in concat. query */
888
894
        queries->QueryStarts = starts;
889
895
        queries->QueryEnds = ends;