Skip to content
Snippets Groups Projects
Commit c0ec05c3 authored by Sebastian Bittrich's avatar Sebastian Bittrich
Browse files

drops log, employs Partial and spread operator for params

parent 3937e8b0
Branches
No related tags found
No related merge requests found
...@@ -46,7 +46,7 @@ const hbondEnergyCutoff = -0.5 ...@@ -46,7 +46,7 @@ const hbondEnergyCutoff = -0.5
const hbondEnergyMinimal = -9.9 const hbondEnergyMinimal = -9.9
interface DSSPContext { interface DSSPContext {
params: PD.Values<SecondaryStructureComputationParams>, params: Partial<PD.Values<SecondaryStructureComputationParams>>,
getResidueFlag: (f: DSSPType) => SecondaryStructureType, getResidueFlag: (f: DSSPType) => SecondaryStructureType,
getFlagName: (f: DSSPType) => String, getFlagName: (f: DSSPType) => String,
...@@ -120,9 +120,8 @@ export type SecondaryStructureComputationParams = typeof SecondaryStructureCompu ...@@ -120,9 +120,8 @@ export type SecondaryStructureComputationParams = typeof SecondaryStructureCompu
export function computeSecondaryStructure(hierarchy: AtomicHierarchy, export function computeSecondaryStructure(hierarchy: AtomicHierarchy,
conformation: AtomicConformation, conformation: AtomicConformation,
params?: PD.Values<SecondaryStructureComputationParams>): SecondaryStructure { params: Partial<PD.Values<SecondaryStructureComputationParams>> = {}): SecondaryStructure {
// TODO is this the best way? is should be possible to provide partial 'overrides' of default values params = { ...PD.getDefaultValues(SecondaryStructureComputationParams), ...params };
if (!params) params = PD.getDefaultValues(SecondaryStructureComputationParams);
// TODO use Zhang-Skolnik for CA alpha only parts or for coarse parts with per-residue elements // TODO use Zhang-Skolnik for CA alpha only parts or for coarse parts with per-residue elements
const { lookup3d, proteinResidues } = calcAtomicTraceLookup3D(hierarchy, conformation) const { lookup3d, proteinResidues } = calcAtomicTraceLookup3D(hierarchy, conformation)
...@@ -132,7 +131,7 @@ export function computeSecondaryStructure(hierarchy: AtomicHierarchy, ...@@ -132,7 +131,7 @@ export function computeSecondaryStructure(hierarchy: AtomicHierarchy,
const residueCount = proteinResidues.length const residueCount = proteinResidues.length
const flags = new Uint32Array(residueCount) const flags = new Uint32Array(residueCount)
console.log(`calculating secondary structure elements using ${ params.oldDefinition ? 'old' : 'revised'} definition and ${ params.oldOrdering ? 'old' : 'revised'} ordering of secondary structure elements`) // console.log(`calculating secondary structure elements using ${ params.oldDefinition ? 'old' : 'revised'} definition and ${ params.oldOrdering ? 'old' : 'revised'} ordering of secondary structure elements`)
const torsionAngles = calculateDihedralAngles(hierarchy, conformation, proteinResidues, backboneIndices) const torsionAngles = calculateDihedralAngles(hierarchy, conformation, proteinResidues, backboneIndices)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment