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

Change blast properties reader

parent 99142c05
......@@ -24,12 +24,12 @@ public class BiggMain {
List<String> listArgs = readParamsFile(paramsPath);
String eValue = listArgs.get(2);
String bitScore = listArgs.get(3);
String queryCoverage = listArgs.get(4);
Properties properties = new Properties(bitScore, queryCoverage, eValue);
Properties properties = new Properties();
properties = validateProperties(properties, listArgs);
String filePath = workFolderID.concat("workerSubmissions/queryGenome.faa");
int option = Integer.parseInt(listArgs.get(0));
......@@ -113,5 +113,31 @@ public class BiggMain {
return models;
}
private static Properties validateProperties(Properties properties, List<String> listArgs) {
try {
String eValue = listArgs.get(2);
String bitScore = listArgs.get(3);
String queryCoverage = listArgs.get(4);
if(bitScore != null && bitScore != "")
properties.setBitScore(Double.valueOf(bitScore));
if(queryCoverage != null && queryCoverage != "")
properties.setQueryCoverage(Double.valueOf(queryCoverage));
if(eValue != null && eValue != "")
properties.setBlastEValue(Double.valueOf(eValue));
}catch(Exception ex) {
System.out.println("Please check your properties values.");
System.out.println(ex.getMessage());
}
return properties;
}
}
......@@ -51,13 +51,13 @@ public class Properties {
}
}
public Properties(String bitScore, String queryCoverage, String evalue) {
this.bitScore = Double.valueOf(bitScore);
this.queryCoverage = Double.valueOf(queryCoverage);
this.blastEvalue = Double.valueOf(evalue);
}
// public Properties(String bitScore, String queryCoverage, String evalue) {
// this.bitScore = Double.valueOf(bitScore);
//
// this.queryCoverage = Double.valueOf(queryCoverage);
//
// this.blastEvalue = Double.valueOf(evalue);
// }
/**
......@@ -135,6 +135,20 @@ public class Properties {
public void seteValueThreshold(double eValueThreshold) {
this.eValueThreshold = eValueThreshold;
}
/**
* @param queryCoverage the queryCoverage to set
*/
public void setBlastEValue(double blastEvalue) {
this.blastEvalue = blastEvalue;
}
/**
* @param queryCoverage the queryCoverage to set
*/
public void setBitScore(double bitScore) {
this.bitScore = bitScore;
}
/**
......
......@@ -28,6 +28,7 @@ public class ProvideBiggReactionsToGenes {
private static Map<String, List<String>> seqIdReactionRelation = new HashMap<>();
private String queryPath;
private Map<String, List<String>> gprsMap = new HashMap<String,List<String>>();
public ProvideBiggReactionsToGenes(String workFolderID, String queryPathParameters, Properties properties, int option, String items) {
this.queryPath = queryPathParameters;
......@@ -68,6 +69,7 @@ public class ProvideBiggReactionsToGenes {
findGPRs(workFolderID);
}
......@@ -107,18 +109,20 @@ public class ProvideBiggReactionsToGenes {
File fout = new File(filePath);
FileOutputStream fos = new FileOutputStream(fout);
BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(fos));
for(Entry<String, List<String>> entry : gprs.entrySet()) {
List<String> genesList = new ArrayList<String>();
String genes="";
for(String gene: entry.getValue()) {
genes = genes + gene + "; ";
genesList.add(gene);
}
writer.write(entry.getKey() + "- {"+genes+"}");
writer.newLine();
gprsMap.put(entry.getKey(), genesList);
}
writer.close();
......
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