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

Commit ec1c4d65 authored by Davide Lagoa's avatar Davide Lagoa
Browse files

minor changes

parent 17f64607
......@@ -127,11 +127,11 @@ public class WriteByMetabolitesID {
// }
// }
Node node = service.getNodeByEntryAndLabel("META:Ions", MetaboliteMajorLabel.MetaCyc);
Node node = service.getNodeByEntryAndLabel("META:Amino-Acids-20", MetaboliteMajorLabel.MetaCyc);
System.out.println(node.getAllProperties());
// Node node = service.getNodeByEntryAndLabel("cpd15460", MetaboliteMajorLabel.ModelSeed);
// Node node = service.getNodeByEntryAndLabel("cpd11420", MetaboliteMajorLabel.ModelSeed);
//
// System.out.println(node.getAllProperties());
......@@ -161,7 +161,7 @@ public class WriteByMetabolitesID {
try {
Boolean generate = true;
String accession = "Q8DL32"; //
String accession = "Q9X0S4"; //
// test2(service, null, null);
......
......@@ -255,9 +255,6 @@ public class Reports {
reportPath = reportPath.concat("scoresMethod1.txt");
System.out.println(reportByEvalue.containsKey("b3201"));
System.out.println(reportByEvalueAux.containsKey("b3201"));
try {
PrintWriter writer = new PrintWriter(reportPath, "UTF-8");
......
......@@ -56,6 +56,8 @@ public class IdentifyReactionsMetabolites {
logger.info("Total found: {}", tcdbMetabolitesIDs.size());
System.out.println(tcdbMetabolitesIDs);
}
/**
......@@ -717,8 +719,11 @@ public class IdentifyReactionsMetabolites {
entry[0] = ids.get(MetaboliteMajorLabel.MetaCyc);
entry[1] = MetaboliteMajorLabel.MetaCyc.toString();
if(metabolite.equals("META:Amino-Acids-20"))
entry[0] = metabolite;
forChildsSearch.put(metabolite, entry);
forChildsSearch.put(metabolite, entry);
}
else if(ids.containsKey(MetaboliteMajorLabel.EcoCyc)) { //ecocyc after metacyc
......@@ -726,6 +731,9 @@ public class IdentifyReactionsMetabolites {
entry[0] = ids.get(MetaboliteMajorLabel.MetaCyc);
entry[1] = MetaboliteMajorLabel.MetaCyc.toString();
if(metabolite.equals("META:Amino-Acids-20"))
entry[0] = metabolite;
forChildsSearch.put(metabolite, entry);
}
......
......@@ -29,6 +29,9 @@ public class ReactionsPredictor {
int current = 0;
for(String queryAccession : data.keySet()) {
// if(queryAccession.equals("b4296"))
// System.out.println();
if(data.get(queryAccession).getAnnotatedFamily() != null) {
......@@ -81,7 +84,7 @@ public class ReactionsPredictor {
String tcNumber = capsule.getTcdbID();
if(geneContainer.getCommomTaxaCount().containsKey(capsule.getTarget())){
if(geneContainer.getCommomTaxaCount().containsKey(capsule.getTarget())){
double simScore = capsule.getScore();
......
......@@ -585,7 +585,7 @@ public class TransportReactionsBuilder {
// System.out.println(reactionContainer.getDirectionRegex());
// System.out.println();
boolean print = true;
boolean print = false;
// if(reactant.contains(" menaquinol-6") && product.contains(" menaquinone-6"))
// System.out.println();
......
......@@ -99,7 +99,7 @@ public class TransyTestMain {
// coiso.add("2.A.1");
// FindTransporters.saveAllTCFamiliesInformation(coiso);
// ReadFastaTcdb.buildFastaFileForAlignments();
// ReadFastaTcdb.buildFastaFileForAlignments();
//
// Retriever.runRetriever(true, true, "P0AAF1");
// List<String> tests = List.of("results_m1_ev-50_p0", "results_m1_ev-50_p5", "results_m1_ev-50_p10", "results_m1_ev-50_p20",
......@@ -144,7 +144,11 @@ public class TransyTestMain {
//
// ModelSEEDRealatedOperations.assingModelSEEDIdentifiersToTranSyTReactions(true, null);
// System.exit(0);
String keggFastaPath = FilesUtils.getLastKnownVersion(KeggAPI.PATH_LAST_KNOWN_VERSION);
ReadFastaTcdb.buildFastaFileForAlignments(keggFastaPath);
System.exit(0);
// String path = "/Users/davidelagoa/Desktop/ecoli/ecoli_iML1515/";
......@@ -188,13 +192,14 @@ public class TransyTestMain {
workF.mkdir();
STAIN stain = STAIN.gram_negative; //optional ---> user selection
Organism organism = null;
switch (command) {
case "1":
logger.info("Scraper and database service option selected!");
Retriever.runRetriever(true, true, "P31075");
Retriever.runRetriever(true, true, "P0A6M2");
// WriteByMetabolitesID.start(properties);
break;
......@@ -211,7 +216,7 @@ public class TransyTestMain {
case "3":
logger.info("Transporters classification option selected");
logger.info("Transport reactions annotation option selected");
properties = new Properties(path.concat("params.txt"));
......@@ -247,13 +252,70 @@ public class TransyTestMain {
properties.setDatabaseURI("bolt://localhost:7687");
properties.setForceBlast(false);
Organism organism = new OrganismProperties(properties, stain).getOrganism();
organism = new OrganismProperties(properties, stain).getOrganism();
// String filePath = args[1];
// String modelPath = args[2];
new ProvideTransportReactionsToGenes(workFolderID, organism, filePath, modelPath,
metabolitesPath, resultPath, properties, true);
// Map<String, String> growthCpds = KbValidation.read_growth_compounds(rootPath + "Biolog_Merge_Lit_Pam_Binary_Data_V1.0.xlsx", testId, rootPath);
// Map<String, Set<String>> reactionsByCpd = KbValidation.findReactionsContaininigCompounds(growthCpds, resultPath + "results/transyt.xml");
//
// Map<String, String> no_growthCpds = KbValidation.read_no_growth_compounds(rootPath + "Biolog_Merge_Lit_Pam_Binary_Data_V1.0.xlsx", testId, rootPath);
// Map<String, Set<String>> reactionsNoGrowthByCpd = KbValidation.findReactionsContaininigCompounds(no_growthCpds, resultPath + "results/transyt.xml");
//
// FilesUtils.saveMapInFile3(resultPath + "results/biolog_compounds_no_growth.txt", reactionsNoGrowthByCpd);
// FilesUtils.saveMapInFile3(resultPath + "results/biolog_compounds.txt", reactionsByCpd);
break;
case "4":
logger.info("Transporters proteins annotation option selected");
properties = new Properties(path.concat("params.txt"));
// String workFolderID = args[1].trim();
//
// String taxPath = workFolderID.concat("taxID.txt");
//
// Integer taxID = Integer.valueOf(readWordInFile(path + "taxId.txt"));
//
// String filePath = workFolderID.concat("genome.faa");
//
// String modelPath = workFolderID.concat("model.xml");
//
// String metabolitesPath = workFolderID.concat("metabolites.txt");
//
// String resultPath = "";
//
// try {
//
// if(args[2] != null || !args[2].isEmpty()) {
// resultPath = args[2];
// }
// }
// catch(ArrayIndexOutOfBoundsException e){
//
// resultPath = workFolderID.concat("transyt.xml");
// }
// properties.setDefaultLabel(MetaboliteReferenceDatabaseEnum.KEGG);
// properties.setDefaultLabel(MetaboliteReferenceDatabaseEnum.ModelSEED);
// properties.setOverrideCommonOntologyFilter(false); //this option is false by default
properties.setDatabaseURI("bolt://localhost:7687");
properties.setForceBlast(false);
organism = new OrganismProperties(properties, stain).getOrganism();
// String filePath = args[1];
// String modelPath = args[2];
new ProvideTransportReactionsToGenes(workFolderID, organism, filePath, modelPath,
metabolitesPath, resultPath, properties);
metabolitesPath, resultPath, properties, false);
// Map<String, String> growthCpds = KbValidation.read_growth_compounds(rootPath + "Biolog_Merge_Lit_Pam_Binary_Data_V1.0.xlsx", testId, rootPath);
// Map<String, Set<String>> reactionsByCpd = KbValidation.findReactionsContaininigCompounds(growthCpds, resultPath + "results/transyt.xml");
......
package pt.uminho.ceb.biosystems.transyt.service.transyt;
import java.util.Map;
import java.util.Set;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -12,9 +9,7 @@ import pt.uminho.ceb.biosystems.transyt.service.reactions.ProvideTransportReacti
import pt.uminho.ceb.biosystems.transyt.service.utilities.OrganismProperties;
import pt.uminho.ceb.biosystems.transyt.utilities.capsules.Organism;
import pt.uminho.ceb.biosystems.transyt.utilities.enumerators.Enumerators.STAIN;
import pt.uminho.ceb.biosystems.transyt.utilities.files.FilesUtils;
import pt.uminho.ceb.biosystems.transyt.utilities.transytUtilities.Properties;
import validation_kbase.KbValidation;
/**
* @author Davide
......@@ -28,11 +23,38 @@ public class TransytMain {
// Integer taxID = Integer.valueOf(args[0]);
logger.info("############################################ TranSyT - v0.0.12.46 - SNAPSHOT ############################################");
logger.info("############################################ TranSyT - v0.0.12.52 - SNAPSHOT ############################################");
String command = args[0];
STAIN stain = STAIN.gram_negative; //optional ---> user selection
String workFolderID = args[1].trim();
logger.info("workfolder: " + workFolderID);
Properties properties = null;
String filePath = workFolderID.concat("protein.faa");
String modelPath = workFolderID.concat("model.xml");
String metabolitesPath = workFolderID.concat("metabolites.txt");
String resultPath = "";
try {
if(args[1] != null || !args[1].isEmpty()) {
resultPath = args[1];
}
}
catch(ArrayIndexOutOfBoundsException e){
resultPath = workFolderID;
}
Organism organism = null;
switch (command) {
case "1":
......@@ -60,61 +82,50 @@ public class TransytMain {
case "3":
logger.info("Transporters classification option selected");
logger.info("Transport reactions annotation option selected");
String workFolderID = args[1].trim();
logger.info("workfolder: " + workFolderID);
properties = new Properties(workFolderID.concat("params.txt"));
Properties properties = new Properties(workFolderID.concat("params.txt"));
String filePath = workFolderID.concat("protein.faa");
String modelPath = workFolderID.concat("model.xml");
String metabolitesPath = workFolderID.concat("metabolites.txt");
String resultPath = "";
organism = new OrganismProperties(properties, stain).getOrganism();
logger.debug("Using common ontology filter: " + !properties.isOverrideCommonOntologyFilter());
try {
new ProvideTransportReactionsToGenes(workFolderID, organism, filePath, modelPath,
metabolitesPath, resultPath, properties, true);
// if(args.length > 2) {
//
// String[] pathSplit = workFolderID.split("/");
//
// String testId = pathSplit[pathSplit.length-1];
// String rootPath = workFolderID.replace(testId, "");
//
// logger.info(workFolderID);
// logger.info(testId);
// logger.info(rootPath);
//
// Map<String, String> growthCpds = KbValidation.read_growth_compounds(rootPath + "Biolog_Merge_Lit_Pam_Binary_Data_V1.0.xlsx", testId, rootPath);
// Map<String, Set<String>> reactionsByCpd = KbValidation.findReactionsContaininigCompounds(growthCpds, resultPath + "results/transyt.xml");
//
// Map<String, String> no_growthCpds = KbValidation.read_no_growth_compounds(rootPath + "Biolog_Merge_Lit_Pam_Binary_Data_V1.0.xlsx", testId, rootPath);
// Map<String, Set<String>> reactionsNoGrowthByCpd = KbValidation.findReactionsContaininigCompounds(no_growthCpds, resultPath + "results/transyt.xml");
//
// FilesUtils.saveMapInFile3(resultPath + "results/biolog_compounds.txt", reactionsByCpd);
// FilesUtils.saveMapInFile3(resultPath + "results/biolog_compounds_no_growth.txt", reactionsNoGrowthByCpd);
// }
break;
case "4":
if(args[1] != null || !args[1].isEmpty()) {
resultPath = args[1];
}
}
catch(ArrayIndexOutOfBoundsException e){
logger.info("Transporters proteins annotation option selected");
resultPath = workFolderID;
}
Organism organism = new OrganismProperties(properties, stain).getOrganism();
properties = new Properties(workFolderID.concat("params.txt"));
logger.debug("Using common ontology filter: " + !properties.isOverrideCommonOntologyFilter());
organism = new OrganismProperties(properties, stain).getOrganism();
new ProvideTransportReactionsToGenes(workFolderID, organism, filePath, modelPath,
metabolitesPath, resultPath, properties);
if(args.length > 2) {
String[] pathSplit = workFolderID.split("/");
String testId = pathSplit[pathSplit.length-1];
String rootPath = workFolderID.replace(testId, "");
logger.info(workFolderID);
logger.info(testId);
logger.info(rootPath);
Map<String, String> growthCpds = KbValidation.read_growth_compounds(rootPath + "Biolog_Merge_Lit_Pam_Binary_Data_V1.0.xlsx", testId, rootPath);
Map<String, Set<String>> reactionsByCpd = KbValidation.findReactionsContaininigCompounds(growthCpds, resultPath + "results/transyt.xml");
Map<String, String> no_growthCpds = KbValidation.read_no_growth_compounds(rootPath + "Biolog_Merge_Lit_Pam_Binary_Data_V1.0.xlsx", testId, rootPath);
Map<String, Set<String>> reactionsNoGrowthByCpd = KbValidation.findReactionsContaininigCompounds(no_growthCpds, resultPath + "results/transyt.xml");
FilesUtils.saveMapInFile3(resultPath + "results/biolog_compounds.txt", reactionsByCpd);
FilesUtils.saveMapInFile3(resultPath + "results/biolog_compounds_no_growth.txt", reactionsNoGrowthByCpd);
}
metabolitesPath, resultPath, properties, false);
break;
default:
......
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