|
@@ -41,7 +41,7 @@ export function TmDetColorTheme(
|
|
|
descriptorChains = pdbtmDescriptor.chains;
|
|
|
}
|
|
|
|
|
|
- const chainList = createResidueListsPerChain(descriptorChains);
|
|
|
+ const chainList = createResidueListsPerChain(descriptorChains, pdbtmDescriptor.side1);
|
|
|
if (pdbId) {
|
|
|
TmDetChainListCache.set(pdbId, chainList);
|
|
|
}
|
|
@@ -57,7 +57,12 @@ export function TmDetColorTheme(
|
|
|
|
|
|
const DefaultResidueColor = ColorNames.lightgrey;
|
|
|
|
|
|
-//TODO: colors of not curated sites
|
|
|
+enum SiteIndexes {
|
|
|
+ Side1 = 0,
|
|
|
+ Side2 = 1,
|
|
|
+ Periplasm = 8
|
|
|
+};
|
|
|
+
|
|
|
const siteColors = [
|
|
|
Color.fromArray([255,100,100], 0), // Side1
|
|
|
Color.fromArray([100,100,255], 0), // Side2
|
|
@@ -66,7 +71,8 @@ const siteColors = [
|
|
|
Color.fromArray([255,127, 0], 0), // TM re-entrant loop
|
|
|
Color.fromArray([0,255, 0], 0), // Interfacial Helix
|
|
|
Color.fromArray([196,196,196], 0), // Unknow localization
|
|
|
- Color.fromArray([0,255, 0], 0) // Membrane Inside
|
|
|
+ Color.fromArray([0,255, 0], 0), // Membrane Inside
|
|
|
+ Color.fromArray([255, 0, 255], 0) // Periplasm
|
|
|
];
|
|
|
|
|
|
const regionColorMapFromCss = new Map();
|
|
@@ -101,15 +107,26 @@ export function getChainAndResidueIds(location: Location) {
|
|
|
};
|
|
|
}
|
|
|
|
|
|
-export function createResidueListsPerChain(chains: PDBTMChain[]) {
|
|
|
+export function createResidueListsPerChain(chains: PDBTMChain[], side1: string|null) {
|
|
|
const chainList: ChainList = [];
|
|
|
|
|
|
chains.forEach((chain: PDBTMChain) => {
|
|
|
- chainList.push({ chainId: chain.chain_label, residues: [] });
|
|
|
+ const chainType = chain.additional_chain_annotations.type;
|
|
|
+ chainList.push({ chainId: chain.chain_label, type: chainType, residues: [] });
|
|
|
chain.residues.forEach((residue) => {
|
|
|
+ let siteId = residue.site_data![0].site_id_ref - 1;
|
|
|
+ let siteColorId = siteId;
|
|
|
+ if (siteColorId == SiteIndexes.Side1
|
|
|
+ && ((chainType == 'alpha' && side1 == "Outside")
|
|
|
+ || (chainType == 'beta' && side1 == "Inside"))) {
|
|
|
+
|
|
|
+ siteColorId = SiteIndexes.Periplasm;
|
|
|
+ }
|
|
|
+
|
|
|
chainList[chainList.length - 1].residues.push({
|
|
|
authId: residue.pdb_res_label,
|
|
|
- siteId: residue.site_data![0].site_id_ref - 1
|
|
|
+ siteId: siteId,
|
|
|
+ siteColorId: siteColorId
|
|
|
});
|
|
|
});
|
|
|
});
|
|
@@ -122,7 +139,7 @@ function residueColor(chains: ChainList, chainId: string, residueId: string): Co
|
|
|
|
|
|
const residue = getResidue(chains, chainId, residueId);
|
|
|
if (residue) {
|
|
|
- color = siteColors[residue.siteId];
|
|
|
+ color = siteColors[residue.siteColorId];
|
|
|
}
|
|
|
|
|
|
return color;
|