-
Notifications
You must be signed in to change notification settings - Fork 0
/
mdgp.m
36 lines (29 loc) · 895 Bytes
/
mdgp.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
%% set parameters
protein = '1gpv'; % PDB ID
modelID = 1; % model identification
fprintf('Creating an artifical DMDGP instance\n');
%% download pdb data
fprintf('Downloading protein data from PDB ....');
% contatenate file name and pdb http address
file = sprintf('http://www.rcsb.org/pdb/files/%s.pdb', protein);
% try to download data
try
pdb = pdbread(file);
catch
error('\nThe data for protein %s could not be found.\n', protein);
end
fprintf(' done!\n');
%% instance creation
fprintf('Instance creation\n');
% select the model
Atom = pdb.Model(modelID).Atom;
chainID = [Atom.chainID];
element = [Atom.element];
resSeq = [Atom.resSeq];
resSeqID = unique(resSeq);
for i = 1:length(resSeqID)
index = resSeq == resSeqID(i);
fprintf('ResSeq(%d)\n', resSeqID(i))
fprintf(' ChainID '); disp(chainID(index));
fprintf(' Element '); disp(element(index));
end