 |
Bsoft
2.1.0
Bernard's software package
|
Go to the documentation of this file.
50 if ( !molgroup )
return NULL;
88 if ( name.
length() ) new_mol->
id = name;
94 while ( this_mol->
next ) this_mol = this_mol->
next;
95 this_mol->
next = new_mol;
123 memset(new_res, 0,
sizeof(
Bresidue));
126 if ( type.
contains(
"***") ) strcpy(new_res->
type,
"UNK");
127 else strncpy(new_res->
type, type.
c_str(), 6);
133 while ( this_res->
next ) this_res = this_res->
next;
134 this_res->
next = new_res;
160 Batom* this_atom = *atom;
162 memset(new_atom, 0,
sizeof(
Batom));
171 cout <<
"DEBUG atom_add: type=" << new_atom->
type <<
" el=" << new_atom->
el << endl;
176 while ( this_atom->
next ) this_atom = this_atom->
next;
177 this_atom->
next = new_atom;
194 for ( mol = molgroup->
mol; mol; mol = mol->
next )
195 for( res = mol->
res; res; res = res->
next ) nres++;
212 for ( mol = molgroup->
mol; mol; mol = mol->
next )
213 for( res = mol->
res; res; res = res->
next )
214 for ( atom = res->
atom; atom; atom = atom->
next ) natom++;
232 while ( isspace(type[0]) ) type++;
233 strncpy(atom->
type, type, 8);
235 if ( isdigit(type[0]) ) {
236 if ( type[1] ==
'H' ) atom->
el[0] =
'H';
237 else atom->
el[0] =
'C';
238 }
else if ( isalpha(type[0]) ) {
239 atom->
el[0] = toupper(type[0]);
240 if ( isalpha(type[1]) ) {
241 if ( islower(type[1]) ) atom->
el[1] = type[1];
243 if ( atom->
el[0] ==
'M' )
244 atom->
el[1] = tolower(type[1]);
247 cout <<
"Warning: No element assigned for atom " << atom->
type << endl;
272 if ( k < 1e-10 ) k = 1;
274 Bbond* this_bond = *bond;
276 memset(new_bond, 0,
sizeof(
Bbond));
278 new_bond->
atom1 = atom1;
279 new_bond->
atom2 = atom2;
284 cout <<
"DEBUG bond_add: strength=" << k << endl;
289 while ( this_bond->
next ) this_bond = this_bond->
next;
290 this_bond->
next = new_bond;
314 Bangle* this_angle = *angle;
316 memset(new_angle, 0,
sizeof(
Bangle));
321 if ( a < 0.1 ) a = d1.
angle(d2);
323 new_angle->
atom1 = atom1;
324 new_angle->
atom2 = atom2;
325 new_angle->
atom3 = atom3;
330 cout <<
"DEBUG angle_add: size=" << a <<
" strength=" << k << endl;
335 while ( this_angle->
next ) this_angle = this_angle->
next;
336 this_angle->
next = new_angle;
349 if ( molgroup == NULL )
return 0;
352 cout <<
"DEBUG molgroup_list_kill: comment length = " <<
354 cout <<
"DEBUG molgroup_list_kill: maxlen = " << molgroup->
maxlen <<
355 " (" << molgroup->
maxlen*
sizeof(int) <<
")" << endl;
360 for ( ; molgroup; ) {
361 molgroup2 = molgroup->
next;
363 molgroup = molgroup2;
376 if ( molgroup == NULL )
return 0;
379 cout <<
"DEBUG molgroup_kill: name = " << molgroup->
id << endl;
380 cout <<
"DEBUG molgroup_kill: comment length = " <<
382 cout <<
"DEBUG molgroup_kill: maxlen = " << molgroup->
maxlen <<
383 " (" << molgroup->
maxlen*
sizeof(int) <<
")" << endl;
388 for ( mol = molgroup->
mol; mol; ) {
419 if ( mol == NULL )
return 0;
424 cout <<
"DEBUG molecule_kill: name = " << mol->
id << endl;
425 if ( mol->
seq.
length() ) cout <<
"DEBUG molecule_kill: seq length = " <<
427 if ( mol->
naseq.
length() ) cout <<
"DEBUG molecule_kill: naseq length = " <<
431 for ( res = mol->
res; res; ) {
455 if ( res == NULL )
return 0;
461 for ( atom = res->
atom; atom; ) {
506 angle2 = angle->
next;
528 for ( ; molgroup; molgroup=molgroup->
next ) {
530 if ( !molgroupcopy ) molgroupcopy = mgc;
531 else mgc2->
next = mgc;
554 molgroupcopy->
next = NULL;
555 molgroupcopy->
num = molgroup->
num;
556 molgroupcopy->
id = molgroup->
id;
565 molgroupcopy->
min = molgroup->
min;
566 molgroupcopy->
max = molgroup->
max;
567 molgroupcopy->
box = molgroup->
box;
569 molgroupcopy->
sel = molgroup->
sel;
570 molgroupcopy->
fom = molgroup->
fom;
576 molgroupcopy->
mol = NULL;
577 molgroupcopy->
bond = NULL;
579 for ( mol = molgroup->
mol; mol; mol = mol->
next ) {
581 if ( molcopy ) molcopy->
next = newmol;
582 else molgroupcopy->
mol = newmol;
601 if ( mol == NULL )
return NULL;
607 new_mol->
id = mol->
id;
624 Batom *atom, *new_atom;
626 for ( res = mol->
res; res; res = res->
next ) {
630 strncpy(new_res->
type, res->
type, 6);
631 for ( atom = res->
atom; atom; atom = atom->
next ) {
633 memcpy(new_atom, atom,
sizeof(
Batom));
634 new_atom->
next = NULL;
638 for ( sec = mol->
sec; sec; sec = sec->
next ) {
641 new_sec->
next = NULL;
642 for ( res=mol->
res, new_res=new_mol->
res; res; res=res->
next, new_res=new_res->
next ) {
643 if ( sec->
first == res ) new_sec->
first = new_res;
644 if ( sec->
last == res ) new_sec->
last = new_res;
649 cout <<
"DEBUG molecule_copy: new_mol->id = " << new_mol->
id << endl;
666 if ( molgroup == NULL )
return NULL;
667 if ( mol == NULL )
return NULL;
674 if ( molgroup->
mol ) {
675 for ( mol=molgroup->
mol; mol->
next; mol=mol->
next ) ;
677 if ( new_mol->
id[0] !=
' ' ) {
682 for ( mol=molgroup->
mol; mol; mol=mol->
next )
683 if ( mol->
id[0] == molid ) notset = 1;
685 if ( molid < 'A' || molid >
'Z' ) molid =
'A';
686 new_mol->
id[0] = molid;
689 molgroup->
mol = new_mol;
692 cout <<
"DEBUG mol_copy_and_add_to_molgroup: new_mol->id = " << new_mol->
id << endl;
714 Bbond* bond_copy = NULL;
716 Bangle* angle_copy = NULL;
718 molgroupcopy->
bond = NULL;
719 molgroupcopy->
angle = NULL;
721 for ( maxid=0, mol = molgroup->
mol; mol; mol = mol->
next )
722 for( res = mol->
res; res; res = res->
next )
723 for ( atom = res->
atom; atom; atom = atom->
next )
724 if ( maxid < atom->num ) maxid = atom->
num;
730 for ( mol=molgroupcopy->
mol; mol; mol=mol->
next )
731 for( res=mol->
res; res; res=res->
next )
732 for ( atom=res->
atom; atom; atom=atom->
next )
733 acl[atom->
num] = atom;
735 for ( bond = molgroup->
bond; bond; bond = bond->
next ) {
738 if ( !molgroupcopy->
bond ) molgroupcopy->
bond = bond_copy;
741 for ( angle = molgroup->
angle; angle; angle = angle->
next ) {
744 if ( !molgroupcopy->
angle ) molgroupcopy->
angle = angle_copy;
749 return molgroupcopy->
bond;
767 for ( mg = molgroup->
next; mg; mg = mg->
next ) {
769 for ( ; mol->
next; mol = mol->
next ) ;
772 mol = molgroup->
mol = mg->
mol;
776 for ( ; bond->
next; bond = bond->
next ) ;
783 for ( ; angle->
next; angle = angle->
next ) ;
791 molgroup->
next = NULL;
828 if ( filename.
empty() ) {
829 error_show(
"No molecule filename!", __FILE__, __LINE__);
836 cout <<
"DEBUG read_molecule: extension=" << ext << endl;
840 if ( thefile.
length() < 1 ) {
841 error_show(
"No molecule file given!", __FILE__, __LINE__);
852 cout <<
"Reading file: " << molgroup->
filename << endl;
853 cout <<
"Selecting: " << molgroup->
select << endl << endl;
873 n =
readPDB(thefile, molgroup);
877 n =
readPIR(thefile, molgroup);
879 n =
readWAH(thefile, molgroup);
881 cerr <<
"Error: File type not supported!" << endl;
899 if ( molgroup->
maxlen > 0 ) {
901 for ( i=0; i<molgroup->
maxlen; i++ ) molgroup->
seqflag[i] = 1;
926 for ( filename = file_list; filename; filename = filename->
next ) {
927 molgroup1 =
read_molecule(*filename, atom_select, paramfile);
929 if ( box[0] > 0 && box[1] > 0 && box[2] > 0 ) molgroup1->
box = box;
934 for ( ; mol->
next; mol = mol->
next ) ;
937 mol = molgroup->
mol = molgroup1->
mol;
939 molgroup1->
mol = NULL;
941 for ( ; bond->
next; bond = bond->
next ) ;
944 bond = molgroup->
bond = molgroup1->
bond;
946 molgroup1->
bond = NULL;
948 for ( ; angle->
next; angle = angle->
next ) ;
953 molgroup1->
angle = NULL;
956 molgroup = molgroup1;
958 bond = molgroup->
bond;
959 angle = molgroup->
angle;
983 if ( !filename.
length() ) {
984 error_show(
"No output file name given!", __FILE__, __LINE__);
988 if ( !molgroup->
mol ) {
989 cerr <<
"Error: No molecules to write!" << endl;
1000 cout <<
"Writing file: " << thefile << endl;
1025 cerr <<
"Error: File type not supported!" << endl;
1037 cout <<
"Molecules written: " << n << endl;
1058 if ( molgroup->
next ) {
1059 for ( i=1; molgroup; molgroup = molgroup->
next, i++ ) {
1080 for ( mol=molgroup->
mol; mol; mol=mol->
next ) n++;
1095 for ( mol=molgroup->
mol; mol; mol=mol->
next )
1112 for ( res=mol->
res; res; res=res->
next ) n++;
1129 for ( mol=molgroup->
mol; mol; mol=mol->
next )
1146 for ( res=mol->
res; res; res=res->
next )
1147 for ( atom=res->
atom; atom; atom=atom->
next ) n++;
1164 if ( !molgroup )
return -1;
1170 long i, j, n, nmol(0), gaps(1);
1175 cout <<
"DEBUG molgroup_sequence_check: select=" << molgroup->
select <<
" gaps=" << gaps << endl;
1178 cout <<
"Checking sequence" << endl << endl;
1181 for ( mol = molgroup->
mol; mol; mol = mol->
next, nmol++ ) {
1183 cout <<
"DEBUG molgroup_sequence_check: sequence " << mol->
seq << endl;
1186 temp =
new char[n+1];
1188 for ( i=0, j=0; i<n; i++ ) {
1189 if ( isalpha(mol->
naseq[i]) ) temp[j++] = toupper(mol->
naseq[i]);
1190 if ( mol->
naseq[i] ==
'-' || mol->
naseq[i] ==
'.' ) temp[j++] =
'-';
1193 for ( i=0, j=0; i<n; i++ ) {
1194 if ( isalpha(mol->
naseq[i]) ) temp[j++] = toupper(mol->
naseq[i]);
1203 temp =
new char[n+1];
1205 for ( i=0, j=0; i<n; i++ ) {
1206 if ( isalpha(mol->
seq[i]) ) temp[j++] = toupper(mol->
seq[i]);
1207 else if ( mol->
seq[i] ==
'-' || mol->
seq[i] ==
'.' ) temp[j++] =
'-';
1210 for ( i=0, j=0; i<n; i++ ) {
1211 if ( isalpha(mol->
seq[i]) ) temp[j++] = toupper(mol->
seq[i]);
1219 for ( n = 0, res = mol->
res; res; res = res->
next, n++);
1221 temp =
new char[n+1];
1222 for ( n = 0, res = mol->
res; res; res = res->
next, n++ )
1232 cout <<
"DEBUG molgroup_sequence_check: length=" << mol->
nres <<
" sequence " << mol->
seq << endl;
1236 cout <<
"DEBUG molgroup_sequence_check: maxlen=" << molgroup->
maxlen << endl;
1256 for ( m=i=0; i<molgroup->
maxlen; i++ ) {
1257 for ( n=0, mol=molgroup->
mol; mol; mol=mol->
next ) {
1259 else if ( mol->
seq[i] ==
'-' ) n++;
1267 m = molgroup->
maxlen - m;
1269 for ( mol=molgroup->
mol; mol; mol=mol->
next ) {
1272 for ( n=i=0; i<molgroup->
maxlen; i++ ) {
1274 newseq[n++] = mol->
seq[i];
1284 molgroup->
seqflag =
new int[m];
1285 for ( i=0; i<m; i++ ) molgroup->
seqflag[i] = 1;
1298 if ( !molgroup )
return -1;
1301 cout <<
"DEBUG molgroup_stats: Calculating molecule group statistics" << endl;
1303 long nmol(0), natom_all(0), nres_all(0), nbase_all(0);
1305 double Bmin_all(1000), Bmax_all(-1000);
1307 molgroup->
min[0] = molgroup->
min[1] = molgroup->
min[2] = 1000;
1308 molgroup->
max[0] = molgroup->
max[1] = molgroup->
max[2] = -1000;
1310 for ( mol = molgroup->
mol; mol; mol = mol->
next ) {
1312 nres_all += mol->
nres;
1313 nbase_all += mol->
nbase;
1314 if ( Bmin_all > mol->
Bmin ) Bmin_all = mol->
Bmin;
1315 if ( Bmax_all < mol->Bmax ) Bmax_all = mol->
Bmax;
1324 molgroup->
box = molgroup->
max - molgroup->
min;
1327 cout <<
"Statistics for molecule group:" << endl;
1328 cout <<
"Molecules: " << nmol << endl;
1329 cout <<
"Maximum sequence length: " << molgroup->
maxlen << endl;
1331 cout <<
"Bases: " << nbase_all << endl;
1333 cout <<
"Residues: " << nres_all << endl;
1335 cout <<
"Atoms: " << natom_all << endl;
1337 cout <<
"Bonds specfied: " << nbond << endl;
1338 if ( natom_all > 0 ) {
1339 cout <<
"Coordinate minima and maxima: " << molgroup->
min <<
" " << molgroup->
max << endl;
1340 cout <<
"Bounding box size: " << molgroup->
box << endl;
1341 cout <<
"Bfactor min & max: " << Bmin_all <<
" " << Bmax_all << endl;
1364 if ( !mol )
return -1;
1367 cout <<
"DEBUG mol_stats: Calculating molecule statistics: " << mol->
id << endl;
1369 long natom(0), nres(0), nhelix(0), nstrand(0);
1373 double Bsum(0), Bssum(0);
1382 for ( res = mol->
res; res; res = res->
next ) {
1383 for ( atom = res->
atom; atom; atom = atom->
next ) {
1387 if ( mol->
Bmin > atom->
b ) mol->
Bmin = atom->
b;
1388 if ( mol->
Bmax < atom->
b ) mol->
Bmax = atom->
b;
1390 Bssum += atom->
b*atom->
b;
1397 mol->
Bave = Bsum/natom;
1402 if ( mol->
max[0] - mol->
min[0] < 1 ) {
1403 mol->
max[0] = mol->
min[0] = (mol->
max[0] + mol->
min[0])/2;
1407 if ( mol->
max[1] - mol->
min[1] < 1 ) {
1408 mol->
max[1] = mol->
min[1] = (mol->
max[1] + mol->
min[1])/2;
1412 if ( mol->
max[2] - mol->
min[2] < 1 ) {
1413 mol->
max[2] = mol->
min[2] = (mol->
max[2] + mol->
min[2])/2;
1419 for ( sec=mol->
sec; sec; sec=sec->
next )
1425 cout <<
"Statistics for molecule: " << mol->
id << endl;
1427 cout <<
"Bases: " << mol->
nbase << endl;
1429 cout <<
"Sequence length: " << mol->
nres << endl;
1431 cout <<
"Residues: " << nres << endl;
1433 cout <<
"Atoms: " << natom << endl;
1435 cout <<
"Helices: " << nhelix << endl;
1437 cout <<
"Strands: " << nstrand << endl;
1439 cout <<
"Coordinate minima and maxima: " << mol->
min <<
" " << mol->
max << endl;
1440 cout <<
"Bfactor min, max, avg, & std: " <<
1441 mol->
Bmin <<
" " << mol->
Bmax <<
" " << mol->
Bave <<
" " << mol->
Bstd << endl;
1473 for ( i=0; i<n; i++ )
1474 new_comment = new_comment + strings[i] +
" ";
1477 cout <<
"DEBUG molecule_update_comment: " << new_comment << endl;
1479 for ( mg = molgroup; mg; mg = mg->
next )
1502 for ( mol = molgroup->
mol; mol; mol = mol->
next ) {
1503 for( res = mol->
res; res; res = res->
next ) {
1504 for ( atom = res->
atom; atom; atom = atom->
next ) {
1506 for ( t=0, at = atompar; at && atom->
tnum < 0; at = at->
next, t++ ) {
1507 if ( strncmp(atom->
el, at->
el, 2) == 0 ) {
1513 if ( atom->
tnum < 0 ) {
1514 for ( t=0, at = atompar; at && atom->
tnum < 0; at = at->
next, t++ ) {
1515 if ( strncasecmp(atom->
el, at->
el, 2) == 0 ) {
1523 if ( atom->
tnum < 0 )
1524 cerr <<
"Warning: No type asigned for atom " << atom->
num
1525 <<
" (" << atom->
type <<
", " << atom->
el <<
")!" << endl;
1526 if ( atom->
mass <= 0 )
1527 cerr <<
"Warning: No mass asigned for atom " << atom->
num
1528 <<
" (" << atom->
type <<
", " << atom->
el <<
")!" << endl;
1541 if ( !bondlist )
return 0;
1545 for ( bond = bondlist; bond; bond = bond->
next ) {
1546 if ( bond->
atom1 == atom1 && bond->
atom2 == atom2 )
return 1;
1547 if ( bond->
atom1 == atom2 && bond->
atom2 == atom1 )
return 1;
1562 if ( molgroup->
bond ) {
1563 if (
verbose ) cerr <<
"Warning: Bond list already defined!" << endl;
1564 return molgroup->
bond;
1568 cout <<
"Generating bonds:" << endl;
1569 cout <<
"Bond length cutoff: " << maxlength <<
" A" << endl;
1573 long i, ii, x, y, z, xx, yy, zz, ix, iy, iz, xs, ys, xe, ye, ze;
1577 double dist, reflength;
1580 (
int) (box[1]/sampling[1] + 0.001), (
int) (box[2]/sampling[2] + 0.001));
1582 for ( i=0; i<3; i++ ) sampling[i] = box[i]/size[i] + 0.001;
1583 long boxsize = (long) size.
volume();
1585 Bbond* bondlist = NULL;
1586 Batom *atom, *atom2;
1587 Latom *latom, *latom2;
1590 cout <<
"DEBUG molgroup_bond_list_generate: box=" << box << endl;
1591 cout <<
"DEBUG molgroup_bond_list_generate: size=" << size << endl;
1592 cout <<
"DEBUG molgroup_bond_list_generate: sampling=" << sampling << endl;
1597 for ( i=z=0; z<size[2]; z++ ) {
1598 for ( y=0; y<size[1]; y++ ) {
1599 for ( x=0; x<size[0]; x++,i++ ) {
1600 for ( latom = alist[i]; latom; latom = latom->
next ) {
1602 ze = ( size[2] < 2 )? z: z+1;
1603 for ( zz=z; zz<=ze; zz++ ) {
1605 if ( iz < 0 ) iz += (long) size[2];
1606 if ( iz >= size[2]) iz -= (long) size[2];
1607 ys = ( z == zz )? y: y-1;
1608 ye = ( size[1] < 2 )? y: y+1;
1610 for ( yy=ys; yy<=ye; yy++ ) {
1612 if ( iy < 0 ) iy += (long) size[1];
1613 if ( iy >= size[1] ) iy -= (long) size[1];
1614 xs = ( z==zz && y==yy )? x: x-1;
1615 xe = ( size[0] < 2 )? x: x+1;
1617 for ( xx=xs; xx<=xe; xx++ ) {
1619 if ( ix < 0 ) ix += (long) size[0];
1620 if ( ix >= size[0] ) ix -= (long) size[0];
1621 ii = (iz*(long)size[1] + iy)*(long)size[0] + ix;
1622 if ( i == ii ) latom2 = latom->
next;
1623 else latom2 = alist[ii];
1624 for ( ; latom2; latom2 = latom2->
next ) {
1626 atom2 = latom2->
atom;
1632 if ( strncmp(atom->
el,
"H\0", 2) && strncmp(atom2->
el,
"H\0", 2) )
1633 reflength = maxlength;
1636 if ( dist > 0.1*reflength && dist <= reflength ) {
1638 bond =
bond_add(&bond, atom, atom2, dist, 1);
1639 if ( !bondlist ) bondlist = bond;
1642 cout <<
"Bond " << nbond <<
":\t"
1643 << atom->
num <<
" - " << atom2->
num <<
" = "
1656 for ( i=0; i<boxsize; i++ )
kill_list((
char *) alist[i],
sizeof(
Latom));
1660 cout <<
"Number of atoms: " << natom << endl;
1661 cout <<
"Number of bonds generated: " << nbond << endl << endl;
1664 molgroup->
bond = bondlist;
1682 if ( molgroup->
bond ) {
1683 if (
verbose ) cerr <<
"Warning: Bond list already defined!" << endl;
1684 return molgroup->
bond;
1687 long natom(0), nbond(0);
1690 Bbond* bondlist = NULL;
1694 Batom* atom, *atom2;
1697 cout <<
"Generating bonds:" << endl;
1698 cout <<
"Bond length cutoff: " << bondlength <<
" A" << endl;
1701 for ( natom=0, mol = molgroup->
mol; mol; mol = mol->
next ) {
1702 for( res = mol->
res; res; res = res->
next ) {
1703 for ( atom = res->
atom; atom; atom = atom->
next ) {
1705 for( res2 = res; res2; res2 = res2->
next ) {
1706 for ( atom2 = res2->
atom; atom2; atom2 = atom2->
next ) {
1707 if ( atom < atom2 ) {
1712 if ( dist > 0.1*bondlength && dist < 1.1*bondlength ) {
1713 if ( bond ) bond =
bond_add(&bond, atom, atom2, bondlength, 1);
1714 else bond =
bond_add(&bondlist, atom, atom2, bondlength, 1);
1716 cout <<
"Bond " << nbond <<
": " << dist <<
" "
1717 << atom->
coord[2] <<
" " << atom2->
coord[2] << endl;
1728 cout <<
"Number of bonds generated: " << nbond << endl << endl;
1730 molgroup->
bond = bondlist;
1749 for ( mol = molgroup->
mol->
next; mol; mol = mol->
next ) {
1758 for ( mg = molgroup; mg; mg = mg->
next )
if ( mg->
mol ) mg->
mol->
next = NULL;
long residue_count(Bmolgroup *molgroup)
Counts the number of residues in a molecule group.
Bangle * angle_add(Bangle **angle, Batom *atom1, Batom *atom2, Batom *atom3, double a, double k)
Adds an angle to a linked list.
Vector3< T1 > vector3_difference_PBC(Vector3< T1 > &v1, Vector3< T1 > &v2, Vector3< T2 > &box)
long mol_count_atoms(Bmolecule *mol)
Counts the total number of atoms in a molecule.
long kill_list(char *list, unsigned long size)
Frees all the items in a linked list.
int write_mol_text(Bstring &filename, Bmolgroup *molgroup)
Writes a molecule group to a text file.
Bmolgroup * molgroup_list_copy(Bmolgroup *molgroup)
Copies a molecule group list.
char * add_item(char **list, unsigned long size)
Adds an item to a linked list.
int molgroup_atom_renumber(Bmolgroup *molgroup, int first)
Renumbers all atoms, disregarding molecule distinction.
int molecule_kill(Bmolecule *mol)
Destroys a molecule.
Bmolgroup * read_molecule(const char *filename, const char *atom_select, const char *paramfile)
The generalized function for reading molecular files.
int molgroup_kill(Bmolgroup *molgroup)
Destroys a molecule group.
int readFASTA(Bstring &filename, Bmolgroup *molgroup)
Reads FASTA format sequence files.
int writeEMBL(Bstring &filename, Bmolgroup *molgroup)
Writes EMBL format sequence files.
int molgroup_list_write(Bstring &filename, Bmolgroup *molgroup)
Writes a molecule group list.
int error_show(string message, string file, int line)
Displays the error with file and line reference.
Read and write molecules in plain text.
Bresidue * residue_add(Bresidue **res, const char *type)
Adds a residue to a linked list.
int writeFASTA(Bstring &filename, Bmolgroup *molgroup)
Writes FASTA format sequence files.
Batomtype * get_atom_properties(Bstring &filename)
Reading atomic properties from parameter files.
Header file for reading and writing PDB coordinate files.
double length(vector< T > v)
long count_list(char *list)
Counts the number of items in a linked list.
long molgroup_stats(Bmolgroup *molgroup, int show)
Calculates the statistics of a molecule group.
Bmolecule * molecule_add(Bmolecule **mol, char *name)
Adds a molecule to a linked list.
int molgroup_list_kill(Bmolgroup *molgroup)
Destroys a molecule group linked list.
char getcode1(char *acode)
Converts a three-letter amino acid designation to the one-letter equivalent.
Bbond * bond_add(Bbond **bond, Batom *atom1, Batom *atom2, double l, double k)
Adds a bond to a linked list.
Header file for reading and writing PIR sequence files.
int writePIR(Bstring &filename, Bmolgroup *molgroup)
Writes PIR format sequence files.
long molgroup_count_atoms(Bmolgroup *molgroup)
Counts the total number of atoms in a molecule group.
int readPDB(Bstring &filename, Bmolgroup *molgroup)
Reads a PDB format coordinate file.
Bmolgroup * molgroup_copy(Bmolgroup *molgroup)
Copies a molecule group.
Bbond * mol_bond_list_generate(Bmolgroup *molgroup, double bondlength, int wrap)
Generates an intramolecular distance-based bond list.
double distance(const Vector3 &v)
long molgroup_count_residues(Bmolgroup *molgroup)
Counts the total number of residues in a molecule group.
int readWAH(Bstring &filename, Bmolgroup *molgroup)
Reads a Wayne Hendrickson coordinate file.
int writeClustal(Bstring &filename, Bmolgroup *molgroup)
Writes Clustal format sequence files.
int molecule_update_comment(Bmolgroup *molgroup, int n, char **strings)
Puts a set of strings and time in the main comment of a molecule group.
long mol_count_residues(Bmolecule *mol)
Counts the total number of residues in a molecule.
Header file for reading reflection files.
Header file for reading and writing Clustal sequence files.
int bond_exists(Bbond *bondlist, Batom *atom1, Batom *atom2)
Header file for reading and writing Wayne Hendrickson coordinate files.
int readGenBank(Bstring &filename, Bmolgroup *molgroup)
Reads GenBank format sequence files.
Header file for reading atom property files.
int atom_clean_type(Batom *atom, const char *type)
Cleans up the type string and assigns an element code to an atom.
Batom * atom_add(Batom **atom, const char *type)
Adds an atom to a linked list.
int bond_kill(Bbond *bond)
Dealocates a list of bonds.
int writePDB(Bstring &filename, Bmolgroup *molgroup)
Writes a PDB format coordinate file.
Latom ** molgroup_atom_mesh_lists(Bmolgroup *molgroup, Vector3< int > size, Vector3< double > sampling)
Generates lists of atoms based on a grid.
long read_mol_star(Bstring &filename, Bmolgroup *molgroup)
Reads a molecule group from a STAR format file.
Header file for reading and writing FASTA sequence files.
Bmolgroup * molgroup_init()
Initializes and allocates a new molecule group.
Header file for reading and writing GROMACS coordinate files.
int molecule_get_masses(Bmolgroup *molgroup, Bstring ¶mfile)
Gets atomic masses from a parameter file.
long molgroup_count_molecules(Bmolgroup *molgroup)
Counts the total number of molecules in a molecule group.
int writeGROMACS(Bstring &filename, Bmolgroup *molgroup)
Writes a Gromacs coordinate file.
Header file for general utilities.
int writeWAH(Bstring &filename, Bmolgroup *molgroup)
Writes a Wayne Hendrickson coordinate file.
Bmolecule * mol_copy_and_add_to_molgroup(Bmolgroup *molgroup, Bmolecule *mol)
Copies a molecule and assign to a new pointer in the molgroup.
int atom_type_kill(Batomtype *atype)
Destroys an atom type.
long write_mol_star(Bstring &filename, Bmolgroup *molgroup)
Writes a molecule group to a STAR format file.
int molgroup_consolidate_gaps(Bmolgroup *molgroup)
Removes redundant gaps from an alignment.
Header file for reading and writing GenBank sequence files.
Header file for sequence utilities.
Header file for reading and writing Phylip sequence files.
int readPIR(Bstring &filename, Bmolgroup *molgroup)
Reads PIR format sequence files.
int writeGenBank(Bstring &filename, Bmolgroup *molgroup)
Writes GenBank format sequence files.
double angle(Vector3< T2 > &v)
Read and write molecules in STAR format.
Bbond * molgroup_bond_list_generate(Bmolgroup *molgroup, double maxlength, int wrap)
Generates a bond list based on atom separation.
Header file for generalized linked list functions.
int writePhylip(Bstring &filename, Bmolgroup *molgroup)
Writes Phylip format sequence files.
int angle_kill(Bangle *angle)
Dealocates a list of angles.
int readPhylip(Bstring &filename, Bmolgroup *molgroup)
Reads Phylip format sequence files.
Header file for reading and writing EMBL sequence files.
long mol_stats(Bmolecule *mol, int show)
Calculates the statistics of a molecule.
int molgroup_sequence_check(Bmolgroup *molgroup)
int molecules_to_molgroups(Bmolgroup *molgroup)
Converts molecules in a molecule group to individual molecule groups.
int readEMBL(Bstring &filename, Bmolgroup *molgroup)
Reads EMBL format sequence files.
int molgroup_from_molgroup_list(Bmolgroup *molgroup)
Converts a molecule group list to a single molecule group.
bool contains(const Bstring &s)
Bbond * molgroup_bond_list_copy(Bmolgroup *molgroup, Bmolgroup *molgroupcopy)
Copies a bond list.
long atom_count(Bmolgroup *molgroup)
Counts the number of atoms in a molecule group.
Bmolecule * molecule_copy(Bmolecule *mol)
Copies a molecule.
int write_molecule(char *filename, Bmolgroup *molgroup)
Writes a molecule group.
int read_mol_text(Bstring &filename, Bmolgroup *molgroup)
Reads a molecule group from a text file.
int readGROMACS(Bstring &filename, Bmolgroup *molgroup)
Reads a Gromacs coordinate file.
int residue_kill(Bresidue *res)
Destroys a residue.
int readClustal(Bstring &filename, Bmolgroup *molgroup)
Reads Clustal format sequence files.
Library routines used for atomic coordinates.