1 /*   cdrgn.h
2 * ===========================================================================
3 *
4 *                            PUBLIC DOMAIN NOTICE
5 *            National Center for Biotechnology Information (NCBI)
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 do not place any restriction on its use or reproduction.
13 *  We would, however, appreciate having the NCBI and the author cited in
14 *  any work or product based on this material
15 *
16 *  Although all reasonable efforts have been taken to ensure the accuracy
17 *  and reliability of the software and data, the NLM and the U.S.
18 *  Government do not and cannot warrant the performance or results that
19 *  may be obtained by using this software or data. The NLM and the U.S.
20 *  Government disclaim all warranties, express or implied, including
21 *  warranties of performance, merchantability or fitness for any particular
22 *  purpose.
23 *
24 * ===========================================================================
25 *
26 * File Name:  cdrgn.h
27 *
28 * Author:  Jonathan Kans
29 *
30 * Version Creation Date:   1/22/95
31 *
32 * $Revision: 6.15 $
33 *
34 * File Description:
35 *
36 * Modifications:
37 * --------------------------------------------------------------------------
38 * $Log: cdrgn.h,v $
39 * Revision 6.15  2010/09/21 12:54:12  bollin
40 * Fixed bug in update mRNA spans button - needs to use original location to
41 * find mRNA to update.
42 *
43 * Revision 6.14  2009/09/02 15:08:39  bollin
44 * New RNA editing.
45 *
46 * Revision 6.13  2008/01/17 21:18:09  bollin
47 * Fixes for RNA dialog for ncRNA product/class handling
48 *
49 * Revision 6.12  2007/12/21 17:30:27  bollin
50 * Changes to dialog for selecting ncRNA class and RNA type - allow ncRNA class
51 * Any if selecting RNA type in a constraint context, test dialog to generate
52 * error if "other" is the class but no text is specified.
53 *
54 * Revision 6.11  2007/11/26 21:16:29  bollin
55 * Moved CreatencRNAClassDialog proto into cdrgn.h
56 *
57 * Revision 6.10  2007/09/21 18:05:23  bollin
58 * code in place for conversion of old-style misc_RNA, snRNA, scRNA, and snoRNA
59 * features to new ncRNA features, commented out until changeover.
60 *
61 * Revision 6.9  2007/09/10 20:08:51  bollin
62 * Correction to MatchesRnaType
63 *
64 * Revision 6.8  2007/09/10 18:47:11  kans
65 * prototype for SetRnaSpecificQuals, cast for codon argument to ParseTRnaString
66 *
67 * Revision 6.7  2007/09/10 18:33:15  bollin
68 * Changes for new ncRNA and tmRNA class editor.
69 *
70 * Revision 6.6  2007/07/25 13:53:12  bollin
71 * Removed local copy of TruncateLocation from sequin3.c, made TruncateLocation
72 * function in desktop/cdrgn.c extern and added prototype to cdrgn.h
73 *
74 * Revision 6.5  2003/10/23 16:43:56  kans
75 * changed operon to import feature
76 *
77 * Revision 6.4  2003/10/07 13:52:01  kans
78 * added gap, operon, oriT features and ecotype, estimated_length and operon qualifiers
79 *
80 * Revision 6.3  2000/07/08 20:44:00  vakatov
81 * Get all "#include" out of the 'extern "C" { }' scope;  other cleanup...
82 *
83 * ==========================================================================
84 */
85 
86 #ifndef _CDRGN_
87 #define _CDRGN_
88 
89 #include <dlogutil.h>
90 
91 #ifdef __cplusplus
92 extern "C" {
93 #endif
94 
95 #define REGISTER_CDRGN_EDIT ObjMgrProcLoad(OMPROC_EDIT,"Edit CdRgn","CDS",OBJ_SEQFEAT,FEATDEF_CDS,OBJ_SEQFEAT,FEATDEF_CDS,NULL,CdRgnGenFunc,PROC_PRIORITY_DEFAULT)
96 
97 extern ForM CreateCdRgnForm (Int2 left, Int2 top, CharPtr title,
98                              SeqFeatPtr sfp, SeqEntryPtr sep,
99                              FormActnFunc actproc);
100 extern Int2 LIBCALLBACK CdRgnGenFunc (Pointer data);
101 
102 extern void CdRgnFeatFormActnProc (ForM f);
103 extern void CdRgnTranslateWithFrame (ForM f, Uint1 frame);
104 
105 extern SeqLocPtr PredictCodingRegion (BioseqPtr nuc, BioseqPtr prot, Int2 genCode);
106 
107 #define REGISTER_GENE_EDIT ObjMgrProcLoad(OMPROC_EDIT,"Edit Gene","Gene",OBJ_SEQFEAT,FEATDEF_GENE,OBJ_SEQFEAT,FEATDEF_GENE,NULL,GeneGenFunc,PROC_PRIORITY_DEFAULT)
108 
109 extern ForM CreateGeneForm (Int2 left, Int2 top, CharPtr title,
110                             SeqFeatPtr sfp, SeqEntryPtr sep,
111                             FormActnFunc actproc);
112 extern Int2 LIBCALLBACK GeneGenFunc (Pointer data);
113 
114 #define REGISTER_PROT_EDIT(PROCNAME,PROCLABEL,SUBTYPE) ObjMgrProcLoad(OMPROC_EDIT,PROCNAME,PROCLABEL,OBJ_SEQFEAT,SUBTYPE,OBJ_SEQFEAT,SUBTYPE,NULL,ProtGenFunc,PROC_PRIORITY_DEFAULT)
115 
116 extern ForM CreateProtForm (Int2 left, Int2 top, CharPtr title,
117                             SeqFeatPtr sfp, SeqEntryPtr sep,
118                             FormActnFunc actproc);
119 extern Int2 LIBCALLBACK ProtGenFunc (Pointer data);
120 
121 #define REGISTER_RNA_EDIT(PROCNAME,PROCLABEL,SUBTYPE) ObjMgrProcLoad(OMPROC_EDIT,PROCNAME,PROCLABEL,OBJ_SEQFEAT,SUBTYPE,OBJ_SEQFEAT,SUBTYPE,NULL,RnaGenFunc,PROC_PRIORITY_DEFAULT)
122 
123 extern ForM CreateRnaForm (Int2 left, Int2 top, CharPtr title,
124                            SeqFeatPtr sfp, SeqEntryPtr sep,
125                            Uint2 subtype, FormActnFunc actproc);
126 extern Int2 LIBCALLBACK RnaGenFunc (Pointer data);
127 
128 extern void ConvertProductQualToRnaRefName (SeqFeatPtr sfp);
129 
130 extern SeqLocPtr TruncateLocation (SeqLocPtr head, Int4 len);
131 
132 /* for searching for RNA values of a certain type */
133 typedef struct rnatype {
134   Int4    rna_featdef; /* use FEATDEF_ANY for match any RNA */
135   CharPtr ncrna_class; /* value to look for in ncrna_class qual */
136 } RnaTypeData, PNTR RnaTypePtr;
137 
138 extern RnaTypePtr RnaTypeFree (RnaTypePtr rtp);
139 extern Boolean MatchesRnaType (SeqFeatPtr sfp, RnaTypePtr rtp);
140 extern void ApplyRnaTypeToSeqFeat (SeqFeatPtr sfp, RnaTypePtr rtp);
141 extern void ApplyProductToRNA (SeqFeatPtr sfp, CharPtr product);
142 extern void AddToComment (SeqFeatPtr sfp, CharPtr comment);
143 extern DialoG RnaTypeDialog (GrouP h, Boolean is_constraint, Nlm_ChangeNotifyProc change_notify, Pointer change_userdata);
144 extern DialoG CreatencRNAClassDialog (GrouP h, Boolean is_constraint, Nlm_ChangeNotifyProc change_notify, Pointer change_userdata);
145 NLM_EXTERN void UpdatemRNAAfterEditing(DialoG d, SeqLocPtr old_slp, SeqLocPtr new_slp);
146 
147 #ifdef __cplusplus
148 }
149 #endif
150 
151 #endif /* ndef _CDRGN_ */
152 
153