|
NCBI Home IEB Home C Toolkit docs C++ Toolkit source browser C Toolkit source browser (2) |
NCBI C Toolkit Cross ReferenceC/biostruc/mmdbapi.h |
source navigation diff markup identifier search freetext search file search |
1 /* ===========================================================================
2 *
3 * PUBLIC DOMAIN NOTICE
4 * National Center for Biotechnology Information (NCBI)
5 *
6 * This software/database is a "United States Government Work" under the
7 * terms of the United States Copyright Act. It was written as part of
8 * the author's official duties as a United States Government employee and
9 * thus cannot be copyrighted. This software/database is freely available
10 * to the public for use. The National Library of Medicine and the U.S.
11 * Government do not place any restriction on its use or reproduction.
12 * We would, however, appreciate having the NCBI and the author cited in
13 * any work or product based on this material
14 *
15 * Although all reasonable efforts have been taken to ensure the accuracy
16 * and reliability of the software and data, the NLM and the U.S.
17 * Government do not and cannot warrant the performance or results that
18 * may be obtained by using this software or data. The NLM and the U.S.
19 * Government disclaim all warranties, express or implied, including
20 * warranties of performance, merchantability or fitness for any particular
21 * purpose.
22 *
23 * ===========================================================================
24 *
25 * File Name: mmdbapi.h
26 *
27 * Author: Christopher Hogue
28 *
29 * Version Creation Date: 09/18/95
30 *
31 * $Revision: 6.5 $
32 *
33 * File Description: General Header with Macros for MMDBAPI.
34 *
35 * Modifications:
36 * --------------------------------------------------------------------------
37 * Date Name Description of modification
38 * ------- ---------- -----------------------------------------------------
39 *
40 * $Log: mmdbapi.h,v $
41 * Revision 6.5 2000/03/01 16:16:45 thiessen
42 * modified backbone definitions, added AM_PARTIALBACKBONE
43 *
44 * Revision 6.4 1999/03/05 22:44:00 vakatov
45 * Made ClearStructures() function be NLM_EXTERN -- for the DLL build on PC
46 *
47 * Revision 6.3 1998/04/16 00:30:01 lewisg
48 * get rid of dead code
49 *
50 * Revision 6.2 1998/03/13 22:34:26 lewisg
51 * fix neighbor mode
52 *
53 * Revision 6.1 1998/03/06 01:16:13 lewisg
54 * merge
55 *
56 * Revision 6.0 1997/08/25 18:10:53 madden
57 * Revision changed to 6.0
58 *
59 * Revision 5.2 1997/06/19 18:40:01 vakatov
60 * [WIN32,MSVC++] Adopted for the "NCBIOBJ.LIB" DLL'ization
61 *
62 * Revision 5.1 1997/03/13 22:07:20 vakatov
63 * In the preprocessor macros, surrounded macro argument("pfb") by parenthesis
64 *
65 * Revision 5.0 1996/05/28 14:02:09 ostell
66 * Set to revision 5.0
67 *
68 * Revision 1.5 1996/04/18 17:09:23 hogue
69 * Modifications for Neighbor mode with Master and Slave structures.
70 *
71 * Revision 1.4 1996/02/02 21:25:53 hogue
72 * changed to include mmdbapi4.h
73 *
74 * Revision 1.3 1996/01/31 21:32:24 hogue
75 * Major changes to accomodate multiple structures, added _mmdbAPI
76 *
77 * Revision 1.2 1995/10/05 20:22:16 hogue
78 * move mmdbapi struc definition to mmdbapi.h
79 *
80 * Revision 1.1 1995/09/20 13:45:47 kans
81 * Initial revision
82 *
83 *
84 * ==========================================================================
85 */
86
87 #ifndef _MMDBAPI_
88 #define _MMDBAPI_
89
90
91 #ifndef _MMDBAPI1_
92 #include <mmdbapi1.h> /* Type definitions, New/Free Functions */
93 #endif
94
95 #ifndef _MMDBAPI2_
96 #include <mmdbapi2.h> /* Traversers, & Utility functions */
97 #endif
98
99 #ifndef _MMDBAPI3_
100 #include <mmdbapi3.h> /* File generators */
101 #endif
102
103 #ifndef _MMDBAPI4_
104 #include <mmdbapi4.h> /* ASN.1 savers & future feature handling code */
105 #endif
106
107
108
109 #define PDB_ACC 1
110 #define LONG_NAME 2
111 #define PDB_CLASS 3
112 #define PDB_SOURCE 4
113
114 /* this struct may be later expanded with a ->next */
115 /* pointer for separate instances of programs */
116 /* running to isolate data ... */
117
118 typedef struct NLM_mmdbapi
119 {
120 PDNMS pdnmsMain; /* the list of structures for viewing */
121 PDNMS pdnmsMaster; /* pointer to master of an alignment */
122 PDNMS pdnmsSlave; /* pointer to slave of an alignment */
123 PDNMS pdnmsHolder; /* used for internal indexing First/next */
124 PDNMS pdnmsSelected; /* pointer to the active structure */
125 PDNMS pdnmsPrevious; /* pointer to the last active structure */
126 ValNodePtr pvnPFBSelect; /* linked-list of selected PFB pointers */
127 ValNodePtr pvnUndoMark; /* the undo marker for the Select list */
128 PRGD prgdDict; /* Global dictionary pointer */
129 Byte bExtent;
130 Boolean Neighbor; /* for child structures aligned to parent */
131 Int4 iLocalCount; /* assigns each new Biostruc a new number */
132 /* this is choice field in pvnPFBSelect */
133 /* and in the pdnms */
134 /* this may become a history list of MMDB */
135 /* ID's assoicated with each localcount */
136 Boolean fCn3D; /* oh gosh, a mode bit. Necessary for backward compatibility */
137 Int2 iFeatureSet;
138 Int2 iFeatureId;
139 PVNSFF pvnsffHead; /* ValNode list of registered feature functions */
140 PColor3DFunc pColorFunc;
141
142 } mmdbAPI, *pmmdbAPI;
143
144 /* MMDBAPI MACRO FUNCTIONS */
145
146 /* use these with any PFB node */
147 #define IsAtomNode(pfb) ((int) (pfb)->bMe == AM_MAD)
148 #define IsBondNode(pfb) ((int) (pfb)->bMe == AM_MBD)
149 #define IsGraphNode(pfb) ((int) (pfb)->bMe == AM_MGD)
150 #define IsMoleculeNode(pfb) ((int) (pfb)->bMe == AM_MMD)
151 #define IsObjectNode(pfb) ((int) (pfb)->bMe == AM_MOD)
152 #define IsDensityNode(pfb) ((int) (pfb)->bMe == AM_MDD)
153 #define IsStructureNode(pfb) ((int) (pfb)->bMe == AM_MSD)
154 #define IsAtomLocNode(pfb) ((int) (pfb)->bMe == AM_ALD)
155
156 /* use these when IsStructureNode(pfb) OR IsMoleculeNode(pfb) == TRUE */
157 #define IsIon(pfb) ((pfb)->bWhat & (Byte) AM_ION)
158 #define IsRNA(pfb) ((pfb)->bWhat & (Byte) AM_RNA)
159 #define IsDNA(pfb) ((pfb)->bWhat & (Byte) AM_DNA)
160 #define IsNA(pfb) (((pfb)->bWhat & (Byte) AM_RNA) || ((pfb)->bWhat & (Byte) AM_DNA))
161 #define IsProtein(pfb) ((pfb)->bWhat & (Byte) AM_PROT)
162 #define IsNAorProtein(pfb) (((pfb)->bWhat & (Byte) AM_RNA) || ((pfb)->bWhat & (Byte) AM_DNA)\
163 || ((pfb)->bWhat & (Byte) AM_PROT))
164 #define IsWater(pfb) ((pfb)->bWhat & (Byte) AM_WAT)
165 #define IsSolvent(pfb) (((pfb)->bWhat & (Byte) AM_SOL) || ((pfb)->bWhat & (Byte) AM_WAT))
166 #define IsHeterogen(pfb) ((pfb)->bWhat & (Byte) AM_HET)
167 #define IsOtherPolymer(pfb) ((pfb)->bWhat & (Byte) AM_POLY)
168
169 /* use these when IsGraphNode(pfb) == TRUE */
170 #define IsGraphRNABase(pfb) ((pfb)->bWhat & (Byte) RES_RNA)
171 #define IsGraphDNABase(pfb) ((pfb)->bWhat & (Byte) RES_DNA)
172 #define IsGraphNABase(pfb) (((pfb)->bWhat & (Byte) RES_RNA) || ((pfb)->bWhat & (Byte) RES_DNA))
173 #define IsGraphAminoAcid(pfb) ((pfb)->bWhat & (Byte) RES_AA)
174 #define IsGraphNAorAA(pfb) (((pfb)->bWhat & (Byte) RES_RNA) || ((pfb)->bWhat & (Byte) RES_DNA)\
175 || ((pfb)->bWhat & (Byte) RES_AA))
176
177 /* use these when IsGraphNode(pfb) AND IsGraphAminoAcid(pfb) == TRUE */
178 #define IsAAInPDBSS(pfb) ((pfb)->bPDBSecStru)
179 #define IsAAInPDBHelix(pfb) ((pfb)->bPDBSecStru & (Byte) SS_HELIX)
180 #define IsAAInPDBSheet(pfb) ((pfb)->bPDBSecStru & (Byte) SS_SHEET)
181 #define IsAAInPDBStrand(pfb) ((pfb)->bPDBSecStru & (Byte) SS_STRAND)
182 #define IsAAInPDBTurn(pfb) ((pfb)->bPDBSecStru & (Byte) SS_TURN)
183 #define IsAAInNCBISS(pfb) ((pfb)->bNCBISecStru)
184 #define IsAAInNCBIHelix(pfb) ((pfb)->bNCBISecStru & (Byte) SS_HELIX)
185 #define IsAAInNCBISheet(pfb) ((pfb)->bNCBISecStru & (Byte) SS_SHEET)
186 #define IsAAInNCBIStrand(pfb) ((pfb)->bNCBISecStru & (Byte) SS_STRAND)
187 #define IsAAInNCBITurn(pfb) ((pfb)->bNCBISecStru & (Byte) SS_TURN)
188
189
190 /* use these when IsAtomNode(pfb) == TRUE */
191 #define IsAtomBackBone(pfb) ((pfb)->bWhat & (Byte) AM_BACKBONE)
192 #define IsAtomPartialBackBone(pfb) ((pfb)->bWhat & (Byte) AM_PARTIALBACKBONE)
193 #define IsAtomCAlpha(pfb) ((pfb)->bWhat & (Byte) AM_CALPHA)
194 #define IsAtomPAlpha(pfb) ((pfb)->bWhat & (Byte) AM_PALPHA)
195 #define IsAtomAlpha(pfb) (((pfb)->bWhat & (Byte) AM_CALPHA) || ((pfb)->bWhat & (Byte) AM_PALPHA))
196 #define IsAtomCBeta(pfb) ((pfb)->bWhat & (Byte) AM_CBETA)
197 #define IsAtomNBeta(pfb) ((pfb)->bWhat & (Byte) AM_NBETA)
198 #define IsAtomBeta(pfb) (((pfb)->bWhat & (Byte) AM_CBETA) || ((pfb)->bWhat & (Byte) AM_NBETA))
199 #define IsAtomC1Ribose(pfb) ((pfb)->bWhat & (Byte) AM_C1RIBOSE)
200 #define IsAtomC4Ribose(pfb) ((pfb)->bWhat & (Byte) AM_C4RIBOSE)
201 #define AtomPDBName(pfb) (pfb)->pcAName
202 #define AtomicNumber(pfb) (pfb)->pvnmaLink->choice
203
204
205 /* use these when IsBondNode(pfb) == TRUE */
206 #define IsBondVirtual(pfb) ((pfb)->bWhat & (Byte) BOND_VIRTUAL)
207 #define IsBondPDouble(pfb) ((pfb)->bWhat & (Byte) BOND_PDOUBLE)
208 #define IsBondVanderWaal(pfb) ((pfb)->bWhat & (Byte) BOND_VDW)
209 #define IsBondIonic(pfb) ((pfb)->bWhat & (Byte) BOND_IONIC)
210 #define IsBondHydrogen(pfb) ((pfb)->bWhat & (Byte) BOND_H)
211 #define IsBondTriple(pfb) ((pfb)->bWhat & (Byte) BOND_TRIPLE)
212 #define IsBondDouble(pfb) ((pfb)->bWhat & (Byte) BOND_DOUBLE)
213 #define IsBondSingle(pfb) ((pfb)->bWhat & (Byte) BOND_SINGLE)
214 #define IsBondAromatic(pfb) (((pfb)->bWhat & (Byte) BOND_PDOUBLE) && ((pfb)->bWhat & (Byte) BOND_DOUBLE))
215
216 /* use these when IsObjectNode(pfb) == TRUE */
217 #define IsObjectSphere(pfb) ((pfb)->bWhat & (Byte) OBJ_SPHERE)
218 #define IsObjectCylinder(pfb) ((pfb)->bWhat & (Byte) OBJ_CYLINDER)
219 #define IsObjectBrick(pfb) ((pfb)->bWhat & (Byte) OBJ_BRICK)
220 #define IsObjectTMesh(pfb) ((pfb)->bWhat & (Byte) OBJ_TMESH)
221 #define IsObjectTriangles(pfb) ((pfb)->bWhat & (Byte) OBJ_TRIANGLES)
222 #define IsObjectCone(pfb) ((pfb)->bWhat & (Byte) OBJ_CONE)
223
224 /* use these when IsAtomLocNode(pfb) == TRUE */
225 #define AtomLocX(pfb) (pfb)->pflvData[0]
226 #define AtomLocY(pfb) (pfb)->pflvData[1]
227 #define AtomLocZ(pfb) (pfb)->pflvData[2]
228
229 /* use when IsStructureNode(pfb) == TRUE */
230 #define PDBAccession(pfb) (pfb)->pcPDBName
231
232
233
234 /* FUNCTION PROTOTYPES */
235
236 #undef NLM_EXTERN
237 #ifdef NLM_IMPORT
238 #define NLM_EXTERN NLM_IMPORT
239 #else
240 #define NLM_EXTERN extern
241 #endif
242
243 #ifdef __cplusplus
244 extern "C" {
245 #endif
246
247 PDNMS LIBCALL GetPDNMSMain(void);
248 NLM_EXTERN void LIBCALL ClearStructures(void);
249 void LIBCALL fnMMDBCn3Dmode (void);
250 NLM_EXTERN PRGD LIBCALL GetPRGDDictionary(void);
251 NLM_EXTERN void LIBCALL ChangeMMDBAPIbExtent(Byte bExtent);
252 NLM_EXTERN Byte LIBCALL GetMMDBAPIbExtent(void);
253 NLM_EXTERN Int2 LIBCALL OpenMMDBAPI(Byte bExtent, CharPtr pcDictName);
254 Boolean LIBCALL IsMMDBAPIOpen(void);
255 pmmdbAPI LIBCALL NewMMDBAPI(void);
256 BiostrucPtr LIBCALL FetchBiostrucPDB(CharPtr pcAcession, Int4 iModelLevel, Int4 iMaxModels);
257 Int4 LIBCALL MakeHashChange(PDNMS pdnmsThis);
258 Int4 LIBCALL CountModelstrucs(void);
259 NLM_EXTERN PDNMS LIBCALL MakeAModelstruc(BiostrucPtr pbsThis);
260 NLM_EXTERN void LIBCALL FreeAModelstruc(PDNMS pdnmsThis);
261 void LIBCALL SetNeighborOn(void);
262 Boolean LIBCALL AreNeighborsOn(void);
263 void LIBCALL SetNeighborOff(void);
264 void LIBCALL SetMasterModelstruc(PDNMS pdnmsThis);
265 void LIBCALL SetSlaveModelstruc(PDNMS pdnmsThis);
266 void LIBCALL SetHolderModelstruc(PDNMS pdnmsThis);
267 void LIBCALL SetSelectedModelstruc(PDNMS pdnmsThis);
268 PDNMS LIBCALL GetSelectedModelstruc(void);
269 PDNMS LIBCALL GetMasterModelstruc(void);
270 PDNMS LIBCALL GetSlaveModelstruc(void);
271 PDNMS LIBCALL GetFirstModelstruc(void);
272 PDNMS LIBCALL GetNextModelstruc(void);
273 PDNMS LIBCALL GetPreviousModelstruc(void);
274 PDNMS LIBCALL SwapModelstruc(void);
275 NLM_EXTERN void LIBCALL CloseMMDBAPI(void);
276 CharPtr LIBCALL GetStrucStrings(PDNMS pdnmsThis, Int4 iPickType);
277 ValNodePtr LIBCALL AddPFBSelect(PFB pfbThis);
278 void LIBCALL ClearPFBSelectList(void);
279 void LIBCALL UndoPFBSelectList(void);
280
281 Uint1 LIBCALL Call3DColorProc(ColorPropPtr pcpThis);
282 PSFF LIBCALL DoesFeatureTypeHaveFuncs(Uint1 iCode);
283
284 #ifdef __cplusplus
285 }
286 #endif
287
288 #undef NLM_EXTERN
289 #ifdef NLM_EXPORT
290 #define NLM_EXTERN NLM_EXPORT
291 #else
292 #define NLM_EXTERN
293 #endif
294
295 #endif
296
297 |
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more information. |