|
@@ -1,5 +1,5 @@
|
|
|
/**
|
|
|
- * Copyright (c) 2017-2020 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
|
+ * Copyright (c) 2017-2021 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
|
*
|
|
|
* @author David Sehnal <david.sehnal@gmail.com>
|
|
|
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
|
@@ -79,14 +79,22 @@ export { MmcifFormat };
|
|
|
type MmcifFormat = ModelFormat<MmcifFormat.Data>
|
|
|
|
|
|
namespace MmcifFormat {
|
|
|
- export type Data = { db: mmCIF_Database, frame: CifFrame }
|
|
|
- export function is(x: ModelFormat): x is MmcifFormat {
|
|
|
- return x.kind === 'mmCIF';
|
|
|
+ export type Data = {
|
|
|
+ db: mmCIF_Database,
|
|
|
+ frame: CifFrame,
|
|
|
+ /**
|
|
|
+ * Original source format. Some formats, including PDB, are converted
|
|
|
+ * to mmCIF before further processing.
|
|
|
+ */
|
|
|
+ source?: ModelFormat
|
|
|
+ }
|
|
|
+ export function is(x?: ModelFormat): x is MmcifFormat {
|
|
|
+ return x?.kind === 'mmCIF';
|
|
|
}
|
|
|
|
|
|
- export function fromFrame(frame: CifFrame, db?: mmCIF_Database): MmcifFormat {
|
|
|
+ export function fromFrame(frame: CifFrame, db?: mmCIF_Database, source?: ModelFormat): MmcifFormat {
|
|
|
if (!db) db = CIF.schema.mmCIF(frame);
|
|
|
- return { kind: 'mmCIF', name: db._name, data: { db, frame } };
|
|
|
+ return { kind: 'mmCIF', name: db._name, data: { db, frame, source } };
|
|
|
}
|
|
|
}
|
|
|
|