1
/* $Id: codon.h,v 6.1 1997/11/06 21:26:11 madden Exp $
2
* ===========================================================================
5
* National Center for Biotechnology Information
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.
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
22
* Please cite the author in any work or product based on this material.
24
* ===========================================================================
26
* File Name: $RCSfile: codon.h,v $
28
* Author: Jinghui Zhang
30
* Initial Version Creation Date: 03/24/97
38
* Revision 6.1 1997/11/06 21:26:11 madden
39
* Added print_label_to_buffer_all_ex with option to strip semicolons
41
* Revision 6.0 1997/08/25 18:05:21 madden
42
* Revision changed to 6.0
44
* Revision 5.6 1997/07/01 15:15:49 zjing
45
* fix the problem of label overflow
47
* Revision 5.5 1997/06/19 18:37:28 vakatov
48
* [WIN32,MSVC++] Adopted for the "NCBIOBJ.LIB" DLL'ization
50
* Revision 5.4 1997/03/24 21:00:07 shavirin
51
* Added protection for usage with C++ compiler. Added NCBI header
55
* ==========================================================================
69
typedef struct codonvector{
70
Uint2 exonCount; /*current count of exons*/
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;
82
#define NLM_EXTERN NLM_IMPORT
84
#define NLM_EXTERN extern
91
/******************************************************************
93
* aa_to_codon(sfp, aa_start, aa_stop)
94
* generate a list of CodonVecotr to show the codons of an
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
100
******************************************************************/
101
NLM_EXTERN ValNodePtr aa_to_codon PROTO((SeqFeatPtr sfp, Int4 aa_start, Int4 aa_stop));
104
/******************************************************************
106
* free_cvp_list(cvp_list)
107
* free a list of CodonVectorPtr
109
******************************************************************/
110
NLM_EXTERN ValNodePtr free_cvp_list PROTO((ValNodePtr cvp_list));
112
/*********************************************************************
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
119
* aa_start, aa_stop: start and stop in the amino acid sequence
121
*********************************************************************/
122
NLM_EXTERN CharPtr make_cds_paragraph PROTO((SeqFeatPtr sfp, Int4 aa_start, Int4 aa_stop));
127
/******************************************************************
129
* aa_to_dnaloc(sfp, aa_start, aa_stop)
130
* map the amino acid sequence to a list of Seq-locs in the
133
******************************************************************/
134
NLM_EXTERN SeqLocPtr aa_to_dnaloc PROTO((SeqFeatPtr sfp, Int4 aa_start, Int4 aa_stop));
136
NLM_EXTERN Int4 print_protein_for_cds PROTO((SeqFeatPtr sfp, CharPtr buf, SeqLocPtr loc, Boolean reverse_minus));
138
#define POS_SPACE 10 /*empty space used to write the position*/
139
#define STRAND_SPACE 3 /*empty space used to laod the orientation*/
142
/********************************************************************
144
* print_label_to_buffer(buf, label, pos, strand, extra_space)
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
151
*********************************************************************/
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,
157
NLM_EXTERN void print_label PROTO((FILE *fp, CharPtr label, Int4 pos, Uint1 strand, Boolean extra_space));
159
/********************************************************************
161
* print_label_to_buffer(buf, label, pos, strand, extra_space)
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
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));
173
/********************************************************************
175
* print_label_to_buffer_all_ex(buf, label, pos, strand, extra_space)
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
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));
190
NLM_EXTERN Boolean make_scale_bar_str PROTO((CharPtr PNTR bar, CharPtr PNTR num_str,
191
Int4 num_empty, Int4 line_len));
199
#define NLM_EXTERN NLM_EXPORT