mirror of
https://github.com/Discngine/fpocket.git
synced 2026-06-04 20:04:22 +08:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a0bbee64f8 | ||
|
|
d82104b99a |
24
Dockerfile
24
Dockerfile
@@ -1,24 +0,0 @@
|
||||
FROM centos:7
|
||||
|
||||
#RUN yum -y install epel-release && yum -y update && yum -y install gcc gcc-c++ make netcdf-devel; yum clean all
|
||||
RUN yum -y install gcc gcc-c++ make netcdf-devel; yum clean all
|
||||
|
||||
# all of this mess is essentially to have a minimalistic build at the end
|
||||
COPY makefile /opt/fpocket/
|
||||
COPY src /opt/fpocket/src
|
||||
COPY man /opt/fpocket/man
|
||||
COPY headers /opt/fpocket/headers
|
||||
COPY obj /opt/fpocket/obj
|
||||
COPY scripts /opt/fpocket/scripts
|
||||
COPY bin /opt/fpocket/bin
|
||||
COPY plugins/LINUXAMD64 /opt/fpocket/plugins/LINUXAMD64
|
||||
COPY plugins/include /opt/fpocket/plugins/include
|
||||
COPY plugins/noarch /opt/fpocket/plugins/noarch
|
||||
|
||||
WORKDIR /opt/fpocket
|
||||
|
||||
RUN make; make install; make clean
|
||||
|
||||
WORKDIR /WORKDIR
|
||||
|
||||
CMD ["fpocket"]
|
||||
@@ -115,10 +115,10 @@ s_pdb *open_mmcif(char *fpath, const char *ligan, const int keep_lig, int model_
|
||||
if (par->xlig_resnumber > -1)
|
||||
{
|
||||
|
||||
if ((at_in[i].chain[0] == par->xlig_chain_code[0] && at_in[i].resid == par->xlig_resnumber && par->xlig_resname[0] == at_in[i].resname[0] && par->xlig_resname[1] == at_in[i].resname[1] && par->xlig_resname[2] == at_in[i].resname[2]) || (at_in[i].chain_auth[0] == par->xlig_chain_code[0] && at_in[i].resid_auth == par->xlig_resnumber && par->xlig_resname[0] == at_in[i].resname[0] && par->xlig_resname[1] == at_in[i].resname[1] && par->xlig_resname[2] == at_in[i].resname[2]))
|
||||
{
|
||||
pdb->n_xlig_atoms++;
|
||||
}
|
||||
// if ((at_in[i].chain[0] == par->xlig_chain_code[0] && at_in[i].resid == par->xlig_resnumber && par->xlig_resname[0] == at_in[i].resname[0] && par->xlig_resname[1] == at_in[i].resname[1] && par->xlig_resname[2] == at_in[i].resname[2]) || (at_in[i].chain_auth[0] == par->xlig_chain_code[0] && at_in[i].resid_auth == par->xlig_resnumber && par->xlig_resname[0] == at_in[i].resname[0] && par->xlig_resname[1] == at_in[i].resname[1] && par->xlig_resname[2] == at_in[i].resname[2]))
|
||||
// {
|
||||
// pdb->n_xlig_atoms++;
|
||||
// }
|
||||
|
||||
if (is_ligand(par->chain_as_ligand, at_in[i].chain[0]))
|
||||
{
|
||||
@@ -126,6 +126,14 @@ s_pdb *open_mmcif(char *fpath, const char *ligan, const int keep_lig, int model_
|
||||
}
|
||||
}
|
||||
}
|
||||
if (par->xlig_resnumber > -1)
|
||||
{
|
||||
|
||||
if ((at_in[i].chain[0] == par->xlig_chain_code[0] && at_in[i].resid == par->xlig_resnumber && par->xlig_resname[0] == at_in[i].resname[0] && par->xlig_resname[1] == at_in[i].resname[1] && par->xlig_resname[2] == at_in[i].resname[2]) || (at_in[i].chain_auth[0] == par->xlig_chain_code[0] && at_in[i].resid_auth == par->xlig_resnumber && par->xlig_resname[0] == at_in[i].resname[0] && par->xlig_resname[1] == at_in[i].resname[1] && par->xlig_resname[2] == at_in[i].resname[2]))
|
||||
{
|
||||
pdb->n_xlig_atoms++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (at_in[i].modelnumber == model_number && !strncmp(at_in[i].atom_type, "HETATM", 6) || (!strncmp(at_in[i].atom_type, "ATOM", 4) && is_ligand(par->chain_as_ligand, at_in[i].chain[0])))
|
||||
{
|
||||
@@ -169,18 +177,19 @@ s_pdb *open_mmcif(char *fpath, const char *ligan, const int keep_lig, int model_
|
||||
}
|
||||
}
|
||||
}
|
||||
if (par->xlig_resnumber > -1)
|
||||
{
|
||||
if ((at_in[i].chain[0] == par->xlig_chain_code[0] && at_in[i].resid == par->xlig_resnumber && par->xlig_resname[0] == at_in[i].resname[0] && par->xlig_resname[1] == at_in[i].resname[1] && par->xlig_resname[2] == at_in[i].resname[2]) || (at_in[i].chain_auth[0] == par->xlig_chain_code[0] && at_in[i].resid_auth == par->xlig_resnumber && par->xlig_resname[0] == at_in[i].resname[0] && par->xlig_resname[1] == at_in[i].resname[1] && par->xlig_resname[2] == at_in[i].resname[2]))
|
||||
{
|
||||
pdb->n_xlig_atoms++;
|
||||
}
|
||||
}
|
||||
|
||||
if (is_ligand(par->chain_as_ligand, at_in[i].chain[0]))
|
||||
{
|
||||
pdb->n_xlig_atoms++;
|
||||
}
|
||||
}
|
||||
if (par->xlig_resnumber > -1)
|
||||
{
|
||||
if ((at_in[i].chain[0] == par->xlig_chain_code[0] && at_in[i].resid == par->xlig_resnumber && par->xlig_resname[0] == at_in[i].resname[0] && par->xlig_resname[1] == at_in[i].resname[1] && par->xlig_resname[2] == at_in[i].resname[2]) || (at_in[i].chain_auth[0] == par->xlig_chain_code[0] && at_in[i].resid_auth == par->xlig_resnumber && par->xlig_resname[0] == at_in[i].resname[0] && par->xlig_resname[1] == at_in[i].resname[1] && par->xlig_resname[2] == at_in[i].resname[2]))
|
||||
{
|
||||
pdb->n_xlig_atoms++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -285,17 +294,6 @@ void read_mmcif(s_pdb *pdb, const char *ligan, const int keep_lig, int model_num
|
||||
if (at_in[i].altloc[0] == ' ' || at_in[i].altloc[0] == 'A' || at_in[i].altloc[0] == '1')
|
||||
{ /*if within first occurence*/
|
||||
/* Enter this if when arg in command line is -r */
|
||||
if (pdb->n_xlig_atoms)
|
||||
{
|
||||
if (at_in[i].chain[0] == params->xlig_chain_code[0] && at_in[i].resid == params->xlig_resnumber && params->xlig_resname[0] == at_in[i].resname[0] && params->xlig_resname[1] == at_in[i].resname[1] && params->xlig_resname[2] == at_in[i].resname[2])
|
||||
{
|
||||
|
||||
*(pdb->xlig_x + i_explicit_ligand_atom) = ts_in.coords[3 * i];
|
||||
*(pdb->xlig_y + i_explicit_ligand_atom) = ts_in.coords[(3 * i) + 1];
|
||||
*(pdb->xlig_z + i_explicit_ligand_atom) = ts_in.coords[(3 * i) + 2];
|
||||
i_explicit_ligand_atom++;
|
||||
}
|
||||
}
|
||||
|
||||
/* Enter this if when arg in command line is -a */
|
||||
if (is_ligand(params->chain_as_ligand, at_in[i].chain[0]))
|
||||
@@ -434,25 +432,24 @@ void read_mmcif(s_pdb *pdb, const char *ligan, const int keep_lig, int model_num
|
||||
}
|
||||
}
|
||||
}
|
||||
if (pdb->n_xlig_atoms)
|
||||
{
|
||||
if (at_in[i].chain[0] == params->xlig_chain_code[0] && at_in[i].resid == params->xlig_resnumber && params->xlig_resname[0] == at_in[i].resname[0] && params->xlig_resname[1] == at_in[i].resname[1] && params->xlig_resname[2] == at_in[i].resname[2])
|
||||
{
|
||||
|
||||
*(pdb->xlig_x + i_explicit_ligand_atom) = ts_in.coords[3 * i];
|
||||
*(pdb->xlig_y + i_explicit_ligand_atom) = ts_in.coords[(3 * i) + 1];
|
||||
*(pdb->xlig_z + i_explicit_ligand_atom) = ts_in.coords[(3 * i) + 2];
|
||||
i_explicit_ligand_atom++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (at_in[i].modelnumber == model_number && !strncmp(at_in[i].atom_type, "HETATM", 6) || (!strncmp(at_in[i].atom_type, "ATOM", 4) && is_ligand(params->chain_as_ligand, at_in[i].chain[0])))
|
||||
{
|
||||
|
||||
if (at_in[i].altloc[0] == ' ' || at_in[i].altloc[0] == 'A' || at_in[i].altloc[0] == '1')
|
||||
{ /*first occurence*/
|
||||
if (pdb->n_xlig_atoms)
|
||||
{
|
||||
if ((at_in[i].chain[0] == params->xlig_chain_code[0] && at_in[i].resid == params->xlig_resnumber && params->xlig_resname[0] == at_in[i].resname[0] && params->xlig_resname[1] == at_in[i].resname[1] && params->xlig_resname[2] == at_in[i].resname[2]) || (at_in[i].chain_auth[0] == params->xlig_chain_code[0] && at_in[i].resid_auth == params->xlig_resnumber && params->xlig_resname[0] == at_in[i].resname[0] && params->xlig_resname[1] == at_in[i].resname[1] && params->xlig_resname[2] == at_in[i].resname[2]))
|
||||
{
|
||||
// if (params->xlig_resname[0] == resb[0] && params->xlig_resname[1] == resb[1] && params->xlig_resname[2] == resb[2]) {
|
||||
|
||||
*(pdb->xlig_x + i_explicit_ligand_atom) = ts_in.coords[3 * i];
|
||||
*(pdb->xlig_y + i_explicit_ligand_atom) = ts_in.coords[(3 * i) + 1];
|
||||
*(pdb->xlig_z + i_explicit_ligand_atom) = ts_in.coords[(3 * i) + 2];
|
||||
|
||||
i_explicit_ligand_atom++;
|
||||
}
|
||||
}
|
||||
if (is_ligand(params->chain_as_ligand, at_in[i].chain[0]))
|
||||
{
|
||||
*(pdb->xlig_x + i_explicit_ligand_atom) = ts_in.coords[3 * i];
|
||||
@@ -617,6 +614,19 @@ void read_mmcif(s_pdb *pdb, const char *ligan, const int keep_lig, int model_num
|
||||
}
|
||||
}
|
||||
}
|
||||
if (pdb->n_xlig_atoms)
|
||||
{
|
||||
if ((at_in[i].chain[0] == params->xlig_chain_code[0] && at_in[i].resid == params->xlig_resnumber && params->xlig_resname[0] == at_in[i].resname[0] && params->xlig_resname[1] == at_in[i].resname[1] && params->xlig_resname[2] == at_in[i].resname[2]) || (at_in[i].chain_auth[0] == params->xlig_chain_code[0] && at_in[i].resid_auth == params->xlig_resnumber && params->xlig_resname[0] == at_in[i].resname[0] && params->xlig_resname[1] == at_in[i].resname[1] && params->xlig_resname[2] == at_in[i].resname[2]))
|
||||
{
|
||||
// if (params->xlig_resname[0] == resb[0] && params->xlig_resname[1] == resb[1] && params->xlig_resname[2] == resb[2]) {
|
||||
|
||||
*(pdb->xlig_x + i_explicit_ligand_atom) = ts_in.coords[3 * i];
|
||||
*(pdb->xlig_y + i_explicit_ligand_atom) = ts_in.coords[(3 * i) + 1];
|
||||
*(pdb->xlig_z + i_explicit_ligand_atom) = ts_in.coords[(3 * i) + 2];
|
||||
|
||||
i_explicit_ligand_atom++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (strncmp(at_in[i].atom_type, "CRYST1", 6) == 0)
|
||||
{
|
||||
|
||||
118
src/rpdb.c
118
src/rpdb.c
@@ -901,11 +901,11 @@ s_pdb *rpdb_open(char *fpath, const char *ligan, const int keep_lig, int model_n
|
||||
// if (resb[0] == par->xlig_resname[0] && resb[1] == par->xlig_resname[1] && resb[2] == par->xlig_resname[2]) {
|
||||
// fprintf(stdout,"%s\t%s\n",buf[16],par->xlig_chain_code);
|
||||
|
||||
if (buf[21] == par->xlig_chain_code[0] && resnbuf == par->xlig_resnumber && par->xlig_resname[0] == resb[0] && par->xlig_resname[1] == resb[1] && par->xlig_resname[2] == resb[2])
|
||||
{
|
||||
pdb->n_xlig_atoms++;
|
||||
fprintf(stdout, "%d\n", pdb->n_xlig_atoms);
|
||||
}
|
||||
// if (buf[21] == par->xlig_chain_code[0] && resnbuf == par->xlig_resnumber && par->xlig_resname[0] == resb[0] && par->xlig_resname[1] == resb[1] && par->xlig_resname[2] == resb[2])
|
||||
// {
|
||||
// pdb->n_xlig_atoms++;
|
||||
// fprintf(stdout, "%d\n", pdb->n_xlig_atoms);
|
||||
// }
|
||||
|
||||
if (is_ligand(par->chain_as_ligand, buf[21]))
|
||||
{
|
||||
@@ -914,7 +914,18 @@ s_pdb *rpdb_open(char *fpath, const char *ligan, const int keep_lig, int model_n
|
||||
}
|
||||
}
|
||||
}
|
||||
if (x < 9990 && y < 9990 && z < 9990)
|
||||
{
|
||||
if (par->xlig_resnumber > -1)
|
||||
{
|
||||
if (buf[21] == par->xlig_chain_code[0] && resnbuf == par->xlig_resnumber && par->xlig_resname[0] == resb[0] && par->xlig_resname[1] == resb[1] && par->xlig_resname[2] == resb[2])
|
||||
{
|
||||
pdb->n_xlig_atoms++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else if (!strncmp(buf, "HETATM", 6) || (!strncmp(buf, "ATOM ", 5) && is_ligand(par->chain_as_ligand, buf[21])))
|
||||
{
|
||||
if (chains_to_delete(par->chain_delete, buf[21], par->chain_is_kept))
|
||||
@@ -969,25 +980,39 @@ s_pdb *rpdb_open(char *fpath, const char *ligan, const int keep_lig, int model_n
|
||||
|
||||
/*handle explicit ligand input here*/
|
||||
|
||||
if (par->xlig_resnumber > -1)
|
||||
{
|
||||
if (buf[21] == par->xlig_chain_code[0] && resnbuf == par->xlig_resnumber && par->xlig_resname[0] == resb[0] && par->xlig_resname[1] == resb[1] && par->xlig_resname[2] == resb[2])
|
||||
{
|
||||
pdb->n_xlig_atoms++;
|
||||
}
|
||||
}
|
||||
// if (par->xlig_resnumber > -1)
|
||||
// {
|
||||
// if (buf[21] == par->xlig_chain_code[0] && resnbuf == par->xlig_resnumber && par->xlig_resname[0] == resb[0] && par->xlig_resname[1] == resb[1] && par->xlig_resname[2] == resb[2])
|
||||
// {
|
||||
// pdb->n_xlig_atoms++;
|
||||
// }
|
||||
// }
|
||||
if (is_ligand(par->chain_as_ligand, buf[21]))
|
||||
{
|
||||
pdb->n_xlig_atoms++;
|
||||
// fprintf(stdout, "H%d\t", pdb->n_xlig_atoms);
|
||||
}
|
||||
}
|
||||
if (x < 9990 && y < 9990 && z < 9990)
|
||||
{
|
||||
rpdb_extract_atm_resname(buf, resb);
|
||||
resnbuf = rpdb_extract_atm_resumber(buf);
|
||||
|
||||
if (par->xlig_resnumber > -1)
|
||||
{
|
||||
if (buf[21] == par->xlig_chain_code[0] && resnbuf == par->xlig_resnumber && par->xlig_resname[0] == resb[0] && par->xlig_resname[1] == resb[1] && par->xlig_resname[2] == resb[2])
|
||||
{
|
||||
|
||||
pdb->n_xlig_atoms++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
else if (!strncmp(buf, "HEADER", 6))
|
||||
strncpy(pdb->header, buf, M_PDB_BUF_LEN) ;
|
||||
*/
|
||||
*/
|
||||
|
||||
else if (model_read == 1 && !strncmp(buf, "ENDMDL", 6))
|
||||
model_read = 0;
|
||||
@@ -1023,7 +1048,6 @@ s_pdb *rpdb_open(char *fpath, const char *ligan, const int keep_lig, int model_n
|
||||
pdb->latm_lig = (s_atm **)my_calloc(natm_lig, sizeof(s_atm *));
|
||||
else
|
||||
pdb->latm_lig = NULL;
|
||||
|
||||
pdb->natoms = natoms;
|
||||
pdb->nhetatm = nhetatm;
|
||||
pdb->natm_lig = natm_lig;
|
||||
@@ -1128,15 +1152,15 @@ void rpdb_read(s_pdb *pdb, const char *ligan, const int keep_lig, int model_numb
|
||||
resnbuf = rpdb_extract_atm_resumber(pdb_line);
|
||||
}
|
||||
/* Enter this if when arg in command line is -r */
|
||||
if (pdb->n_xlig_atoms)
|
||||
{
|
||||
if (pdb_line[21] == params->xlig_chain_code[0] && resnbuf == params->xlig_resnumber && params->xlig_resname[0] == resb[0] && params->xlig_resname[1] == resb[1] && params->xlig_resname[2] == resb[2])
|
||||
{
|
||||
// if (pdb->n_xlig_atoms)
|
||||
// {
|
||||
// if (pdb_line[21] == params->xlig_chain_code[0] && resnbuf == params->xlig_resnumber && params->xlig_resname[0] == resb[0] && params->xlig_resname[1] == resb[1] && params->xlig_resname[2] == resb[2])
|
||||
// {
|
||||
|
||||
rpdb_extract_atom_coordinates(pdb_line, (pdb->xlig_x + i_explicit_ligand_atom), (pdb->xlig_y + i_explicit_ligand_atom), (pdb->xlig_z + i_explicit_ligand_atom));
|
||||
i_explicit_ligand_atom++;
|
||||
}
|
||||
}
|
||||
// rpdb_extract_atom_coordinates(pdb_line, (pdb->xlig_x + i_explicit_ligand_atom), (pdb->xlig_y + i_explicit_ligand_atom), (pdb->xlig_z + i_explicit_ligand_atom));
|
||||
// i_explicit_ligand_atom++;
|
||||
// }
|
||||
// }
|
||||
|
||||
/* Enter this if when arg in command line is -a */
|
||||
if (is_ligand(params->chain_as_ligand, pdb_line[21]))
|
||||
@@ -1228,6 +1252,21 @@ void rpdb_read(s_pdb *pdb, const char *ligan, const int keep_lig, int model_numb
|
||||
}
|
||||
}
|
||||
}
|
||||
if (tmpx < 9990 && tmpy < 9990 && tmpz < 9990)
|
||||
{
|
||||
if (pdb->n_xlig_atoms)
|
||||
{
|
||||
rpdb_extract_atm_resname(pdb_line, resb);
|
||||
resnbuf = rpdb_extract_atm_resumber(pdb_line);
|
||||
|
||||
if (pdb_line[21] == params->xlig_chain_code[0] && resnbuf == params->xlig_resnumber && params->xlig_resname[0] == resb[0] && params->xlig_resname[1] == resb[1] && params->xlig_resname[2] == resb[2])
|
||||
{
|
||||
|
||||
rpdb_extract_atom_coordinates(pdb_line, (pdb->xlig_x + i_explicit_ligand_atom), (pdb->xlig_y + i_explicit_ligand_atom), (pdb->xlig_z + i_explicit_ligand_atom));
|
||||
i_explicit_ligand_atom++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (strncmp(pdb_line, "HETATM", 6) == 0 || (strncmp(pdb_line, "ATOM ", 5) == 0 && is_ligand(params->chain_as_ligand, pdb_line[21])))
|
||||
{
|
||||
@@ -1244,17 +1283,17 @@ void rpdb_read(s_pdb *pdb, const char *ligan, const int keep_lig, int model_numb
|
||||
resnbuf = rpdb_extract_atm_resumber(pdb_line);
|
||||
}
|
||||
|
||||
if (pdb->n_xlig_atoms)
|
||||
{
|
||||
if (pdb_line[21] == params->xlig_chain_code[0] && resnbuf == params->xlig_resnumber && params->xlig_resname[0] == resb[0] && params->xlig_resname[1] == resb[1] && params->xlig_resname[2] == resb[2])
|
||||
{
|
||||
// if (params->xlig_resname[0] == resb[0] && params->xlig_resname[1] == resb[1] && params->xlig_resname[2] == resb[2]) {
|
||||
// if (pdb->n_xlig_atoms)
|
||||
// {
|
||||
// if (pdb_line[21] == params->xlig_chain_code[0] && resnbuf == params->xlig_resnumber && params->xlig_resname[0] == resb[0] && params->xlig_resname[1] == resb[1] && params->xlig_resname[2] == resb[2])
|
||||
// {
|
||||
// // if (params->xlig_resname[0] == resb[0] && params->xlig_resname[1] == resb[1] && params->xlig_resname[2] == resb[2]) {
|
||||
|
||||
rpdb_extract_atom_coordinates(pdb_line, (pdb->xlig_x + i_explicit_ligand_atom), (pdb->xlig_y + i_explicit_ligand_atom), (pdb->xlig_z + i_explicit_ligand_atom));
|
||||
// rpdb_extract_atom_coordinates(pdb_line, (pdb->xlig_x + i_explicit_ligand_atom), (pdb->xlig_y + i_explicit_ligand_atom), (pdb->xlig_z + i_explicit_ligand_atom));
|
||||
|
||||
i_explicit_ligand_atom++;
|
||||
}
|
||||
}
|
||||
// i_explicit_ligand_atom++;
|
||||
// }
|
||||
// }
|
||||
if (is_ligand(params->chain_as_ligand, pdb_line[21]))
|
||||
{
|
||||
|
||||
@@ -1375,6 +1414,23 @@ void rpdb_read(s_pdb *pdb, const char *ligan, const int keep_lig, int model_numb
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (tmpx < 9990 && tmpy < 9990 && tmpz < 9990)
|
||||
{
|
||||
|
||||
if (pdb->n_xlig_atoms)
|
||||
{
|
||||
resnbuf = rpdb_extract_atm_resumber(pdb_line);
|
||||
rpdb_extract_atm_resname(pdb_line, resb);
|
||||
if (pdb_line[21] == params->xlig_chain_code[0] && resnbuf == params->xlig_resnumber && params->xlig_resname[0] == resb[0] && params->xlig_resname[1] == resb[1] && params->xlig_resname[2] == resb[2])
|
||||
{
|
||||
|
||||
rpdb_extract_atom_coordinates(pdb_line, (pdb->xlig_x + i_explicit_ligand_atom), (pdb->xlig_y + i_explicit_ligand_atom), (pdb->xlig_z + i_explicit_ligand_atom));
|
||||
|
||||
i_explicit_ligand_atom++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (strncmp(pdb_line, "CRYST1", 6) == 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user