|
NCBI Home IEB Home C Toolkit docs C++ Toolkit source browser C Toolkit source browser (2) |
NCBI C Toolkit Cross ReferenceC/biostruc/bsannotvs.c |
source navigation diff markup identifier search freetext search file search |
1 /* bsannotvs.c
2 *
3 * ===========================================================================
4 *
5 * PUBLIC DOMAIN NOTICE
6 * National Center for Biotechnology Information (NCBI)
7 *
8 * This software/database is a "United States Government Work" under the
9 * terms of the United States Copyright Act. It was written as part of
10 * the author's official duties as a United States Government employee and
11 * thus cannot be copyrighted. This software/database is freely available
12 * to the public for use. The National Library of Medicine and the U.S.
13 * Government do not place any restriction on its use or reproduction.
14 * We would, however, appreciate having the NCBI and the author cited in
15 * any work or product based on this material
16 *
17 * Although all reasonable efforts have been taken to ensure the accuracy
18 * and reliability of the software and data, the NLM and the U.S.
19 * Government do not and cannot warrant the performance or results that
20 * may be obtained by using this software or data. The NLM and the U.S.
21 * Government disclaim all warranties, express or implied, including
22 * warranties of performance, merchantability or fitness for any particular
23 * purpose.
24 *
25 * ===========================================================================
26 *
27 * File Name: bsannotvs.c
28 *
29 * Author: Ken Addess
30 *
31 * $Log: bsannotvs.c,v $
32 * Revision 6.4 1998/11/20 20:04:39 addess
33 * related to platform independence of VAST Search
34 *
35 * Revision 6.3 1998/11/13 15:22:47 addess
36 * removed some uneeded code related to align chains
37 *
38 * Revision 6.2 1998/10/14 17:44:56 addess
39 * for sending aligned chains from vastsearch
40 *
41 * Revision 6.1 1998/07/17 18:51:13 madej
42 * Allows Vast Search results to be viewed with RasMol and Kinemage.
43 *
44 */
45
46 /* This is a copy from mmdbapi so that vastsearch alignment can be viewed with */
47 /* Rasmol and Kinemage */
48
49 #include <stdio.h>
50 #include <ncbi.h>
51 #include <accentr.h>
52 #include <objalign.h>
53 #include <objseq.h>
54 #include <objmgr.h>
55 #include <lsqfetch.h>
56 #include <netentr.h>
57 #include <www.h>
58 #include <sys/resource.h>
59 #include <mmdbapi.h>
60 #include <mmdbapi1.h>
61 #include "vastlocl.h"
62 #include "mmdblocl.h"
63 #include "mmdbdata.h"
64 #include "vast2mage.h"
65 #include "vastsrv.h"
66 #include <asnmime.h>
67 #include <objmime.h>
68 #include <strimprt.h>
69
70
71 Boolean InstBSAnnotSetVS(BiostrucAnnotSetPtr pbsasThis, CharPtr JobID)
72 {
73 Int2 iTest;
74 Int4 iMMDBId;
75 PDNMS pdnmsThis = NULL;
76 PMSD pmsdThis = NULL;
77 BiostrucPtr pbsThis = NULL, pbsTemp = NULL;
78 BiostrucIdPtr pbsidThis = NULL;
79 BiostrucFeatureSetPtr pbsfsThis = NULL;
80 BiostrucFeaturePtr pbsfThis = NULL;
81 PSFS psfsThis = NULL;
82 CharPtr szTemp;
83 Char szName[5];
84 Char AsnPath[PATH_MAX];
85 Char AsnName[10];
86
87 /* the Feature set either attaches to an in-memory Modelstruc */
88 /* or, if it specifies a new Modelstruc - attempts a retrieval */
89
90 if (pbsasThis == NULL) return FALSE;
91
92 /* grab the id out of the Biostruc-descr */
93
94 /* pbsidThis = ValNodeFindNext(pbsasThis->id,NULL,BiostrucId_mmdb_id); */
95 /* if (pbsidThis) only deal with the first one */
96 /* { */
97 /* iMMDBId = (Int4) pbsidThis->data.intvalue; */
98 /*printf("iMMDBID=%ld\n", iMMDBId); master MMDB_ID*/
99 /* } */
100
101 szTemp = pbsasThis->features->features->name;
102 szName[0] = szTemp[0];
103 szName[1] = szTemp[1];
104 szName[2] = szTemp[2];
105 szName[3] = szTemp[3];
106 szName[4] = '\0';
107
108 MasterChain[0] = ' ';
109 MasterChain[1] = '\0';
110 SlaveChain[0] = ' ';
111 SlaveChain[1] = '\0';
112
113 if (Chain)
114 {
115 MasterChain[0] = szTemp[4];
116 MasterChain[1] = '\0';
117 }
118
119 if (JobID)
120 {
121 AsnName[0]='\0';
122 StringCpy(AsnName, "/b");
123 StringCat(AsnName, szName);
124
125 AsnPath[0]='\0';
126 StringCpy(AsnPath, VSPATH);
127 StringCat(AsnPath, JobID);
128 StringCat(AsnPath, AsnName);
129 pbsThis = FetchBS(AsnPath, 0, ALLSIMPLEMDL, 3, POWER_VIEW);
130
131 /* This is dead code. Don't need it. Ken */
132 /* if (MasterChain[0] != ' ') */
133 /* { */
134 /* pbsTemp = (BiostrucPtr)PruneBiostruc(pbsThis, MasterChain);*/
135 /* pbsThis = NULL; */
136 /* pbsThis = pbsTemp; */
137 /* } */
138 }
139 else
140 {
141 pbsThis = FetchBiostrucPDB(szName, ALLSIMPLEMDL, 3);
142 SlaveChain[0] = szTemp[11];
143 SlaveChain[1] = '\0';
144 MasterChain[0] = ' ';
145 MasterChain[1] = '\0';
146 }
147
148 /*pbsThis = MMDBBiostrucGet(iMMDBId, ALLSIMPLEMDL, 3);*/
149 if (!pbsThis) goto nogomem;
150 pdnmsThis = MakeAModelstruc(pbsThis);
151 /* side effect is that this is now the selected modelstruc too */
152 if (!pdnmsThis) goto nogomem;
153
154 pmsdThis = (PMSD) pdnmsThis->data.ptrvalue;
155
156 /****** WARNING: fix this if this code is ever used to recognize Neighbor mode *********/
157 SetSelectedModelstruc(pdnmsThis); /* set it to selected one */
158 /* at this point we have annot-set, and its associated Modelstruc */
159
160 pbsfsThis = pbsasThis->features;
161
162 while (pbsfsThis) /* walk through each feature-set */
163 {
164 iTest = BiostrucAddFeature(pbsfsThis,pdnmsThis);
165 if (iTest < 0) goto nogomem; /* a malloc error */
166 if (!iTest) goto nogo; /* bad feature table error - fatal */
167 pbsfsThis = pbsfsThis->next;
168 }
169 /* given a sucessfully registered Biostruc-annot-set
170 we can now free it */
171 BiostrucAnnotSetFree(pbsasThis);
172 return TRUE;
173
174 nogomem:
175 nogo:
176 BiostrucAnnotSetFree(pbsasThis);
177 return FALSE;
178 }
179 |
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more information. |