|
@@ -9,20 +9,30 @@ import { CustomElementProperty } from '../../mol-model-props/common/custom-eleme
|
|
import { Model, ElementIndex } from '../../mol-model/structure';
|
|
import { Model, ElementIndex } from '../../mol-model/structure';
|
|
import { Color } from '../../mol-util/color';
|
|
import { Color } from '../../mol-util/color';
|
|
|
|
|
|
|
|
+const ColorMap = [
|
|
|
|
+ Color(0xff0000),
|
|
|
|
+ Color(0x0000ff),
|
|
|
|
+ Color(0xffff00)
|
|
|
|
+];
|
|
|
|
+
|
|
export const StripedResidues = CustomElementProperty.create<number>({
|
|
export const StripedResidues = CustomElementProperty.create<number>({
|
|
- label: 'Residue Stripes',
|
|
|
|
- name: 'basic-wrapper-residue-striping',
|
|
|
|
|
|
+ label: 'TMDet Topology Colors',
|
|
|
|
+ name: 'tmdet-topology-colors',
|
|
getData(model: Model) {
|
|
getData(model: Model) {
|
|
- console.log('getData');
|
|
|
|
|
|
+ console.log('getData', model.atomicHierarchy.residueAtomSegments);
|
|
|
|
+ console.log('getData: auth_comp_id', model.atomicHierarchy.atoms.auth_comp_id.toArray());
|
|
const map = new Map<ElementIndex, number>();
|
|
const map = new Map<ElementIndex, number>();
|
|
const residueIndex = model.atomicHierarchy.residueAtomSegments.index;
|
|
const residueIndex = model.atomicHierarchy.residueAtomSegments.index;
|
|
for (let i = 0, _i = model.atomicHierarchy.atoms._rowCount; i < _i; i++) {
|
|
for (let i = 0, _i = model.atomicHierarchy.atoms._rowCount; i < _i; i++) {
|
|
- map.set(i as ElementIndex, residueIndex[i] % 2);
|
|
|
|
|
|
+ const residueId = residueIndex[i];
|
|
|
|
+ const value = (residueId === 310) ? 2 : residueId % 2;
|
|
|
|
+ map.set(i as ElementIndex, value);
|
|
}
|
|
}
|
|
|
|
+ console.log('map', map);
|
|
return { value: map };
|
|
return { value: map };
|
|
},
|
|
},
|
|
coloring: {
|
|
coloring: {
|
|
- getColor(e) { return e === 0 ? Color(0xff0000) : Color(0x0000ff); },
|
|
|
|
|
|
+ getColor(e) { return ColorMap[e]; },
|
|
defaultColor: Color(0x777777)
|
|
defaultColor: Color(0x777777)
|
|
},
|
|
},
|
|
getLabel(e) {
|
|
getLabel(e) {
|