mirror of
https://github.com/molstar/molstar.git
synced 2026-06-06 22:54:22 +08:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c683cbe962 | ||
|
|
bd270e4428 | ||
|
|
23d942d8a5 | ||
|
|
cbcd6b99d2 | ||
|
|
ee5c098a9f |
25493
package-lock.json
generated
25493
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
76
package.json
76
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "molstar",
|
||||
"version": "1.2.4",
|
||||
"version": "1.2.5",
|
||||
"description": "A comprehensive macromolecular library.",
|
||||
"homepage": "https://github.com/molstar/molstar#readme",
|
||||
"repository": {
|
||||
@@ -86,64 +86,64 @@
|
||||
],
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@graphql-codegen/add": "^1.17.7",
|
||||
"@graphql-codegen/cli": "^1.17.8",
|
||||
"@graphql-codegen/time": "^1.17.10",
|
||||
"@graphql-codegen/typescript": "^1.17.9",
|
||||
"@graphql-codegen/typescript-graphql-files-modules": "^1.17.8",
|
||||
"@graphql-codegen/typescript-graphql-request": "^1.17.7",
|
||||
"@graphql-codegen/typescript-operations": "^1.17.8",
|
||||
"@types/cors": "^2.8.7",
|
||||
"@typescript-eslint/eslint-plugin": "^3.10.1",
|
||||
"@typescript-eslint/parser": "^3.10.1",
|
||||
"@graphql-codegen/add": "^2.0.2",
|
||||
"@graphql-codegen/cli": "^1.19.4",
|
||||
"@graphql-codegen/time": "^2.0.2",
|
||||
"@graphql-codegen/typescript": "^1.19.0",
|
||||
"@graphql-codegen/typescript-graphql-files-modules": "^1.18.1",
|
||||
"@graphql-codegen/typescript-graphql-request": "^2.0.3",
|
||||
"@graphql-codegen/typescript-operations": "^1.17.12",
|
||||
"@types/cors": "^2.8.8",
|
||||
"@typescript-eslint/eslint-plugin": "^4.9.1",
|
||||
"@typescript-eslint/parser": "^4.9.1",
|
||||
"benchmark": "^2.1.4",
|
||||
"concurrently": "^5.3.0",
|
||||
"cpx2": "^2.0.0",
|
||||
"css-loader": "^3.6.0",
|
||||
"eslint": "^7.8.1",
|
||||
"cpx2": "^3.0.0",
|
||||
"css-loader": "^5.0.1",
|
||||
"eslint": "^7.15.0",
|
||||
"extra-watch-webpack-plugin": "^1.0.3",
|
||||
"file-loader": "^6.1.0",
|
||||
"file-loader": "^6.2.0",
|
||||
"fs-extra": "^9.0.1",
|
||||
"graphql": "^15.3.0",
|
||||
"graphql": "^15.4.0",
|
||||
"http-server": "^0.12.3",
|
||||
"jest": "^26.4.2",
|
||||
"mini-css-extract-plugin": "^0.9.0",
|
||||
"node-sass": "^4.14.1",
|
||||
"raw-loader": "^4.0.1",
|
||||
"sass-loader": "^8.0.2",
|
||||
"simple-git": "^2.20.1",
|
||||
"style-loader": "^1.2.1",
|
||||
"ts-jest": "^26.3.0",
|
||||
"typescript": "^4.0.2",
|
||||
"jest": "^26.6.3",
|
||||
"mini-css-extract-plugin": "^1.3.2",
|
||||
"node-sass": "^5.0.0",
|
||||
"raw-loader": "^4.0.2",
|
||||
"sass-loader": "^10.1.0",
|
||||
"simple-git": "^2.25.0",
|
||||
"style-loader": "^2.0.0",
|
||||
"ts-jest": "^26.4.4",
|
||||
"typescript": "^4.1.2",
|
||||
"webpack": "^4.44.1",
|
||||
"webpack-cli": "^3.3.12",
|
||||
"webpack-version-file-plugin": "^0.4.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/argparse": "^1.0.38",
|
||||
"@types/benchmark": "^1.0.33",
|
||||
"@types/benchmark": "^2.1.0",
|
||||
"@types/compression": "1.7.0",
|
||||
"@types/express": "^4.17.8",
|
||||
"@types/jest": "^25.2.3",
|
||||
"@types/node": "^14.10.1",
|
||||
"@types/express": "^4.17.9",
|
||||
"@types/jest": "^26.0.18",
|
||||
"@types/node": "^14.14.11",
|
||||
"@types/node-fetch": "^2.5.7",
|
||||
"@types/react": "^16.9.49",
|
||||
"@types/react-dom": "^16.9.8",
|
||||
"@types/swagger-ui-dist": "3.0.5",
|
||||
"@types/react": "^17.0.0",
|
||||
"@types/react-dom": "^17.0.0",
|
||||
"@types/swagger-ui-dist": "3.30.0",
|
||||
"argparse": "^1.0.10",
|
||||
"body-parser": "^1.19.0",
|
||||
"compression": "^1.7.4",
|
||||
"cors": "^2.8.5",
|
||||
"express": "^4.17.1",
|
||||
"h264-mp4-encoder": "^1.0.12",
|
||||
"immer": "^7.0.9",
|
||||
"immer": "^8.0.0",
|
||||
"immutable": "^3.8.2",
|
||||
"node-fetch": "^2.6.0",
|
||||
"react": "^16.13.1",
|
||||
"react-dom": "^16.13.1",
|
||||
"node-fetch": "^2.6.1",
|
||||
"react": "^17.0.1",
|
||||
"react-dom": "^17.0.1",
|
||||
"rxjs": "^6.6.3",
|
||||
"swagger-ui-dist": "^3.33.0",
|
||||
"tslib": "^2.0.1",
|
||||
"swagger-ui-dist": "^3.37.2",
|
||||
"tslib": "^2.0.3",
|
||||
"util.promisify": "^1.0.1",
|
||||
"xhr2": "^0.2.0"
|
||||
}
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2019 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
||||
*
|
||||
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
||||
*/
|
||||
|
||||
import { ReaderResult as Result } from '../result';
|
||||
import { Task } from '../../../mol-task';
|
||||
import { parseCsv } from '../csv/parser';
|
||||
import { Column, Table } from '../../../mol-data/db';
|
||||
import { toTable } from '../cif/schema';
|
||||
|
||||
import Schema = Column.Schema
|
||||
import { CsvTable } from '../csv/data-model';
|
||||
|
||||
|
||||
export const Schema3DG = {
|
||||
/** Chromosome name */
|
||||
chromosome: Schema.str,
|
||||
/** Base position */
|
||||
position: Schema.int,
|
||||
/** X coordinate */
|
||||
x: Schema.float,
|
||||
/** Y coordinate */
|
||||
y: Schema.float,
|
||||
/** Z coordinate */
|
||||
z: Schema.float,
|
||||
};
|
||||
export type Schema3DG = typeof Schema3DG
|
||||
|
||||
export interface File3DG {
|
||||
table: Table<Schema3DG>
|
||||
}
|
||||
|
||||
const FieldNames = [ 'chromosome', 'position', 'x', 'y', 'z' ];
|
||||
|
||||
function categoryFromTable(name: string, table: CsvTable) {
|
||||
return {
|
||||
name,
|
||||
rowCount: table.rowCount,
|
||||
fieldNames: FieldNames,
|
||||
getField: (name: string) => {
|
||||
return table.getColumn(FieldNames.indexOf(name).toString());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export function parse3DG(data: string) {
|
||||
return Task.create<Result<File3DG>>('Parse 3DG', async ctx => {
|
||||
const opts = { quote: '', comment: '#', delimiter: '\t', noColumnNames: true };
|
||||
const csvFile = await parseCsv(data, opts).runInContext(ctx);
|
||||
if (csvFile.isError) return Result.error(csvFile.message, csvFile.line);
|
||||
const category = categoryFromTable('3dg', csvFile.result.table);
|
||||
const table = toTable(Schema3DG, category);
|
||||
return Result.success({ table });
|
||||
});
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2019 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
||||
*
|
||||
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
||||
*/
|
||||
|
||||
import { parse3DG } from '../3dg/parser';
|
||||
|
||||
const basic3dgString = `1(mat) 1420000 0.791377837067 10.9947291355 -13.1882897693
|
||||
1(mat) 1440000 -0.268241283699 10.5200875887 -13.0896257278
|
||||
1(mat) 1460000 -1.3853075236 10.5513787498 -13.1440142173
|
||||
1(mat) 1480000 -1.55984101733 11.4340829129 -13.6026301209
|
||||
1(mat) 1500000 -0.770991778399 11.4758488546 -14.5881137222
|
||||
1(mat) 1520000 -0.0848245107875 12.2624690808 -14.354289628
|
||||
1(mat) 1540000 -0.458643807046 12.5985791771 -13.4701149287
|
||||
1(mat) 1560000 -0.810322906201 12.2461643989 -12.3172933413
|
||||
1(mat) 1580000 -2.08211172035 12.8886838656 -12.8742007778
|
||||
1(mat) 1600000 -3.52093948201 13.1850935438 -12.4118684428`;
|
||||
|
||||
describe('3dg reader', () => {
|
||||
it('basic', async () => {
|
||||
const parsed = await parse3DG(basic3dgString).run();
|
||||
expect(parsed.isError).toBe(false);
|
||||
|
||||
if (parsed.isError) return;
|
||||
const { chromosome, position, x, y, z } = parsed.result.table;
|
||||
expect(chromosome.value(0)).toBe('1(mat)');
|
||||
expect(position.value(1)).toBe(1440000);
|
||||
expect(x.value(5)).toBe(-0.0848245107875);
|
||||
expect(y.value(5)).toBe(12.2624690808);
|
||||
expect(z.value(5)).toBe(-14.354289628);
|
||||
});
|
||||
});
|
||||
@@ -1,83 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2019-2020 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
||||
*
|
||||
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
||||
*/
|
||||
|
||||
import { Task } from '../../mol-task';
|
||||
import { ModelFormat } from '../format';
|
||||
import { Column, Table } from '../../mol-data/db';
|
||||
import { EntityBuilder } from './common/entity';
|
||||
import { File3DG } from '../../mol-io/reader/3dg/parser';
|
||||
import { fillSerial } from '../../mol-util/array';
|
||||
import { MoleculeType } from '../../mol-model/structure/model/types';
|
||||
import { BasicSchema, createBasic } from './basic/schema';
|
||||
import { createModels } from './basic/parser';
|
||||
import { Trajectory } from '../../mol-model/structure';
|
||||
|
||||
function getBasic(table: File3DG['table']) {
|
||||
const entityIds = new Array<string>(table._rowCount);
|
||||
const entityBuilder = new EntityBuilder();
|
||||
|
||||
const seqIdStarts = table.position.toArray({ array: Uint32Array });
|
||||
const seqIdEnds = new Uint32Array(table._rowCount);
|
||||
const stride = seqIdStarts[1] - seqIdStarts[0];
|
||||
|
||||
const objectRadius = stride / 3500;
|
||||
|
||||
for (let i = 0, il = table._rowCount; i < il; ++i) {
|
||||
const chr = table.chromosome.value(i);
|
||||
const entityId = entityBuilder.getEntityId(chr, MoleculeType.DNA, chr);
|
||||
entityIds[i] = entityId;
|
||||
seqIdEnds[i] = seqIdStarts[i] + stride - 1;
|
||||
}
|
||||
|
||||
const ihm_sphere_obj_site = Table.ofPartialColumns(BasicSchema.ihm_sphere_obj_site, {
|
||||
id: Column.ofIntArray(fillSerial(new Uint32Array(table._rowCount))),
|
||||
entity_id: Column.ofStringArray(entityIds),
|
||||
seq_id_begin: Column.ofIntArray(seqIdStarts),
|
||||
seq_id_end: Column.ofIntArray(seqIdEnds),
|
||||
asym_id: table.chromosome,
|
||||
|
||||
Cartn_x: Column.ofFloatArray(Column.mapToArray(table.x, x => x * 10, Float32Array)),
|
||||
Cartn_y: Column.ofFloatArray(Column.mapToArray(table.y, y => y * 10, Float32Array)),
|
||||
Cartn_z: Column.ofFloatArray(Column.mapToArray(table.z, z => z * 10, Float32Array)),
|
||||
|
||||
object_radius: Column.ofConst(objectRadius, table._rowCount, Column.Schema.float),
|
||||
rmsf: Column.ofConst(0, table._rowCount, Column.Schema.float),
|
||||
model_id: Column.ofConst(1, table._rowCount, Column.Schema.int),
|
||||
}, table._rowCount);
|
||||
|
||||
return createBasic({
|
||||
entity: entityBuilder.getEntityTable(),
|
||||
ihm_model_list: Table.ofPartialColumns(BasicSchema.ihm_model_list, {
|
||||
model_id: Column.ofIntArray([1]),
|
||||
model_name: Column.ofStringArray(['3DG Model']),
|
||||
}, 1),
|
||||
ihm_sphere_obj_site
|
||||
});
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
export { Format3dg };
|
||||
|
||||
type Format3dg = ModelFormat<File3DG>
|
||||
|
||||
namespace Format3dg {
|
||||
export function is(x: ModelFormat): x is Format3dg {
|
||||
return x.kind === '3dg';
|
||||
}
|
||||
|
||||
export function from3dg(file3dg: File3DG): Format3dg {
|
||||
return { kind: '3dg', name: '3DG', data: file3dg };
|
||||
}
|
||||
}
|
||||
|
||||
export function trajectoryFrom3DG(file3dg: File3DG): Task<Trajectory> {
|
||||
return Task.create('Parse 3DG', async ctx => {
|
||||
const format = Format3dg.from3dg(file3dg);
|
||||
const basic = getBasic(file3dg.table);
|
||||
return createModels(basic, format, ctx);
|
||||
});
|
||||
}
|
||||
@@ -83,13 +83,16 @@ export const _atom_site: CifCategory<CifExportContext> = {
|
||||
}
|
||||
};
|
||||
|
||||
function prepostfixed(prefix: string | undefined, postfix: string | undefined, name: string) {
|
||||
if (prefix && postfix) return `${prefix}_${name}_${postfix}`;
|
||||
function prepostfixed(prefix: string | undefined, name: string) {
|
||||
if (prefix) return `${prefix}_${name}`;
|
||||
if (postfix) return `${name}_${postfix}`;
|
||||
return name;
|
||||
}
|
||||
|
||||
function prefixedInsCode(prefix: string | undefined) {
|
||||
if (!prefix) return 'pdbx_PDB_ins_code';
|
||||
return `pdbx_${prefix}_PDB_ins_code`;
|
||||
}
|
||||
|
||||
function mappedProp<K, D>(loc: (key: K, data: D) => StructureElement.Location, prop: (e: StructureElement.Location) => any) {
|
||||
return (k: K, d: D) => prop(loc(k, d));
|
||||
}
|
||||
@@ -102,15 +105,14 @@ function addModelNum<K, D>(fields: CifWriter.Field.Builder<K, D>, getLocation: (
|
||||
|
||||
export interface IdFieldsOptions {
|
||||
prefix?: string,
|
||||
postfix?: string,
|
||||
includeModelNum?: boolean
|
||||
}
|
||||
|
||||
export function residueIdFields<K, D>(getLocation: (key: K, data: D) => StructureElement.Location, options?: IdFieldsOptions): CifField<K, D>[] {
|
||||
const prefix = options && options.prefix, postfix = options && options.postfix;
|
||||
const prefix = options && options.prefix;
|
||||
const ret = CifWriter.fields<K, D>()
|
||||
.str(prepostfixed(prefix, postfix, `label_comp_id`), mappedProp(getLocation, P.atom.label_comp_id))
|
||||
.int(prepostfixed(prefix, postfix, `label_seq_id`), mappedProp(getLocation, P.residue.label_seq_id), {
|
||||
.str(prepostfixed(prefix, `label_comp_id`), mappedProp(getLocation, P.atom.label_comp_id))
|
||||
.int(prepostfixed(prefix, `label_seq_id`), mappedProp(getLocation, P.residue.label_seq_id), {
|
||||
encoder: E.deltaRLE,
|
||||
valueKind: (k, d) => {
|
||||
const e = getLocation(k, d);
|
||||
@@ -118,45 +120,45 @@ export function residueIdFields<K, D>(getLocation: (key: K, data: D) => Structur
|
||||
return m.atomicHierarchy.residues.label_seq_id.valueKind(m.atomicHierarchy.residueAtomSegments.index[e.element]);
|
||||
}
|
||||
})
|
||||
.str(prepostfixed(prefix, postfix, `pdbx_PDB_ins_code`), mappedProp(getLocation, P.residue.pdbx_PDB_ins_code))
|
||||
.str(prefixedInsCode(prefix), mappedProp(getLocation, P.residue.pdbx_PDB_ins_code))
|
||||
|
||||
.str(prepostfixed(prefix, postfix, `label_asym_id`), mappedProp(getLocation, P.chain.label_asym_id))
|
||||
.str(prepostfixed(prefix, postfix, `label_entity_id`), mappedProp(getLocation, P.chain.label_entity_id))
|
||||
.str(prepostfixed(prefix, `label_asym_id`), mappedProp(getLocation, P.chain.label_asym_id))
|
||||
.str(prepostfixed(prefix, `label_entity_id`), mappedProp(getLocation, P.chain.label_entity_id))
|
||||
|
||||
.str(prepostfixed(prefix, postfix, `auth_comp_id`), mappedProp(getLocation, P.atom.auth_comp_id))
|
||||
.int(prepostfixed(prefix, postfix, `auth_seq_id`), mappedProp(getLocation, P.residue.auth_seq_id), { encoder: E.deltaRLE })
|
||||
.str(prepostfixed(prefix, postfix, `auth_asym_id`), mappedProp(getLocation, P.chain.auth_asym_id));
|
||||
.str(prepostfixed(prefix, `auth_comp_id`), mappedProp(getLocation, P.atom.auth_comp_id))
|
||||
.int(prepostfixed(prefix, `auth_seq_id`), mappedProp(getLocation, P.residue.auth_seq_id), { encoder: E.deltaRLE })
|
||||
.str(prepostfixed(prefix, `auth_asym_id`), mappedProp(getLocation, P.chain.auth_asym_id));
|
||||
|
||||
addModelNum(ret, getLocation, options);
|
||||
return ret.getFields();
|
||||
}
|
||||
|
||||
export function chainIdFields<K, D>(getLocation: (key: K, data: D) => StructureElement.Location, options?: IdFieldsOptions): CifField<K, D>[] {
|
||||
const prefix = options && options.prefix, postfix = options && options.postfix;
|
||||
const prefix = options && options.prefix;
|
||||
const ret = CifField.build<K, D>()
|
||||
.str(prepostfixed(prefix, postfix, `label_asym_id`), mappedProp(getLocation, P.chain.label_asym_id))
|
||||
.str(prepostfixed(prefix, postfix, `label_entity_id`), mappedProp(getLocation, P.chain.label_entity_id))
|
||||
.str(prepostfixed(prefix, postfix, `auth_asym_id`), mappedProp(getLocation, P.chain.auth_asym_id));
|
||||
.str(prepostfixed(prefix, `label_asym_id`), mappedProp(getLocation, P.chain.label_asym_id))
|
||||
.str(prepostfixed(prefix, `label_entity_id`), mappedProp(getLocation, P.chain.label_entity_id))
|
||||
.str(prepostfixed(prefix, `auth_asym_id`), mappedProp(getLocation, P.chain.auth_asym_id));
|
||||
|
||||
addModelNum(ret, getLocation, options);
|
||||
return ret.getFields();
|
||||
}
|
||||
|
||||
export function entityIdFields<K, D>(getLocation: (key: K, data: D) => StructureElement.Location, options?: IdFieldsOptions): CifField<K, D>[] {
|
||||
const prefix = options && options.prefix, postfix = options && options.postfix;
|
||||
const prefix = options && options.prefix;
|
||||
const ret = CifField.build<K, D>()
|
||||
.str(prepostfixed(prefix, postfix, `label_entity_id`), mappedProp(getLocation, P.chain.label_entity_id));
|
||||
.str(prepostfixed(prefix, `label_entity_id`), mappedProp(getLocation, P.chain.label_entity_id));
|
||||
|
||||
addModelNum(ret, getLocation, options);
|
||||
return ret.getFields();
|
||||
}
|
||||
|
||||
export function atomIdFields<K, D>(getLocation: (key: K, data: D) => StructureElement.Location, options?: IdFieldsOptions): CifField<K, D>[] {
|
||||
const prefix = options && options.prefix, postfix = options && options.postfix;
|
||||
const prefix = options && options.prefix;
|
||||
const ret = CifWriter.fields<K, D>()
|
||||
.str(prepostfixed(prefix, postfix, `label_atom_id`), mappedProp(getLocation, P.atom.label_atom_id))
|
||||
.str(prepostfixed(prefix, postfix, `label_comp_id`), mappedProp(getLocation, P.atom.label_comp_id))
|
||||
.int(prepostfixed(prefix, postfix, `label_seq_id`), mappedProp(getLocation, P.residue.label_seq_id), {
|
||||
.str(prepostfixed(prefix, `label_atom_id`), mappedProp(getLocation, P.atom.label_atom_id))
|
||||
.str(prepostfixed(prefix, `label_comp_id`), mappedProp(getLocation, P.atom.label_comp_id))
|
||||
.int(prepostfixed(prefix, `label_seq_id`), mappedProp(getLocation, P.residue.label_seq_id), {
|
||||
encoder: E.deltaRLE,
|
||||
valueKind: (k, d) => {
|
||||
const e = getLocation(k, d);
|
||||
@@ -164,16 +166,16 @@ export function atomIdFields<K, D>(getLocation: (key: K, data: D) => StructureEl
|
||||
return m.atomicHierarchy.residues.label_seq_id.valueKind(m.atomicHierarchy.residueAtomSegments.index[e.element]);
|
||||
}
|
||||
})
|
||||
.str(prepostfixed(prefix, postfix, `label_alt_id`), mappedProp(getLocation, P.atom.label_alt_id))
|
||||
.str(prepostfixed(prefix, postfix, `pdbx_PDB_ins_code`), mappedProp(getLocation, P.residue.pdbx_PDB_ins_code))
|
||||
.str(prepostfixed(prefix, `label_alt_id`), mappedProp(getLocation, P.atom.label_alt_id))
|
||||
.str(prefixedInsCode(prefix), mappedProp(getLocation, P.residue.pdbx_PDB_ins_code))
|
||||
|
||||
.str(prepostfixed(prefix, postfix, `label_asym_id`), mappedProp(getLocation, P.chain.label_asym_id))
|
||||
.str(prepostfixed(prefix, postfix, `label_entity_id`), mappedProp(getLocation, P.chain.label_entity_id))
|
||||
.str(prepostfixed(prefix, `label_asym_id`), mappedProp(getLocation, P.chain.label_asym_id))
|
||||
.str(prepostfixed(prefix, `label_entity_id`), mappedProp(getLocation, P.chain.label_entity_id))
|
||||
|
||||
.str(prepostfixed(prefix, postfix, `auth_atom_id`), mappedProp(getLocation, P.atom.auth_atom_id))
|
||||
.str(prepostfixed(prefix, postfix, `auth_comp_id`), mappedProp(getLocation, P.atom.auth_comp_id))
|
||||
.int(prepostfixed(prefix, postfix, `auth_seq_id`), mappedProp(getLocation, P.residue.auth_seq_id), { encoder: E.deltaRLE })
|
||||
.str(prepostfixed(prefix, postfix, `auth_asym_id`), mappedProp(getLocation, P.chain.auth_asym_id));
|
||||
.str(prepostfixed(prefix, `auth_atom_id`), mappedProp(getLocation, P.atom.auth_atom_id))
|
||||
.str(prepostfixed(prefix, `auth_comp_id`), mappedProp(getLocation, P.atom.auth_comp_id))
|
||||
.int(prepostfixed(prefix, `auth_seq_id`), mappedProp(getLocation, P.residue.auth_seq_id), { encoder: E.deltaRLE })
|
||||
.str(prepostfixed(prefix, `auth_asym_id`), mappedProp(getLocation, P.chain.auth_asym_id));
|
||||
|
||||
addModelNum(ret, getLocation, options);
|
||||
return ret.getFields();
|
||||
|
||||
@@ -113,15 +113,6 @@ export const GroProvider: TrajectoryFormatProvider = {
|
||||
visuals: defaultVisuals
|
||||
};
|
||||
|
||||
export const Provider3dg: TrajectoryFormatProvider = {
|
||||
label: '3DG',
|
||||
description: '3DG',
|
||||
category: TrajectoryFormatCategory,
|
||||
stringExtensions: ['3dg'],
|
||||
parse: directTrajectory(StateTransforms.Model.TrajectoryFrom3DG),
|
||||
visuals: defaultVisuals
|
||||
};
|
||||
|
||||
export const MolProvider: TrajectoryFormatProvider = {
|
||||
label: 'MOL/SDF',
|
||||
description: 'MOL/SDF',
|
||||
@@ -146,7 +137,6 @@ export const BuiltInTrajectoryFormats = [
|
||||
['pdb', PdbProvider] as const,
|
||||
['pdbqt', PdbqtProvider] as const,
|
||||
['gro', GroProvider] as const,
|
||||
['3dg', Provider3dg] as const,
|
||||
['mol', MolProvider] as const,
|
||||
['mol2', Mol2Provider] as const,
|
||||
] as const;
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
||||
*/
|
||||
|
||||
import { File3DG } from '../mol-io/reader/3dg/parser';
|
||||
import { Ccp4File } from '../mol-io/reader/ccp4/schema';
|
||||
import { CifFile } from '../mol-io/reader/cif';
|
||||
import { DcdFile } from '../mol-io/reader/dcd/parser';
|
||||
@@ -83,7 +82,6 @@ export namespace PluginStateObject {
|
||||
{ kind: 'cif', data: CifFile } |
|
||||
{ kind: 'pdb', data: CifFile } |
|
||||
{ kind: 'gro', data: CifFile } |
|
||||
{ kind: '3dg', data: File3DG } |
|
||||
{ kind: 'dcd', data: DcdFile } |
|
||||
{ kind: 'ccp4', data: Ccp4File } |
|
||||
{ kind: 'dsn6', data: Dsn6File } |
|
||||
|
||||
@@ -5,13 +5,11 @@
|
||||
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
||||
*/
|
||||
|
||||
import { parse3DG } from '../../mol-io/reader/3dg/parser';
|
||||
import { parseDcd } from '../../mol-io/reader/dcd/parser';
|
||||
import { parseGRO } from '../../mol-io/reader/gro/parser';
|
||||
import { parsePDB } from '../../mol-io/reader/pdb/parser';
|
||||
import { Mat4, Vec3 } from '../../mol-math/linear-algebra';
|
||||
import { shapeFromPly } from '../../mol-model-formats/shape/ply';
|
||||
import { trajectoryFrom3DG } from '../../mol-model-formats/structure/3dg';
|
||||
import { coordinatesFromDcd } from '../../mol-model-formats/structure/dcd';
|
||||
import { trajectoryFromGRO } from '../../mol-model-formats/structure/gro';
|
||||
import { trajectoryFromMmCIF } from '../../mol-model-formats/structure/mmcif';
|
||||
@@ -52,7 +50,6 @@ export { TrajectoryFromMOL };
|
||||
export { TrajectoryFromMOL2 };
|
||||
export { TrajectoryFromCube };
|
||||
export { TrajectoryFromCifCore };
|
||||
export { TrajectoryFrom3DG };
|
||||
export { ModelFromTrajectory };
|
||||
export { StructureFromTrajectory };
|
||||
export { StructureFromModel };
|
||||
@@ -339,24 +336,6 @@ const TrajectoryFromCifCore = PluginStateTransform.BuiltIn({
|
||||
}
|
||||
});
|
||||
|
||||
type TrajectoryFrom3DG = typeof TrajectoryFrom3DG
|
||||
const TrajectoryFrom3DG = PluginStateTransform.BuiltIn({
|
||||
name: 'trajectory-from-3dg',
|
||||
display: { name: 'Parse 3DG', description: 'Parse 3DG string and create trajectory.' },
|
||||
from: [SO.Data.String],
|
||||
to: SO.Molecule.Trajectory
|
||||
})({
|
||||
apply({ a }) {
|
||||
return Task.create('Parse 3DG', async ctx => {
|
||||
const parsed = await parse3DG(a.data).runInContext(ctx);
|
||||
if (parsed.isError) throw new Error(parsed.message);
|
||||
const models = await trajectoryFrom3DG(parsed.result).runInContext(ctx);
|
||||
const props = trajectoryProps(models);
|
||||
return new SO.Molecule.Trajectory(models, props);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
const plus1 = (v: number) => v + 1, minus1 = (v: number) => v - 1;
|
||||
type ModelFromTrajectory = typeof ModelFromTrajectory
|
||||
const ModelFromTrajectory = PluginStateTransform.BuiltIn({
|
||||
|
||||
Reference in New Issue
Block a user