 |
Bsoft
2.1.0
Bernard's software package
|
Go to the documentation of this file.
43 cout <<
"DEBUG read_model_molecule: " << *file_list << endl;
45 for ( i=1, filename = file_list; filename; filename = filename->
next, i++ ) {
47 cout <<
"Reading file: " << *filename << endl;
54 if ( molgroup->
id.
length() && molgroup->
id[0] !=
' ') mp->
id = molgroup->
id;
58 for ( bond = molgroup->
bond; bond; bond = bond->
next ) {
63 for ( j=0; j<4; j++ ) link->
color[j] = 1;
65 for ( mol = molgroup->
mol; mol; mol = mol->
next ) {
66 for ( res = mol->
res; res; res = res->
next ) {
67 for ( atom = res->
atom; atom; atom = atom->
next ) {
73 comp->
sel = (int) (atom->
q + 0.999);
77 for ( bond = molgroup->
bond, link = mp->
link; bond && link; bond = bond->
next, link = link->
next ) {
78 if ( atom == bond->
atom1 ) link->
comp[0] = comp;
79 else if ( atom == bond->
atom2 ) link->
comp[1] = comp;
109 Batom* atom = NULL, *atom2;
116 for ( n=i=0, mp =
model; mp; mp = mp->
next, n++ ) {
118 if ( !molgroup ) molgroup = mg;
128 for ( comp = mp->
comp; comp; comp = comp->
next ) {
138 for ( link = mp->
link; link; link = link->
next ) {
139 for ( comp = mp->
comp, atom = res->
atom; comp && comp != link->
comp[0] && atom;
140 comp = comp->
next, atom = atom->
next ) ;
141 for ( comp = mp->
comp, atom2 = res->
atom; comp && comp != link->
comp[1] && atom2;
142 comp = comp->
next, atom2 = atom2->
next ) ;
143 if ( atom && atom2 ) {
147 cerr <<
"Error: Problem with link " << link->
comp[0]->
id <<
" to " << link->
comp[1]->
id << endl;
153 cout <<
"DEBUG write_model_molecule: atoms converted: " << i << endl;
Bmolgroup * molgroup_init()
Initializes and allocates a new molecule group.
Batom * atom_add(Batom **atom, const char *type)
Adds an atom to a linked list.
Bresidue * residue_add(Bresidue **res, const char *type)
Adds a residue to a linked list.
int molgroup_kill(Bmolgroup *molgroup)
Destroys a molecule group.
Bmodel * read_model_molecule(Bstring *file_list, Bstring ¶mfile)
Reads molecular model parameters.
Header file for reading and writing atomic model files.
char * add_item(char **list, unsigned long size)
Adds an item to a linked list.
int molgroup_list_kill(Bmolgroup *molgroup)
Destroys a molecule group linked list.
Bcomponent * component_add(Bcomponent **comp, Bstring &id)
Adds a component to a linked list.
Bmolgroup * read_molecule(const char *filename, const char *select, const char *paramfile)
The generalized function for reading molecular files.
Library routines used for model link processing.
long models_process(Bmodel *model, long(modfunc)(Bmodel *))
Process a list of models using the specified function.
int write_model_molecule(Bstring &filename, Bmodel *model)
Writes molecular model parameters.
Header file for reading reflection files.
int molgroup_list_write(Bstring &filename, Bmolgroup *molgroup)
Writes a molecule group list.
Header file for general utilities.
Bbond * bond_add(Bbond **bond, Batom *atom1, Batom *atom2, double l, double k)
Adds a bond to a linked list.
Header file for generalized linked list functions.
Bmodel * model_add(Bmodel **model, Bstring &id)
Adds a model to a linked list.
Library routines used for model processing.
Bcomptype * model_add_type_by_id(Bmodel *model, Bstring &id)
Add a type to a model if the identifier does not exist already.
long model_setup_links(Bmodel *model)
Set up the link list for each component.
Bmolecule * molecule_add(Bmolecule **mol, char *name)
Adds a molecule to a linked list.