Skip to content

Commit

Permalink
Add GPML import/export support
Browse files Browse the repository at this point in the history
  • Loading branch information
hasanbalci authored and NoorMuhammad1 committed Jan 31, 2024
1 parent a572e63 commit 1d310bb
Show file tree
Hide file tree
Showing 4 changed files with 6,140 additions and 4,244 deletions.
45 changes: 42 additions & 3 deletions app/js/app-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,9 +363,11 @@ module.exports = function() {
$("#import-experimental-data").click(function () {
$("#overlay-data").trigger('click');
});

$("#import-SBML-file").click(function () {
$("#sbml-file").trigger('click');
});

$("#import-simple-af-file").click(function () {
$("#simple-af-file-input").trigger('click');
});
Expand All @@ -382,6 +384,10 @@ module.exports = function() {
$("#sif-layout-input").trigger('click');
});

$("#import-GPML-file").click(function () {
$("#gpml-file-input").trigger('click');
});

$("#overlay-data").change(function () {
var chiseInstance = appUtilities.getActiveChiseInstance();
var cy = appUtilities.getActiveCy();
Expand Down Expand Up @@ -461,6 +467,34 @@ module.exports = function() {
$(this).val("");
}
});

$("#gpml-file-input").change(function () {

var chiseInstance = appUtilities.getActiveChiseInstance();
var cy = appUtilities.getActiveCy();
if ($(this).val() != "") {
var file = this.files[0];
appUtilities.setFileContent(file.name);
chiseInstance.loadGpml(file, success = function(data){
if (cy.elements().length !== 0) {
promptConfirmationView.render(function () {
chiseInstance.loadSBGNMLText(data.message, false, file.name, cy);
});
}
else {
chiseInstance.loadSBGNMLText(data.message, false, file.name, cy);
}
},
error = function(data){
promptFileConversionErrorView.render();
document.getElementById("file-conversion-error-message").innerText = "Conversion service is not available!";

});

$(this).val("");
}
});

$("#simple-af-file-input").change(function () {
var chiseInstance = appUtilities.getActiveChiseInstance();

Expand Down Expand Up @@ -1333,14 +1367,19 @@ module.exports = function() {
$("#export-as-sbgnml-plain-file").click(function (evt) {
fileSaveView.render("sbgn", "plain");
});

$("#export-as-sbgnml3-plain-file").click(function (evt) {
fileSaveView.render("sbgn", "plain3");
});

$("#export-as-sbml").click(function (evt) {
fileSaveView.render("sbml", null, null);

$("#export-as-sbml").click(function (evt) {
fileSaveView.render("sbml", null, null);
});

$("#export-as-gpml").click(function (evt) {
fileSaveView.render("gpml", null, null);
});

$("#add-complex-for-selected").click(function (e) {

// use active chise instance
Expand Down
Loading

0 comments on commit 1d310bb

Please sign in to comment.