~ubuntu-branches/ubuntu/breezy/ncbi-tools6/breezy

« back to all changes in this revision

Viewing changes to api/codon.h

  • Committer: Bazaar Package Importer
  • Author(s): Aaron M. Ucko
  • Date: 2002-04-04 22:13:09 UTC
  • Revision ID: james.westby@ubuntu.com-20020404221309-vfze028rfnlrldct
Tags: upstream-6.1.20011220a
ImportĀ upstreamĀ versionĀ 6.1.20011220a

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* $Id: codon.h,v 6.1 1997/11/06 21:26:11 madden Exp $
 
2
* ===========================================================================
 
3
*
 
4
*                            PUBLIC DOMAIN NOTICE
 
5
*               National Center for Biotechnology Information
 
6
*
 
7
*  This software/database is a "United States Government Work" under the
 
8
*  terms of the United States Copyright Act.  It was written as part of
 
9
*  the author's official duties as a United States Government employee and
 
10
*  thus cannot be copyrighted.  This software/database is freely available
 
11
*  to the public for use. The National Library of Medicine and the U.S.
 
12
*  Government have not placed any restriction on its use or reproduction.
 
13
*
 
14
*  Although all reasonable efforts have been taken to ensure the accuracy
 
15
*  and reliability of the software and data, the NLM and the U.S.
 
16
*  Government do not and cannot warrant the performance or results that
 
17
*  may be obtained by using this software or data. The NLM and the U.S.
 
18
*  Government disclaim all warranties, express or implied, including
 
19
*  warranties of performance, merchantability or fitness for any particular
 
20
*  purpose.
 
21
*
 
22
*  Please cite the author in any work or product based on this material.
 
23
*
 
24
* ===========================================================================
 
25
*
 
26
* File Name:  $RCSfile: codon.h,v $
 
27
*
 
28
* Author:  Jinghui Zhang
 
29
*
 
30
* Initial Version Creation Date: 03/24/97
 
31
*
 
32
* $Revision: 6.1 $
 
33
*
 
34
* File Description:
 
35
*         
 
36
*
 
37
* $Log: codon.h,v $
 
38
* Revision 6.1  1997/11/06 21:26:11  madden
 
39
* Added print_label_to_buffer_all_ex with option to strip semicolons
 
40
*
 
41
* Revision 6.0  1997/08/25 18:05:21  madden
 
42
* Revision changed to 6.0
 
43
*
 
44
* Revision 5.6  1997/07/01 15:15:49  zjing
 
45
* fix the problem of label overflow
 
46
*
 
47
* Revision 5.5  1997/06/19 18:37:28  vakatov
 
48
* [WIN32,MSVC++]  Adopted for the "NCBIOBJ.LIB" DLL'ization
 
49
*
 
50
* Revision 5.4  1997/03/24 21:00:07  shavirin
 
51
* Added protection for usage with C++ compiler. Added NCBI header
 
52
* and started logging
 
53
*
 
54
*
 
55
* ==========================================================================
 
56
*/
 
57
 
 
58
#ifndef _CODON_
 
59
#define _CODON_
 
60
 
 
61
#include <ncbi.h>
 
62
#include <objfeat.h>
 
63
#include <seqport.h>
 
64
#include <seqmgr.h>
 
65
#include <jzmisc.h> 
 
66
#include <gather.h>
 
67
#include <satutil.h>
 
68
 
 
69
typedef struct codonvector{
 
70
        Uint2 exonCount;        /*current count of exons*/
 
71
        CharPtr buf[3];
 
72
        Int4 dna_pos;           /*position in dna sequence*/
 
73
        SeqIdPtr sip;           /*id for the DNA sequence for label*/
 
74
        Uint1 strand;           /*orientation of CDs*/
 
75
        Uint1 frame;            /*the frame of current exon*/
 
76
        Int2 aa_index;          /*0 for partial start , 1 for normal*/
 
77
}CodonVector, PNTR CodonVectorPtr;
 
78
 
 
79
 
 
80
#undef NLM_EXTERN
 
81
#ifdef NLM_IMPORT
 
82
#define NLM_EXTERN NLM_IMPORT
 
83
#else
 
84
#define NLM_EXTERN extern
 
85
#endif
 
86
 
 
87
#ifdef __cplusplus
 
88
extern "C" {
 
89
#endif
 
90
 
 
91
/******************************************************************
 
92
*
 
93
*       aa_to_codon(sfp, aa_start, aa_stop)
 
94
*       generate a list of CodonVecotr to show the codons of an
 
95
*       amino acid sequence
 
96
*       sfp: the Seq-feat for cds
 
97
*       aa_start: the start position of protein sequence
 
98
*       aa_stop the stop position of protein sequence
 
99
*
 
100
******************************************************************/
 
101
NLM_EXTERN ValNodePtr aa_to_codon PROTO((SeqFeatPtr sfp, Int4 aa_start, Int4 aa_stop));
 
102
 
 
103
 
 
104
/****************************************************************** 
 
105
 
106
*       free_cvp_list(cvp_list)
 
107
*       free a list of CodonVectorPtr 
 
108
 
109
******************************************************************/ 
 
110
NLM_EXTERN ValNodePtr free_cvp_list PROTO((ValNodePtr cvp_list));
 
111
 
 
112
/*********************************************************************
 
113
*
 
114
*       make_cds_paragraph(sfp, aa_start, aa_stop)
 
115
*       return a buffer for the display of 3-codon under one amino 
 
116
*       acid format. It also includes the new line characters 
 
117
*       This is what Jonathan K. desires to have for the sequin 
 
118
*       doc object
 
119
*       aa_start, aa_stop: start and stop in the amino acid sequence
 
120
*
 
121
*********************************************************************/
 
122
NLM_EXTERN CharPtr make_cds_paragraph PROTO((SeqFeatPtr sfp, Int4 aa_start, Int4 aa_stop));
 
123
 
 
124
 
 
125
 
 
126
 
 
127
/******************************************************************
 
128
*
 
129
*       aa_to_dnaloc(sfp, aa_start, aa_stop)
 
130
*       map the amino acid sequence to a list of Seq-locs in the 
 
131
*       DNA sequence
 
132
*
 
133
******************************************************************/
 
134
NLM_EXTERN SeqLocPtr aa_to_dnaloc PROTO((SeqFeatPtr sfp, Int4 aa_start, Int4 aa_stop));
 
135
 
 
136
NLM_EXTERN Int4 print_protein_for_cds PROTO((SeqFeatPtr sfp, CharPtr buf, SeqLocPtr loc, Boolean reverse_minus));
 
137
 
 
138
#define POS_SPACE 10    /*empty space used to write the position*/
 
139
#define STRAND_SPACE 3  /*empty space used to laod the orientation*/
 
140
#define B_SPACE 10
 
141
 
 
142
/******************************************************************** 
 
143
 
144
*       print_label_to_buffer(buf, label, pos, strand, extra_space) 
 
145
*
 
146
*       print a label (with label_name=label, position=pos, 
 
147
*       orientation = strand, extra_space = extra_space for partial start) 
 
148
*       into the current buffer 
 
149
*       return the offset of the buffer pointer to the current buffer 
 
150
 
151
*********************************************************************/
 
152
 
 
153
NLM_EXTERN Int4 print_label_to_buffer PROTO((CharPtr buf, CharPtr label, Int4 pos, 
 
154
        Uint1 strand, Boolean extra_space, Boolean is_html, Int4 label_space, 
 
155
        Int4 num_space));
 
156
 
 
157
NLM_EXTERN void print_label PROTO((FILE *fp, CharPtr label, Int4 pos, Uint1 strand, Boolean extra_space));
 
158
 
 
159
/********************************************************************
 
160
*
 
161
*       print_label_to_buffer(buf, label, pos, strand, extra_space)
 
162
*
 
163
*       print a label (with label_name=label, position=pos, 
 
164
*       orientation = strand, extra_space = extra_space for partial start)
 
165
*       into the current buffer
 
166
*       return the offset of the buffer pointer to the current buffer
 
167
*
 
168
*********************************************************************/
 
169
NLM_EXTERN Int4 print_label_to_buffer_all PROTO((CharPtr buf, CharPtr label, 
 
170
                Int4 pos, Uint1 strand, Boolean extra_space, Boolean is_html, 
 
171
                Int4 label_space, Int4 num_space, Boolean show_strand));
 
172
 
 
173
/********************************************************************
 
174
*
 
175
*       print_label_to_buffer_all_ex(buf, label, pos, strand, extra_space)
 
176
*
 
177
*       print a label (with label_name=label, position=pos, 
 
178
*       orientation = strand, extra_space = extra_space for partial start)
 
179
*       into the current buffer
 
180
*       return the offset of the buffer pointer to the current buffer
 
181
*       Has an option to strip/not-strip semicolons for hardline old blast
 
182
*       users.
 
183
*
 
184
*********************************************************************/
 
185
NLM_EXTERN Int4 print_label_to_buffer_all_ex PROTO((CharPtr buf, CharPtr label, 
 
186
                Int4 pos, Uint1 strand, Boolean extra_space, Boolean is_html, 
 
187
                Int4 label_space, Int4 num_space, Boolean show_strand, 
 
188
                Boolean strip_semicolon));
 
189
 
 
190
NLM_EXTERN Boolean make_scale_bar_str PROTO((CharPtr PNTR bar, CharPtr PNTR num_str, 
 
191
                Int4 num_empty, Int4 line_len));
 
192
 
 
193
#ifdef __cplusplus
 
194
}
 
195
#endif
 
196
 
 
197
#undef NLM_EXTERN
 
198
#ifdef NLM_EXPORT
 
199
#define NLM_EXTERN NLM_EXPORT
 
200
#else
 
201
#define NLM_EXTERN
 
202
#endif
 
203
 
 
204
#endif