Skip to content

Commit

Permalink
Rename source and sink to empty set
Browse files Browse the repository at this point in the history
  • Loading branch information
msalihaltun committed Jun 1, 2021
1 parent deada2c commit ed33cfc
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 50 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ library of sbgnviz. Most users will not need to use this. It includes the follow
* `getSbgnClass(ele)` Returns sbgnclass of the given element. If the parameter is a string return it by assuming that it is the sbgnclass itself.
* `getPureSbgnClass(ele)` Returns sbgn class omitting the multimer information.
* `canHaveUnitOfInformation(ele)` Returns whether the give element have unit of information.
* `isEmptySetClass(ele)` Returns wether the given element or string is of the special empty set/source and sink class.
* `isEmptySetClass(ele)` Returns wether the given element or string is of the special empty set class.
* `isModulationArcClass(ele)` Returns whether the class of given element is a modulation arc as defined in PD specs.
* `convertToRenderedPosition(modelPos, pan, zoom)` Returns rendered position of a given model position.
* `getArrayLineStyle(ele)` Returns whether the line style is dashed or solid.
Expand Down
50 changes: 25 additions & 25 deletions sbgnviz.js

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions src/sbgn-extensions/sbgn-cy-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ module.exports = function () {
};

var sbgnShapes = $$.sbgn.sbgnShapes = {
'source and sink': true,
'empty set': true,
'nucleic acid feature': true,
'complex': true,
'macromolecule': true,
Expand Down Expand Up @@ -470,7 +470,7 @@ module.exports = function () {
};

cyStyleProperties.types.nodeShape.enums.push(
'source and sink', 'nucleic acid feature', 'complex', 'macromolecule',
'empty set', 'nucleic acid feature', 'complex', 'macromolecule',
'simple chemical', 'biological activity', 'compartment'
);

Expand Down Expand Up @@ -606,7 +606,7 @@ module.exports = function () {
}

var shapeNames = [ "simple chemical", "macromolecule", "complex",
"nucleic acid feature", "source and sink", "biological activity",
"nucleic acid feature", "empty set", "biological activity",
"compartment", "oldCompartment"
];

Expand Down Expand Up @@ -695,17 +695,17 @@ module.exports = function () {
"macromolecule": $$.sbgn.drawRoundRectangle,
"complex": $$.sbgn.drawComplex,
"nucleic acid feature": $$.sbgn.drawBottomRoundRectangle,
"source and sink": $$.sbgn.drawEllipse,
"empty set": $$.sbgn.drawEllipse,
"biological activity": $$.sbgn.drawBiologicalActivity,
"compartment": $$.sbgn.drawBarrel,
"oldCompartment": $$.sbgn.drawRoundRectangle
};

// To define an extra drawing for the node that is rendered at the very end,
// even after the node background image is drawn.
// E.g. cross lines of "source and sink" nodes.
// E.g. cross lines of "empty set" nodes.
$$.sbgn.extraDraw = {
"source and sink": $$.sbgn.drawCrossLine
"empty set": $$.sbgn.drawCrossLine
};

$$.sbgn.plainIntersectLine = {
Expand All @@ -727,7 +727,7 @@ module.exports = function () {
"nucleic acid feature": function( centerX, centerY, width, height, x, y, padding ) {
return cyBaseNodeShapes["bottomroundrectangle"].intersectLine( centerX, centerY, width, height, x, y, padding );
},
"source and sink": function( centerX, centerY, width, height, x, y, padding ) {
"empty set": function( centerX, centerY, width, height, x, y, padding ) {
return cyBaseNodeShapes["ellipse"].intersectLine( centerX, centerY, width, height, x, y, padding );
},
"biological activity": function( centerX, centerY, width, height, x, y, padding ) {
Expand Down Expand Up @@ -822,7 +822,7 @@ module.exports = function () {
"nucleic acid feature": function( x, y, padding, width, height, centerX, centerY ) {
return cyBaseNodeShapes["bottomroundrectangle"].checkPoint( x, y, padding, width, height, centerX, centerY );
},
"source and sink": function( x, y, padding, width, height, centerX, centerY ) {
"empty set": function( x, y, padding, width, height, centerX, centerY ) {
return cyBaseNodeShapes["ellipse"].checkPoint( x, y, padding, width, height, centerX, centerY );
},
"biological activity": function( x, y, padding, width, height, centerX, centerY ) {
Expand Down
32 changes: 16 additions & 16 deletions src/utilities/element-utilities-factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ module.exports = function () {
"nucleic acid feature": {asSource: {isAllowed: true}, asTarget: {}},
"compartment": {asSource: {}, asTarget: {}},
"tag": {asSource: {}, asTarget: {}},
"source and sink": {asSource: {isAllowed: true}, asTarget: {}},
"empty set": {asSource: {isAllowed: true}, asTarget: {}},
"perturbing agent": {asSource: {}, asTarget: {}},
"submap": {asSource: {}, asTarget: {}},
"process": {asSource: {}, asTarget: {isAllowed: true}},
Expand All @@ -113,7 +113,7 @@ module.exports = function () {
"nucleic acid feature": {asSource: {}, asTarget: {isAllowed: true}},
"compartment": {asSource: {}, asTarget: {}},
"tag": {asSource: {}, asTarget: {}},
"source and sink": {asSource: {}, asTarget: {isAllowed: true}},
"empty set": {asSource: {}, asTarget: {isAllowed: true}},
"perturbing agent": {asSource: {}, asTarget: {}},
"submap": {asSource: {}, asTarget: {}},
"process": {asSource: {isAllowed: true}, asTarget: {}},
Expand All @@ -134,7 +134,7 @@ module.exports = function () {
"nucleic acid feature": {asSource: {isAllowed: true}, asTarget: {}},
"compartment": {asSource: {}, asTarget: {}},
"tag": {asSource: {}, asTarget: {}},
"source and sink": {asSource: {isAllowed: true}, asTarget: {}},
"empty set": {asSource: {isAllowed: true}, asTarget: {}},
"perturbing agent": {asSource: {isAllowed: true}, asTarget: {}},
"submap": {asSource: {}, asTarget: {}},
"process": {asSource: {}, asTarget: {isAllowed: true}},
Expand All @@ -155,7 +155,7 @@ module.exports = function () {
"nucleic acid feature": {asSource: {isAllowed: true}, asTarget: {}},
"compartment": {asSource: {}, asTarget: {}},
"tag": {asSource: {}, asTarget: {}},
"source and sink": {asSource: {isAllowed: true}, asTarget: {}},
"empty set": {asSource: {isAllowed: true}, asTarget: {}},
"perturbing agent": {asSource: {isAllowed: true}, asTarget: {}},
"submap": {asSource: {}, asTarget: {}},
"process": {asSource: {}, asTarget: {isAllowed: true}},
Expand All @@ -176,7 +176,7 @@ module.exports = function () {
"nucleic acid feature": {asSource: {}, asTarget: {}},
"compartment": {asSource: {}, asTarget: {}},
"tag": {asSource: {}, asTarget: {}},
"source and sink": {asSource: {isAllowed: true}, asTarget: {}},
"empty set": {asSource: {isAllowed: true}, asTarget: {}},
"perturbing agent": {asSource: {}, asTarget: {}},
"submap": {asSource: {}, asTarget: {}},
"process": {asSource: {}, asTarget: {isAllowed: true, maxEdge: 1}},
Expand All @@ -197,7 +197,7 @@ module.exports = function () {
"nucleic acid feature": {asSource: {isAllowed: true}, asTarget: {}},
"compartment": {asSource: {}, asTarget: {}},
"tag": {asSource: {}, asTarget: {}},
"source and sink": {asSource: {isAllowed: true}, asTarget: {}},
"empty set": {asSource: {isAllowed: true}, asTarget: {}},
"perturbing agent": {asSource: {isAllowed: true}, asTarget: {}},
"submap": {asSource: {}, asTarget: {}},
"process": {asSource: {}, asTarget: {isAllowed: true}},
Expand All @@ -218,7 +218,7 @@ module.exports = function () {
"nucleic acid feature": {asSource: {isAllowed: true}, asTarget: {}},
"compartment": {asSource: {}, asTarget: {}},
"tag": {asSource: {}, asTarget: {}},
"source and sink": {asSource: {isAllowed: true}, asTarget: {}},
"empty set": {asSource: {isAllowed: true}, asTarget: {}},
"perturbing agent": {asSource: {isAllowed: true}, asTarget: {}},
"submap": {asSource: {}, asTarget: {}},
"process": {asSource: {}, asTarget: {isAllowed: true, maxEdge: 1}},
Expand All @@ -239,7 +239,7 @@ module.exports = function () {
"nucleic acid feature": {asSource: {isAllowed: true}, asTarget: {}},
"compartment": {asSource: {}, asTarget: {}},
"tag": {asSource: {}, asTarget: {}},
"source and sink": {asSource: {isAllowed: true}, asTarget: {}},
"empty set": {asSource: {isAllowed: true}, asTarget: {}},
"perturbing agent": {asSource: {}, asTarget: {}},
"submap": {asSource: {}, asTarget: {}},
"process": {asSource: {}, asTarget: {}},
Expand All @@ -260,7 +260,7 @@ module.exports = function () {
"nucleic acid feature": {asSource: {isAllowed: true}, asTarget: {}},
"compartment": {asSource: {}, asTarget: {}},
"tag": {asSource: {}, asTarget: {isAllowed: true}},
"source and sink": {asSource: {}, asTarget: {}},
"empty set": {asSource: {}, asTarget: {}},
"perturbing agent": {asSource: {}, asTarget: {}},
"submap": {asSource: {}, asTarget: {isAllowed: true}},
"process": {asSource: {}, asTarget: {}},
Expand Down Expand Up @@ -464,7 +464,7 @@ module.exports = function () {
'BA simple chemical', 'BA macromolecule', 'BA nucleic acid feature',
'BA perturbing agent', 'BA complex'];
elementUtilities.epnTypes = ['macromolecule', 'nucleic acid feature', 'simple chemical',
'source and sink', 'unspecified entity', 'perturbing agent', 'complex',
'empty set', 'unspecified entity', 'perturbing agent', 'complex',
'nucleic acid feature multimer', 'macromolecule multimer', 'simple chemical multimer', 'complex multimer'];
elementUtilities.sifTypes = ['SIF macromolecule', 'SIF simple chemical'];
elementUtilities.otherNodeTypes = ['compartment', 'tag', 'submap', 'topology group'];
Expand Down Expand Up @@ -614,7 +614,7 @@ module.exports = function () {
var sbgnclass = elementUtilities.getPureSbgnClass( ele );

return sbgnclass != 'and' && sbgnclass != 'or' && sbgnclass != 'not' && sbgnclass != 'delay'
&& sbgnclass != 'association' && sbgnclass != 'dissociation' && sbgnclass != 'source and sink' && !sbgnclass.endsWith('process');
&& sbgnclass != 'association' && sbgnclass != 'dissociation' && sbgnclass != 'empty set' && !sbgnclass.endsWith('process');
};

// Returns whether the give element have unit of information
Expand Down Expand Up @@ -656,7 +656,7 @@ module.exports = function () {
elementUtilities.mustBeSquare = function (ele) {
var sbgnclass = elementUtilities.getPureSbgnClass( ele );

return (sbgnclass.indexOf('process') != -1 || sbgnclass == 'source and sink'
return (sbgnclass.indexOf('process') != -1 || sbgnclass == 'empty set'
|| sbgnclass == 'and' || sbgnclass == 'or' || sbgnclass == 'not'
|| sbgnclass == 'association' || sbgnclass == 'dissociation' || sbgnclass == 'delay');
};
Expand Down Expand Up @@ -745,10 +745,10 @@ module.exports = function () {
return inArray( sbgnclass, elementUtilities.processTypes );
};

// Returns wether the given element or string is of the special empty set/source and sink class
// Returns wether the given element or string is of the special empty set/empty set class
elementUtilities.isEmptySetClass = function (ele) {
var sbgnclass = elementUtilities.getPureSbgnClass( ele );
return sbgnclass == 'source and sink';
return sbgnclass == 'empty set';
};

// Returns whether the given element is a logical operator
Expand Down Expand Up @@ -1068,7 +1068,7 @@ module.exports = function () {
}

// We need to define new node shapes with their class names for these nodes
if (_class == 'source and sink' || _class == 'nucleic acid feature' || _class == 'macromolecule'
if (_class == 'empty set' || _class == 'nucleic acid feature' || _class == 'macromolecule'
|| _class == 'simple chemical' || _class == 'complex' || _class == 'biological activity' ) {
return _class;
}
Expand Down Expand Up @@ -2323,7 +2323,7 @@ module.exports = function () {
width: 30,
height: 30
},
'source and sink': {
'empty set': {
width: 22,
height: 22
},
Expand Down

0 comments on commit ed33cfc

Please sign in to comment.