forked from nglviewer/ngl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added random-coil-index coloring based on validation report xml file
- Loading branch information
Showing
5 changed files
with
133 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,42 @@ | ||
{ | ||
"folders": | ||
[ | ||
{ | ||
"path": "." | ||
} | ||
], | ||
"settings": | ||
{ | ||
"tab_size": 4, | ||
"translate_tabs_to_spaces": false, | ||
"trim_trailing_white_space_on_save": true | ||
}, | ||
"build_systems": | ||
[ | ||
{ | ||
"name": "Lint", | ||
"shell_cmd": "npm run-script lint", | ||
"working_dir": "${project_path}", | ||
}, | ||
{ | ||
"name": "Test", | ||
"shell_cmd": "npm test", | ||
"working_dir": "${project_path}", | ||
}, | ||
{ | ||
"name": "Build", | ||
"shell_cmd": "npm run-script build", | ||
"working_dir": "${project_path}", | ||
}, | ||
{ | ||
"name": "Watch", | ||
"shell_cmd": "npm run-script watch", | ||
"working_dir": "${project_path}", | ||
}, | ||
{ | ||
"name": "Rollup", | ||
"shell_cmd": "rollup -c", | ||
"working_dir": "${project_path}", | ||
} | ||
] | ||
"build_systems": | ||
[ | ||
{ | ||
"name": "Lint", | ||
"shell_cmd": "npm run-script lint", | ||
"working_dir": "${project_path}" | ||
}, | ||
{ | ||
"name": "Test", | ||
"shell_cmd": "npm test", | ||
"working_dir": "${project_path}" | ||
}, | ||
{ | ||
"name": "Build", | ||
"shell_cmd": "npm run-script build", | ||
"working_dir": "${project_path}" | ||
}, | ||
{ | ||
"name": "Watch", | ||
"shell_cmd": "npm run-script watch", | ||
"working_dir": "${project_path}" | ||
}, | ||
{ | ||
"name": "Rollup", | ||
"shell_cmd": "rollup -c", | ||
"working_dir": "${project_path}" | ||
} | ||
], | ||
"folders": | ||
[ | ||
{ | ||
"path": "." | ||
} | ||
], | ||
"settings": | ||
{ | ||
"tab_size": 4, | ||
"translate_tabs_to_spaces": false, | ||
"trim_trailing_white_space_on_save": true | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/** | ||
* @file Randomcoilindex Colormaker | ||
* @author Alexander Rose <[email protected]> | ||
* @private | ||
*/ | ||
|
||
import { ColormakerRegistry } from '../globals' | ||
import Colormaker, { StuctureColormakerParams, ColormakerScale } from './colormaker' | ||
import AtomProxy from '../proxy/atom-proxy' | ||
|
||
/** | ||
* Color by random coil index | ||
*/ | ||
class RandomcoilindexColormaker extends Colormaker { | ||
rciScale: ColormakerScale | ||
rciDict: { [k: string]: number|undefined } = {} | ||
|
||
constructor (params: StuctureColormakerParams) { | ||
super(params) | ||
|
||
if (!params.scale) { | ||
this.parameters.scale = 'RdYlBu' | ||
} | ||
|
||
this.rciScale = this.getScale({ domain: [ 1, 0 ] }) | ||
|
||
const val = params.structure.validation | ||
if (val) this.rciDict = val.rciDict | ||
|
||
} | ||
|
||
atomColor (atom: AtomProxy) { | ||
let sele = `[${atom.resname}]${atom.resno}` | ||
if (atom.chainname) sele += ':' + atom.chainname | ||
|
||
const rci = this.rciDict[ sele ] | ||
return rci !== undefined ? this.rciScale(rci) : 0x909090 | ||
} | ||
} | ||
|
||
ColormakerRegistry.add('randomcoilindex', RandomcoilindexColormaker as any) | ||
|
||
export default RandomcoilindexColormaker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters