Skip to content
Snippets Groups Projects
Commit a8198359 authored by Alexander Rose's avatar Alexander Rose
Browse files

add AtomicConformation.xyzDefined & improve getAtomicRanges

parent 227721bf
No related branches found
No related tags found
No related merge requests found
......@@ -69,8 +69,8 @@ function createHierarchyData(atom_site: AtomSite, sourceIndex: Column<number>, o
const chains = Table.view(atom_site, ChainsSchema, offsets.chains);
// Fix possibly missing auth_/label_ columns
substUndefinedColumn(residues, 'label_seq_id', 'auth_seq_id');
substUndefinedColumn(atoms, 'label_atom_id', 'auth_atom_id');
substUndefinedColumn(residues, 'label_seq_id', 'auth_seq_id');
substUndefinedColumn(residues, 'label_comp_id', 'auth_comp_id');
substUndefinedColumn(chains, 'label_asym_id', 'auth_asym_id');
......@@ -83,6 +83,7 @@ function getConformation(atom_site: AtomSite): AtomicConformation {
atomId: atom_site.id,
occupancy: atom_site.occupancy,
B_iso_or_equiv: atom_site.B_iso_or_equiv,
xyzDefined: atom_site.Cartn_x.isDefined && atom_site.Cartn_y.isDefined && atom_site.Cartn_z.isDefined,
x: atom_site.Cartn_x.toArray({ array: Float32Array }),
y: atom_site.Cartn_y.toArray({ array: Float32Array }),
z: atom_site.Cartn_z.toArray({ array: Float32Array }),
......
......@@ -34,6 +34,10 @@ export interface AtomicConformation {
// Coordinates. Generally, not to be accessed directly because the coordinate might be
// transformed by an operator. Use Unit.getPosition instead.
/**
* Are xyz coordinates defined?
*/
xyzDefined: boolean,
/**
* The x coordinate in angstroms specified according to a set of orthogonal Cartesian axes.
*/
......
......@@ -70,7 +70,7 @@ export function getAtomicRanges(hierarchy: AtomicHierarchy, entities: Entities,
const riEnd = hierarchy.residueAtomSegments.index[chainSegment.end - 1]
const seqIdStart = label_seq_id.value(riStart)
const seqIdEnd = label_seq_id.value(riEnd)
if (seqIdStart === 1 && seqIdEnd === maxSeqId && areBackboneConnected(riStart, riEnd, conformation, index, derived)) {
if (seqIdStart === 1 && seqIdEnd === maxSeqId && conformation.xyzDefined && areBackboneConnected(riStart, riEnd, conformation, index, derived)) {
cyclicPolymerMap.set(riStart, riEnd)
cyclicPolymerMap.set(riEnd, riStart)
}
......@@ -95,7 +95,7 @@ export function getAtomicRanges(hierarchy: AtomicHierarchy, entities: Entities,
} else {
const riStart = hierarchy.residueAtomSegments.index[residueSegment.start]
const riEnd = hierarchy.residueAtomSegments.index[prevEnd - 1]
if (!areBackboneConnected(riStart, riEnd, conformation, hierarchy.index, derived)) {
if (conformation.xyzDefined && !areBackboneConnected(riStart, riEnd, conformation, hierarchy.index, derived)) {
polymerRanges.push(startIndex, prevEnd - 1)
startIndex = residueSegment.start
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment