Skip to content

Commit

Permalink
Missing sequence marker now checks child leaf nodes, instead of itself
Browse files Browse the repository at this point in the history
  • Loading branch information
Randoom97 committed Jan 22, 2021
1 parent d52be96 commit f1e6071
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions SBOLCanvasFrontend/src/app/graph.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,25 @@ export class GraphService extends GraphHelpers {
return combinatorial.getVariableComponentInfo(sequenceFeature.getId());
}

/**
* Recursively checks that all leaf children have sequences
* @param sequenceFeature A cell representing a sequence feature
*/
hasSequence(sequenceFeature): boolean {
if(!sequenceFeature || !sequenceFeature.isSequenceFeatureGlyph()){
return false;
}
// check if the child view has more than just a backbone
let circuitContainer = sequenceFeature.getCircuitContainer(this.graph);
if(circuitContainer.children.length > 1){
for(let child of circuitContainer.children){
if(child.isSequenceFeatureGlyph() && !this.hasSequence(child)){
return false;
}
}
return true;
}
// no children? we must be a leaf node, check for a sequence
let glyphInfo = (<GlyphInfo>this.getFromInfoDict(sequenceFeature.getValue()));
if(!glyphInfo || !glyphInfo.sequence || glyphInfo.sequence.length <= 0){
return false;
Expand Down

0 comments on commit f1e6071

Please sign in to comment.