1 |
package proteinstructure; |
2 |
|
3 |
/** |
4 |
* A particular region of a scop domain within a protein structure |
5 |
*/ |
6 |
public class ScopRegion { |
7 |
|
8 |
/*------------------------------ constants ------------------------------*/ |
9 |
enum DomainType { UNKNOWN, WHOLECHAIN, SINGLEFRAGMENT, MULTIFRAGMENT, MULTICHAIN }; |
10 |
|
11 |
/*--------------------------- member variables --------------------------*/ |
12 |
|
13 |
String sid; // old SCOP identifier e.g. d1dlwa_ |
14 |
String sccs; // SCOP concise classification strings (sccs) e.g. a.1.1.1 |
15 |
int sunid; // SCOP unique identifiers e.g. 14982 |
16 |
int orderIn; // order of the region in the domain as in the original gene sequence (not the same as pdb) |
17 |
int numRegions; // the number of regions of the domain |
18 |
Interval interval; // the location of this region in the sequence |
19 |
String startPdbRes, endPdbRes; // the starting and ending pdb residue serials of this region in the sequence |
20 |
/*----------------------------- constructors ----------------------------*/ |
21 |
|
22 |
public ScopRegion(String sid, String sccs, int sunid, int orderIn, int numRegions, String startPdbRes, String endPdbRes, int startRes, int endRes) { |
23 |
this.sid = sid; |
24 |
this.sccs = sccs; |
25 |
this.sunid = sunid; |
26 |
this.orderIn = orderIn; |
27 |
this.numRegions = numRegions; |
28 |
this.interval = new Interval(startRes, endRes); |
29 |
this.startPdbRes = startPdbRes; |
30 |
this.endPdbRes = endPdbRes; |
31 |
} |
32 |
|
33 |
/*---------------------------- public methods ---------------------------*/ |
34 |
|
35 |
public ScopRegion copy() { |
36 |
return new ScopRegion(sid, sccs, sunid, orderIn, numRegions, startPdbRes, endPdbRes, interval.beg, interval.end); |
37 |
} |
38 |
|
39 |
/** Returns the old scop id of this region */ |
40 |
public String getSId() { |
41 |
return sid; |
42 |
} |
43 |
|
44 |
/** Returns the sccs of this region */ |
45 |
public String getSccs() { |
46 |
return sccs; |
47 |
} |
48 |
|
49 |
/** Returns the scop id of this region */ |
50 |
public int getSunid() { |
51 |
return sunid; |
52 |
} |
53 |
|
54 |
/** Returns the order of this region */ |
55 |
public int getOrder() { |
56 |
return orderIn; |
57 |
} |
58 |
|
59 |
/** Returns the number of regions of a domain*/ |
60 |
public int getNumRegions() { |
61 |
return numRegions; |
62 |
} |
63 |
|
64 |
/** Returns the starting pdb residue serial of this region */ |
65 |
public String getStartPdbRes() { |
66 |
return startPdbRes; |
67 |
} |
68 |
|
69 |
/** Returns the ending pdb residue serial of this region */ |
70 |
public String getEndPdbRes() { |
71 |
return endPdbRes; |
72 |
} |
73 |
|
74 |
/** Returns the range of this region in the sequence. */ |
75 |
public Interval getInterval() { |
76 |
return interval; |
77 |
} |
78 |
|
79 |
/** Returns the domain type of this region. */ |
80 |
public DomainType getDomainType() { |
81 |
if (sid.endsWith("_")) { |
82 |
return DomainType.WHOLECHAIN; |
83 |
} else if (sid.charAt(sid.length()-2) == '.') { |
84 |
return DomainType.MULTICHAIN; |
85 |
} else if (numRegions == 1) { |
86 |
return DomainType.SINGLEFRAGMENT; |
87 |
} else if (numRegions > 1) { |
88 |
return DomainType.MULTIFRAGMENT; |
89 |
} else |
90 |
return DomainType.UNKNOWN; |
91 |
} |
92 |
|
93 |
/*---------------------------- static methods ---------------------------*/ |
94 |
} |