~ubuntu-branches/ubuntu/edgy/ncbi-tools6/edgy

« back to all changes in this revision

Viewing changes to algo/blast/api/blast_tabular.c

  • Committer: Bazaar Package Importer
  • Author(s): Barry deFreese
  • Date: 2006-07-19 23:28:07 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20060719232807-et3cdmcjgmnyleyx
Tags: 6.1.20060507-3ubuntu1
Re-merge with Debian

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: blast_tabular.c,v 1.30 2005/11/22 13:30:34 madden Exp $
 
1
/* $Id: blast_tabular.c,v 1.32 2006/04/25 17:59:02 papadopo Exp $
2
2
* ===========================================================================
3
3
*
4
4
*                            PUBLIC DOMAIN NOTICE
28
28
 * On-the-fly tabular formatting of BLAST results
29
29
 */
30
30
 
31
 
static char const rcsid[] = "$Id: blast_tabular.c,v 1.30 2005/11/22 13:30:34 madden Exp $";
 
31
static char const rcsid[] = "$Id: blast_tabular.c,v 1.32 2006/04/25 17:59:02 papadopo Exp $";
32
32
 
33
33
#include <algo/blast/api/blast_tabular.h>
34
34
#include <algo/blast/core/blast_util.h>
48
48
 
49
49
BlastTabularFormatData*
50
50
BlastTabularFormatDataNew(FILE* outfp, SeqLoc* query_seqloc,
51
 
                          EBlastTabularFormatOptions format_option)
 
51
                          EBlastTabularFormatOptions format_option,
 
52
                          Boolean believe_query)
52
53
{
53
54
   BlastTabularFormatData* tf_data = 
54
55
      (BlastTabularFormatData*) calloc(1, sizeof(BlastTabularFormatData));
55
56
   tf_data->outfp = outfp;
56
57
   tf_data->query_slp = query_seqloc;
57
58
   tf_data->format_options = format_option;
 
59
   tf_data->believe_query = believe_query;
58
60
 
59
61
   return tf_data;
60
62
}
161
163
   Int4* starts;
162
164
   Int4* lengths;
163
165
   Int4 offset;
164
 
   GapEditScript* esp;
165
166
   Int4 start1, start2;
166
167
   char* buffer;
167
168
   Boolean reverse;
174
175
   reverse = (hsp->query.frame != hsp->subject.frame);
175
176
 
176
177
   /* Calculate number of segments. */
177
 
   esp = hsp->gap_info;
178
 
   for (numseg = 0; esp; esp = esp->next, ++numseg);
 
178
   numseg = hsp->gap_info->size;
179
179
   /* Find the starts and lengths of each segment. */
180
180
   start1 = hsp->query.offset;
181
181
   start2 = hsp->subject.offset;
182
 
   GapCollectDataForSeqalign(hsp, hsp->gap_info, numseg, query_length,
 
182
   GapCollectDataForSeqalign(hsp, hsp->gap_info, 0, numseg, query_length,
183
183
                             subject_length, translate1, translate2,
184
184
                             &starts, &lengths, NULL, &start1, &start2);
185
185
 
376
376
            description. */
377
377
         if (tf_data->show_gi || tf_data->show_accession) {
378
378
            Blast_SeqIdGetDefLine(subject_id, &subject_buffer, 
379
 
                                  tf_data->show_gi, tf_data->show_accession); 
 
379
                                  tf_data->show_gi, tf_data->show_accession,
 
380
                                  TRUE); 
380
381
         } else {
381
382
            if ( !(subject_buffer = (char*) malloc(sizeof(char)*SEQIDLEN_MAX)))
382
383
               return NULL;
415
416
         query_index = 
416
417
            Blast_GetQueryIndexFromContext(hsp->context, program);
417
418
         Blast_SeqIdGetDefLine(query_id_array[query_index], &query_buffer, 
418
 
                               tf_data->show_gi, tf_data->show_accession);
 
419
                               tf_data->show_gi, tf_data->show_accession,
 
420
                               tf_data->believe_query);
419
421
         
420
422
         eval_buff_ptr = eval_buff;
421
423
         ScoreAndEvalueToBuffers(hsp->bit_score, hsp->evalue,