Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
INTBuilder
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chloe Dequeker
INTBuilder
Commits
f0001e8b
Commit
f0001e8b
authored
Feb 07, 2017
by
Chloe Dequeker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Output PDB file now has the trailer string present in the original file
parent
6645f615
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
5 deletions
+15
-5
fileIO.c
src/fileIO.c
+12
-3
struct.h
src/struct.h
+3
-2
No files found.
src/fileIO.c
View file @
f0001e8b
...
@@ -170,7 +170,7 @@ struct pdb_values* readPDB(char* protein) {
...
@@ -170,7 +170,7 @@ struct pdb_values* readPDB(char* protein) {
* The structure filled is of type struct pdb_values. It is
* The structure filled is of type struct pdb_values. It is
* allocated and a pointer to this structure is returned at the end
* allocated and a pointer to this structure is returned at the end
*/
*/
int
i
=
0
,
j
=
0
;
int
i
=
0
,
j
=
0
,
strSize
=
0
;
int
rc
=
0
,
nbRes
=
0
,
numCA
=
0
;
int
rc
=
0
,
nbRes
=
0
,
numCA
=
0
;
int
curRes
=
0
,
curAtom
=
0
,
firstLine
=
1
;
int
curRes
=
0
,
curAtom
=
0
,
firstLine
=
1
;
size_t
len
=
2000
;
size_t
len
=
2000
;
...
@@ -289,6 +289,13 @@ struct pdb_values* readPDB(char* protein) {
...
@@ -289,6 +289,13 @@ struct pdb_values* readPDB(char* protein) {
buf2
[
8
]
=
'\0'
;
buf2
[
8
]
=
'\0'
;
pdb_prot
->
residues
[
curRes
].
z
[
curAtom
]
=
atof
(
buf2
);
pdb_prot
->
residues
[
curRes
].
z
[
curAtom
]
=
atof
(
buf2
);
/* Copy the trailer string coming after the coordinates
* This includes Occupancy, temperature and other values
*/
strcpy
(
pdb_prot
->
residues
[
curRes
].
trailerString
[
curAtom
],
buf
+
54
);
strSize
=
strlen
(
pdb_prot
->
residues
[
curRes
].
trailerString
[
curAtom
]);
pdb_prot
->
residues
[
curRes
].
trailerString
[
curAtom
][
strSize
-
1
]
=
'\0'
;
/* If we encounter the first or fifth CA, we note their coordinates
/* If we encounter the first or fifth CA, we note their coordinates
* specifically. We need them for the rotation
* specifically. We need them for the rotation
*/
*/
...
@@ -346,13 +353,15 @@ void writePDB(struct pdb_values* pdb, char* protName, int nConf){
...
@@ -346,13 +353,15 @@ void writePDB(struct pdb_values* pdb, char* protName, int nConf){
for
(
j
=
0
;
j
<
pdb
->
residues
[
i
].
nbAtom
;
j
++
){
for
(
j
=
0
;
j
<
pdb
->
residues
[
i
].
nbAtom
;
j
++
){
fprintf
(
fw
,
FORMAT_LINE_PDB_HET
,
pdb
->
residues
[
i
].
idAtom
[
j
],
fprintf
(
fw
,
FORMAT_LINE_PDB_HET
,
pdb
->
residues
[
i
].
idAtom
[
j
],
pdb
->
residues
[
i
].
atomType
[
j
],
pdb
->
residues
[
i
].
resName
,
pdb
->
residues
[
i
].
chain
,
pdb
->
residues
[
i
].
atomType
[
j
],
pdb
->
residues
[
i
].
resName
,
pdb
->
residues
[
i
].
chain
,
pdb
->
residues
[
i
].
idRes
,
pdb
->
residues
[
i
].
x
[
j
],
pdb
->
residues
[
i
].
y
[
j
],
pdb
->
residues
[
i
].
z
[
j
]);
pdb
->
residues
[
i
].
idRes
,
pdb
->
residues
[
i
].
x
[
j
],
pdb
->
residues
[
i
].
y
[
j
],
pdb
->
residues
[
i
].
z
[
j
],
pdb
->
residues
[
i
].
trailerString
[
j
]);
}
}
}
else
{
}
else
{
for
(
j
=
0
;
j
<
pdb
->
residues
[
i
].
nbAtom
;
j
++
){
for
(
j
=
0
;
j
<
pdb
->
residues
[
i
].
nbAtom
;
j
++
){
fprintf
(
fw
,
FORMAT_LINE_PDB_ATM
,
pdb
->
residues
[
i
].
idAtom
[
j
],
fprintf
(
fw
,
FORMAT_LINE_PDB_ATM
,
pdb
->
residues
[
i
].
idAtom
[
j
],
pdb
->
residues
[
i
].
atomType
[
j
],
pdb
->
residues
[
i
].
resName
,
pdb
->
residues
[
i
].
chain
,
pdb
->
residues
[
i
].
atomType
[
j
],
pdb
->
residues
[
i
].
resName
,
pdb
->
residues
[
i
].
chain
,
pdb
->
residues
[
i
].
idRes
,
pdb
->
residues
[
i
].
x
[
j
],
pdb
->
residues
[
i
].
y
[
j
],
pdb
->
residues
[
i
].
z
[
j
]);
pdb
->
residues
[
i
].
idRes
,
pdb
->
residues
[
i
].
x
[
j
],
pdb
->
residues
[
i
].
y
[
j
],
pdb
->
residues
[
i
].
z
[
j
],
pdb
->
residues
[
i
].
trailerString
[
j
]);
}
}
}
}
}
}
...
...
src/struct.h
View file @
f0001e8b
...
@@ -19,8 +19,8 @@
...
@@ -19,8 +19,8 @@
#define NB_HEADER_LINE_ZDOCK 5
/* Number of header lines at the top of a ZDOCK docking file */
#define NB_HEADER_LINE_ZDOCK 5
/* Number of header lines at the top of a ZDOCK docking file */
/* This is the format of a line in a PDB file */
/* This is the format of a line in a PDB file */
#define FORMAT_LINE_PDB_ATM "ATOM %5d %3s %3s %c%5s %8.3f%8.3f%8.3f\n"
#define FORMAT_LINE_PDB_ATM "ATOM %5d %3s %3s %c%5s %8.3f%8.3f%8.3f
%s
\n"
#define FORMAT_LINE_PDB_HET "HETATM%5d %3s %3s %c%5s %8.3f%8.3f%8.3f\n"
#define FORMAT_LINE_PDB_HET "HETATM%5d %3s %3s %c%5s %8.3f%8.3f%8.3f
%s
\n"
int
verbose
;
/* 1 if we are in verbose mode */
int
verbose
;
/* 1 if we are in verbose mode */
int
constructPDB
;
/* 1 if we should build the PDB */
int
constructPDB
;
/* 1 if we should build the PDB */
...
@@ -93,6 +93,7 @@ struct residue {
...
@@ -93,6 +93,7 @@ struct residue {
float
y
[
NB_MAX_ATOM_PER_RES
];
/* Array containing the y for each of its atom */
float
y
[
NB_MAX_ATOM_PER_RES
];
/* Array containing the y for each of its atom */
float
z
[
NB_MAX_ATOM_PER_RES
];
/* Array containing the z for each of its atom */
float
z
[
NB_MAX_ATOM_PER_RES
];
/* Array containing the z for each of its atom */
char
atomType
[
NB_MAX_ATOM_PER_RES
][
10
];
/* Array containing the type of atom */
char
atomType
[
NB_MAX_ATOM_PER_RES
][
10
];
/* Array containing the type of atom */
char
trailerString
[
NB_MAX_ATOM_PER_RES
][
50
];
/* Array containing the trailer string for the line */
int
idAtom
[
NB_MAX_ATOM_PER_RES
];
/* ID of the atom */
int
idAtom
[
NB_MAX_ATOM_PER_RES
];
/* ID of the atom */
int
isHET
;
int
isHET
;
int
nbAtom
;
/* Number of atom for this residue */
int
nbAtom
;
/* Number of atom for this residue */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment