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

check seqId compatibility for cyclic peptides

parent ca66e334
No related branches found
No related tags found
No related merge requests found
......@@ -45,7 +45,7 @@ export function getAtomicRanges(hierarchy: AtomicHierarchy, entities: Entities,
const residueIt = Segmentation.transientSegments(hierarchy.residueAtomSegments, Interval.ofBounds(0, hierarchy.atoms._rowCount))
const { index, derived } = hierarchy
const { label_seq_id } = hierarchy.residues
// const { label_entity_id } = hierarchy.chains
const { label_entity_id } = hierarchy.chains
const { moleculeType, traceElementIndex } = derived.residue
let prevSeqId: number
......@@ -61,18 +61,20 @@ export function getAtomicRanges(hierarchy: AtomicHierarchy, entities: Entities,
prevEnd = -1
startIndex = -1
const eI = entities.getEntityIndex(label_entity_id.value(chainSegment.index))
const seq = sequence.byEntityKey[eI]
const maxSeqId = seq ? seq.sequence.seqId.value(seq.sequence.seqId.rowCount - 1) : -1
// check cyclic peptides, seqIds and distance must be compatible
const riStart = hierarchy.residueAtomSegments.index[chainSegment.start]
const riEnd = hierarchy.residueAtomSegments.index[chainSegment.end - 1]
if (areBackboneConnected(riStart, riEnd, conformation, index, derived)) {
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)) {
cyclicPolymerMap.set(riStart, riEnd)
cyclicPolymerMap.set(riEnd, riStart)
}
// TODO
// const eI = entities.getEntityIndex(label_entity_id.value(chainSegment.index))
// const seq = sequence.byEntityKey[eI]
// const maxSeqId = seq ? seq.sequence.seqId.value(seq.sequence.seqId.rowCount - 1) : -1
while (residueIt.hasNext) {
const residueSegment = residueIt.move();
const residueIndex = residueSegment.index
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment