Git Lab CI for docker build enabled! You can enable it using .gitlab-ci.yml in your project. Check file template at https://gitlab.bio.di.uminho.pt/snippets/5

Generate gene reaction rules

parent 8d23266b
......@@ -28,5 +28,6 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="C:/Users/Asus/Downloads/Java_Binding_1_1/WolframAlphaJavaLibrary/WolframAlpha-1.1.jar"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
......@@ -120,6 +120,11 @@
<artifactId>json-simple</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>com.bpodgursky</groupId>
<artifactId>jbool_expressions</artifactId>
<version>1.23</version>
</dependency>
<!-- </dependency> <groupId>org.sing_group</groupId> <artifactId>gc4s</artifactId>
<version>1.2.2</version> </dependency> -->
</dependencies>
......
......@@ -19,7 +19,7 @@ public class BiggMain {
public static void main(String[] args) throws Exception {
String workFolderID = "/workdir/"; //Docker (/workdir/)
String workFolderID = "C:/Users/Asus/Desktop/"; //Docker (/workdir/)
String paramsPath = workFolderID.concat("workerSubmissions/params.txt");
FileUtils.extractZipFile(workFolderID+"Bigg_Files/Results.tgz", workFolderID+"Bigg_Files/");
......
......@@ -26,7 +26,7 @@ public class Properties {
private static final Logger logger = LoggerFactory.getLogger(Properties.class);
public Properties() {
String propertiesFilePath = "/workdir/" + "configurations.txt";
String propertiesFilePath = "C:/Users/Asus/Desktop/" + "configurations.txt";
allProperties = FileUtils.readPropertiesFile(false,propertiesFilePath);
boolean go = assignVariables();
......
......@@ -8,6 +8,7 @@ import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.math.MathContext;
import java.nio.charset.StandardCharsets;
import java.nio.file.NoSuchFileException;
import java.util.ArrayList;
......@@ -16,17 +17,28 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import com.bpodgursky.jbool_expressions.*;
import com.bpodgursky.jbool_expressions.parsers.ExprParser;
import com.bpodgursky.jbool_expressions.rules.Rule;
import com.bpodgursky.jbool_expressions.rules.RuleSet;
import com.wolfram.*;
import com.wolfram.alpha.WAEngine;
import com.wolfram.alpha.WAQuery;
import com.wolfram.alpha.WAQueryResult;
import com.wolfram.alpha.net.*;
import com.wolfram.alpha.visitor.*;
import pt.uminho.ceb.biosystems.merlin.bigg.blast.Properties;
import pt.uminho.ceb.biosystems.merlin.bigg.data.BiggUtils;
import org.apache.commons.io.IOUtils;
import org.hibernate.criterion.LogicalExpression;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
public class BiggDataCenter {
private static List<String> metaboliteBiggIds = new ArrayList<String>();
private static List<String> reactionBiggIds = new ArrayList<String>();
private static List<String> modelBiggIds = new ArrayList<String>();
......@@ -1046,7 +1058,7 @@ public class BiggDataCenter {
public static Map<String,String> genesReactionsRuleFile(String path) throws Exception {
Map<String,String> geneReactionRuleMap = new HashMap<String, String>();
Map<String,List<String>> geneReactionRuleMapList = new HashMap<String,List<String>>();
Map<String,List<String>> geneReactionRuleMapList = new HashMap<String,List<String>>();
try {
List<String> modelFiles = new ArrayList<String>();
......
package pt.uminho.ceb.biosystems.merlin.bigg.operation;
import es.uvigo.ei.aibench.core.operation.annotation.Direction;
import es.uvigo.ei.aibench.core.operation.annotation.Operation;
import es.uvigo.ei.aibench.core.operation.annotation.Port;
import es.uvigo.ei.aibench.workbench.Workbench;
import pt.uminho.ceb.biosystems.merlin.aibench.datatypes.WorkspaceAIB;
@Operation(name="CreateModelfromBigg", description="Create model from BiGG data.")
public class CreateModelfromBigg {
private String databaseName;
private String biggAllinfo;
private String biggSpecificModelsinfo;
private String biggSpecificOrganisms;
private String biggRandomModelsinfo;
/**
* @param project
*/
@Port(direction=Direction.INPUT, name="Select Workspace", validateMethod = "checkProject", order=1)
public void setProject(WorkspaceAIB project) {
}
public void checkProject(WorkspaceAIB project) {
if(project==null) {
throw new IllegalArgumentException("Please select a workspace.");
}
else {
this.databaseName = project.getName();
}
}
/**
* @param biggAllinfo
*/
@Port(direction=Direction.INPUT, name="Use all BiGG data", order=1)
public void setOption1(String biggAllinfo) {
this.biggAllinfo = biggAllinfo;
}
/**
* @param biggSpecificModelsinfo
*/
@Port(direction=Direction.INPUT, name="Use specific BiGG models data", order=1)
public void setOption2(String biggSpecificModelsinfo) {
this.biggSpecificModelsinfo = biggSpecificModelsinfo;
}
/**
* @param biggSpecificOrganisms
*/
@Port(direction=Direction.INPUT, name="Use specific BiGG organisms data", order=1)
public void setOption3(String biggSpecificOrganisms) {
this.biggSpecificOrganisms = biggSpecificOrganisms;
}
/**
* @param biggSpecificOrganisms
*/
@Port(direction=Direction.INPUT, name="Use random BiGG models data", order=1)
public void setOption4(String biggRandomModelsinfo) {
this.biggRandomModelsinfo = biggRandomModelsinfo;
}
public void onValidationError(Throwable arg0) {
Workbench.getInstance().error(arg0);
}
}
//package pt.uminho.ceb.biosystems.merlin.bigg.operation;
//
//import java.awt.Component;
//import java.awt.FlowLayout;
//import java.awt.event.ActionEvent;
//import java.awt.event.ActionListener;
//import java.io.File;
//import java.io.FileNotFoundException;
//import java.util.ArrayList;
//import java.util.Scanner;
//
//import javax.swing.ImageIcon;
//import javax.swing.InputMap;
//import javax.swing.JButton;
//import javax.swing.JFrame;
//import javax.swing.JPanel;
//import javax.swing.JPasswordField;
//import javax.swing.JTextField;
//import javax.swing.KeyStroke;
//
//import org.sing_group.gc4s.dialog.AbstractInputJDialog;
//import org.sing_group.gc4s.input.InputParameter;
//import org.sing_group.gc4s.input.InputParametersPanel;
//import org.sing_group.gc4s.input.combobox.ExtendedJComboBox;
//
//import es.uvigo.ei.aibench.core.ParamSpec;
//import es.uvigo.ei.aibench.core.operation.OperationDefinition;
//import es.uvigo.ei.aibench.workbench.InputGUI;
//import es.uvigo.ei.aibench.workbench.ParamsReceiver;
//import es.uvigo.ei.aibench.workbench.Workbench;
//import pt.uminho.ceb.biosystems.merlin.aibench.utilities.CreateImageIcon;
//import pt.uminho.ceb.biosystems.merlin.utilities.io.FileUtils;
//
//
//public class CreateModelfromBiggGUI extends AbstractInputJDialog implements InputGUI{
// private static final long serialVersionUID = 1L;
//
// public static String[] options = {
// "Use all BiGG informations",
// "Use specific BiGG models information",
// "Use specific BiGG organisms information",
// "Use random BiGG models information"
// };
//
// public static ExtendedJComboBox<String> choosenOption = new ExtendedJComboBox<String>(options);
// public static JTextField choosenModels = new JTextField();
// public static JTextField choosenOrganism = new JPasswordField();
// public static JTextField evalue = new JTextField();
// public static JTextField querycoverage = new JTextField();
// public static JTextField bitscore = new JTextField();
//
// private ParamsReceiver rec;
//
// public CreateModelfromBiggGUI() {
// super(new JFrame());
// fill();
// }
//
// public String getDialogTitle() {
// return "create model from BiGG";
// }
//
// public String getDescription() {
// return "use BiGG information to create a model.";
// }
//
// public JPanel getInputComponentsPane() {
// return new InputParametersPanel(getInputParameters());
// }
//
// @Override
// protected Component getButtonsPane() {
// final JPanel buttonsPanel = new JPanel(new FlowLayout());
//
// okButton = new JButton("save");
// okButton.setEnabled(true);
// okButton.setToolTipText("save");
// okButton.setIcon(new CreateImageIcon(new ImageIcon(getClass().getClassLoader().getResource("icons/Save.png")),0.1).resizeImageIcon());
// ActionListener listener= new ActionListener() {
//
// @Override
// public void actionPerformed(ActionEvent arg0) {
//
// String passText = new String(password.getPassword());
//
// rec.paramsIntroduced(
// new ParamSpec[]{
// new ParamSpec("Host",String.class,host.getText(),null),
// new ParamSpec("Port",String.class,port.getText(),null),
// new ParamSpec("User",String.class,username.getText(),null),
// new ParamSpec("Password",String.class,passText,null),
// new ParamSpec("Database Type",String.class,dbType.getSelectedItem().toString(),null),
// }
// );
// if(dbType.getSelectedItem().toString().equals("H2")) {
// if(!username.getText().equals("")&& !String.valueOf(password.getPassword()).equals("")) {
//
// dispose();
//
// }
// }
// if(dbType.getSelectedItem().toString().equals("MySQL")) {
// if(!username.getText().equals("")&& !String.valueOf(password.getPassword()).equals("")&&!port.getText().equals("")&&!host.getText().equals("")) {
// if (port.getText().matches("[0-9]+")) {
// dispose();
// }
// }
// }
//
// }
// };
// okButton.addActionListener(listener);
//
// cancelButton = new JButton("cancel");
// cancelButton.setToolTipText("cancel");
// cancelButton.setIcon(new CreateImageIcon(new ImageIcon(getClass().getClassLoader().getResource("icons/Cancel.png")),0.1).resizeImageIcon());
// cancelButton.addActionListener(event -> {
//
//// String[] options = new String[2];
//// options[0] = "yes";
//// options[1] = "no";
////
//// int result = CustomGUI.stopQuestion("cancel confirmation", "are you sure you want to cancel the operation?", options);
//
// //if(result == 0) {
// canceled = true;
// dispose();
//
// //}
//
// });
//
//
// buttonsPanel.add(okButton);
// buttonsPanel.add(cancelButton);
//
// getRootPane().setDefaultButton(okButton);
// InputMap im = okButton.getInputMap();
// im.put(KeyStroke.getKeyStroke("ENTER"), "pressed");
// im.put(KeyStroke.getKeyStroke("released ENTER"), "released");
//
// ActionListener updateDbType = new ActionListener() {
//
// @Override
// public void actionPerformed(ActionEvent arg0) {
// if(dbType.getSelectedItem().toString().equals("MySQL")) {
// fillWithoutDbMySQL();
// }else {
// fillWithoutDbH2();
// }
//
//
// }
// };
//
// dbType.addActionListener(updateDbType);
//
//
// return buttonsPanel;
//
//
// }
// private InputParameter[] getInputParameters() {
// InputParameter[] parameters = new InputParameter[5];
// parameters[0] =
// new InputParameter(
// "database type",
// dbType,
// "select database type"
// );
//
// parameters[1] =
// new InputParameter(
// "username",
// username,
// "set username"
// );
// parameters[2] =
// new InputParameter(
// "password",
// password,
// "set password"
// );
// parameters[3] =
// new InputParameter(
// "host",
// host,
// "set host"
// );
// parameters[4] =
// new InputParameter(
// "port",
// port,
// "set port"
// );
//
//
// return parameters;
// }
//
// public void fill () {
//
// ArrayList<String> listLines= new ArrayList<>();
// String confPath = FileUtils.getConfFolderPath().concat("database_settings.conf");
// File configfile= new File(confPath);
// try {
// Scanner file= new Scanner(configfile);
// while(file.hasNextLine()==true) {
// listLines.add(file.nextLine());
// }
// file.close();
// } catch (FileNotFoundException e) {
// e.printStackTrace();
// }
//
// for (String item : listLines) {
//
// if(item.startsWith("dbtype")) {
// String[]parts=item.split(":");
//
//
// if(parts[1].trim().equals("h2")) {
// for (String dbOption : items) {
// if(dbOption.equals("H2")) {
// dbType.setSelectedItem(dbOption);
// fillWithoutDbH2();
// continue;
// }
// }
//
// }
//
// if(parts[1].trim().equals("mysql")) {
// for (String dbOption : items) {
// if(dbOption.equals("MySQL")) {
// dbType.setSelectedItem(dbOption);
// fillWithoutDbMySQL();
// continue;
// }
// }
// }
// }
// }
// }
// public void fillWithoutDbMySQL() {
// ArrayList<String> listLines= new ArrayList<>();
// String confPath = FileUtils.getConfFolderPath().concat("database_settings.conf");
// File configfile= new File(confPath);
// try {
// Scanner file= new Scanner(configfile);
// while(file.hasNextLine()==true) {
// listLines.add(file.nextLine());
// }
// file.close();
// } catch (FileNotFoundException e) {
// e.printStackTrace();
// }
//
// for (String item : listLines) {
//
// if(item.startsWith("username")) {
//
// String[]parts=item.split(":");
// username.setText(parts[1].trim());
// continue;
//
// }
// if(item.startsWith("password")) {
// String[]parts=item.split(":");
// password.setText(parts[1].trim());
// continue;
//
// }
// if(item.startsWith("host")) {
// String[]parts=item.split(":");
// host.setText(parts[1].trim());
// continue;
//
// }
// if(item.startsWith("port")) {
// String[]parts=item.split(":");
// port.setText(parts[1].trim());
// continue;
//
// }
// }
// port.setEditable(true);
// host.setEditable(true);
// }
// public void fillWithoutDbH2() {
// ArrayList<String> listLines= new ArrayList<>();
// String confPath = FileUtils.getConfFolderPath().concat("database_settings.conf");
// File configfile= new File(confPath);
// try {
// Scanner file= new Scanner(configfile);
// while(file.hasNextLine()==true) {
// listLines.add(file.nextLine());
// }
// file.close();
// } catch (FileNotFoundException e) {
// e.printStackTrace();
// }
//
// for (String item : listLines) {
//
// if(item.startsWith("h2_username")) {
// String[]parts=item.split(":");
// username.setText(parts[1].trim());
// continue;
//
// }
// if(item.startsWith("h2_password")) {
// String[]parts=item.split(":");
// password.setText(parts[1].trim());
// continue;
//
// }
// host.setText("");
// port.setText("");
// }
// port.setEditable(false);
// host.setEditable(false);
// }
//
// @Override
// public void setVisible(boolean b) {
// this.pack();
// super.setVisible(b);
// }
//
// @Override
// public void init(ParamsReceiver arg0, OperationDefinition<?> arg1) {
// this.rec = arg0;
// this.setTitle(arg1.getName());
// this.setVisible(true);
// }
//
// /* (non-Javadoc)
// * @see es.uvigo.ei.aibench.workbench.InputGUI#onValidationError(java.lang.Throwable)
// */
// public void onValidationError(Throwable arg0) {
//
// Workbench.getInstance().error(arg0);
// }
//
// @Override
// public void finish() {
//
// }
//}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment