@datagrok-libraries/bio
Advanced tools
Comparing version 5.42.12 to 5.42.13
# bio changelog | ||
## 5.42.13 (2024-09-02) | ||
* Add interfaces for monomer management | ||
## 5.42.12 (2024-08-30) | ||
@@ -4,0 +8,0 @@ |
@@ -11,3 +11,3 @@ { | ||
"friendlyName": "Datagrok bio library", | ||
"version": "5.42.12", | ||
"version": "5.42.13", | ||
"description": "Bio utilities, types supporting Macromolecule, Molecule3D data", | ||
@@ -14,0 +14,0 @@ "dependencies": { |
import { UserLibSettings } from './types'; | ||
export declare const LIB_STORAGE_NAME: string; | ||
export declare const LIB_PATH: string; | ||
export declare const LIB_STORAGE_NAME = "Libraries"; | ||
export declare const LIB_PATH = "System:AppData/Bio/monomer-libraries/"; | ||
export declare const SETS_STORAGE_NAME: string; | ||
@@ -5,0 +5,0 @@ export declare const SETS_PATH: string; |
@@ -5,3 +5,3 @@ import * as grok from 'datagrok-api/grok'; | ||
export const LIB_PATH = 'System:AppData/Bio/monomer-libraries/'; | ||
const LIB_SETTINGS_FOR_TESTS = { explicit: ['HELMCoreLibrary.json'], exclude: [] }; | ||
const LIB_SETTINGS_FOR_TESTS = { explicit: ['HELMCoreLibrary.json'], exclude: [], duplicateMonomerPreferences: {} }; | ||
export const SETS_STORAGE_NAME = 'Monomer Sets'; | ||
@@ -14,6 +14,8 @@ export const SETS_PATH = 'System:AppData/Bio/monomer-sets/'; | ||
const resStr = await grok.dapi.userDataStorage.getValue(LIB_STORAGE_NAME, 'Settings', true); | ||
res = resStr ? JSON.parse(resStr) : { exclude: [], explicit: [] }; | ||
res = resStr ? JSON.parse(resStr) : { exclude: [], explicit: [], duplicateMonomerPreferences: {} }; | ||
// Fix empty object returned in case there is no settings stored for user | ||
res.exclude = res.exclude instanceof Array ? res.exclude : []; | ||
res.explicit = res.explicit instanceof Array ? res.explicit : []; | ||
res.duplicateMonomerPreferences = res.duplicateMonomerPreferences instanceof Object ? | ||
res.duplicateMonomerPreferences : {}; | ||
console.debug(`Bio: getUserLibSettings()\n${JSON.stringify(res, undefined, 2)}`); | ||
@@ -20,0 +22,0 @@ }); |
import * as DG from 'datagrok-api/dg'; | ||
import * as grok from 'datagrok-api/grok'; | ||
import { Observable } from 'rxjs'; | ||
import { IMonomerLib, IMonomerSet } from '../types/index'; | ||
import { IMonomerLib, Monomer, IMonomerSet } from '../types/index'; | ||
import { ISeqSplitted } from '../utils/macromolecule/types'; | ||
@@ -26,2 +27,26 @@ export declare function encodeMonomers(col: DG.Column): DG.Column | null; | ||
} | ||
export interface INewMonomerForm { | ||
get fieldInputs(): { | ||
[key: string]: DG.InputBase<any> | grok.chem.Sketcher; | ||
}; | ||
get form(): HTMLElement; | ||
get rgroupInputs(): { | ||
[key: string]: DG.InputBase<any>; | ||
}[]; | ||
get metaInputs(): { | ||
[key: string]: DG.InputBase<any>; | ||
}[]; | ||
setMonomer(monomer: Monomer): void; | ||
} | ||
export interface IMonomerGallery { | ||
get monomerGallery(): HTMLElement; | ||
groupBy(by: string): void; | ||
filterBySearch(search: string): void; | ||
} | ||
export interface IMonomerManager { | ||
/** Creates new monomer library in correct folder and adds given monomers */ | ||
createNewMonomerLib(libName: string, monomers: Monomer[]): Promise<void>; | ||
cloneMonomer(dfRow: DG.Row): Monomer; | ||
getNewMonomerForm(): INewMonomerForm; | ||
} | ||
export interface IMonomerLibHelper { | ||
@@ -28,0 +53,0 @@ get eventManager(): IMonomerLibFileEventManager; |
@@ -9,2 +9,8 @@ export interface ITypedArray { | ||
explicit: string[]; | ||
/** Libraries might contain different monomers for same symbol. Object for monomer symbol to library name of choice*/ | ||
duplicateMonomerPreferences: { | ||
[polymerType: string]: { | ||
[monomerSymbol: string]: string; | ||
}; | ||
}; | ||
}; | ||
@@ -11,0 +17,0 @@ /** Stores necessary data about atoms of a monomer parsed from Molfile */ |
import * as DG from 'datagrok-api/dg'; | ||
import { Observable } from 'rxjs'; | ||
import { HelmType, IWebEditorMonomer, MonomerSetType, MonomerType, PolymerType } from '../helm/types'; | ||
export { MonomerType, PolymerType }; | ||
import { HELM_REQUIRED_FIELD as REQ, HELM_RGROUP_FIELDS as RGP, HELM_OPTIONAL_FIELDS as OPT, HELM_POLYMER_TYPE } from '../utils/const'; | ||
@@ -67,2 +68,3 @@ export type RGroup = { | ||
update(lib: IMonomerLib): void; | ||
toJSON(): Monomer[]; | ||
get onChanged(): Observable<any>; | ||
@@ -69,0 +71,0 @@ /** Summary string with lib monomer count by type |
@@ -0,1 +1,2 @@ | ||
import * as DG from 'datagrok-api/dg'; | ||
import { MonomerType, PolymerType } from '../helm/types'; | ||
@@ -7,2 +8,3 @@ import { MonomerTypes, PolymerTypes } from '../helm/consts'; | ||
export { HELM_POLYMER_TYPE, HELM_MONOMER_TYPE }; | ||
export { PolymerTypes, MonomerTypes }; | ||
/** Required HELM library monomer fields: | ||
@@ -62,14 +64,17 @@ * https://github.com/PistoiaHELM/HELMMonomerSets/blob/master/HELMmonomerSchema.json */ | ||
export declare const DUMMY_MONOMER: { | ||
monomerType: MonomerType; | ||
smiles: string; | ||
name: string; | ||
author: string; | ||
molfile: string; | ||
naturalAnalog: string; | ||
rgroups: RGroup[]; | ||
createDate: null; | ||
id: number; | ||
polymerType: PolymerType; | ||
symbol: string; | ||
readonly monomerType: MonomerType; | ||
readonly smiles: ""; | ||
readonly name: ""; | ||
readonly author: "Datagrok"; | ||
readonly molfile: ""; | ||
readonly naturalAnalog: ""; | ||
readonly rgroups: RGroup[]; | ||
readonly createDate: null; | ||
readonly id: 0; | ||
readonly polymerType: PolymerType; | ||
readonly symbol: ""; | ||
}; | ||
export declare const MonomerInputProperties: { | ||
[key: string]: DG.Property; | ||
}; | ||
export declare const MONOMER_ENCODE_MIN = 256; | ||
@@ -76,0 +81,0 @@ export declare const MONOMER_ENCODE_MAX = 1034; |
@@ -0,1 +1,2 @@ | ||
import * as DG from 'datagrok-api/dg'; | ||
// core fields of HELM library object used in toAtomicLevel function | ||
@@ -38,2 +39,11 @@ export const HELM_CORE_FIELDS = [ | ||
}; | ||
export const MonomerInputProperties = { | ||
'monomerType': DG.Property.js('monomerType', DG.TYPE.STRING, { choices: ["Backbone" /* MonomerTypes.BACKBONE */, "Branch" /* MonomerTypes.BRANCH */, "Terminal" /* MonomerTypes.TERMINAL */] }), | ||
'molecule': DG.Property.fromOptions({ name: 'molecule', type: DG.InputType.Molecule }), | ||
'name': DG.Property.js('name', DG.TYPE.STRING), | ||
'naturalAnalog': DG.Property.js('naturalAnalog', DG.TYPE.STRING), | ||
'id': DG.Property.js('id', DG.TYPE.INT), | ||
'polymerType': DG.Property.js('polymerType', DG.TYPE.STRING, { choices: ["RNA" /* PolymerTypes.RNA */, "PEPTIDE" /* PolymerTypes.PEPTIDE */, "CHEM" /* PolymerTypes.CHEM */, "BLOB" /* PolymerTypes.BLOB */, "G" /* PolymerTypes.G */] }), | ||
'symbol': DG.Property.js('symbol', DG.TYPE.STRING), | ||
}; | ||
// range of hex nubers used in PepSea library to endode monomers | ||
@@ -40,0 +50,0 @@ export const MONOMER_ENCODE_MIN = 0x100; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
759146
335
9425