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 365068ef authored by Davide Lagoa's avatar Davide Lagoa
Browse files

refactoring project

parent 189af95f
......@@ -23,6 +23,12 @@
</build>
<dependencies>
<dependency>
<groupId>utilities</groupId>
<artifactId>triage-utilities</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
......@@ -106,27 +112,6 @@
<version>6.0.6</version>
</dependency>
<dependency>
<groupId>pt.uminho.sysbio.common</groupId>
<artifactId>bioapis</artifactId>
<version>0.0.1-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</exclusion>
<exclusion>
<groupId>org.biojava</groupId>
<artifactId>biojava-alignment</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.3</version>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
......
package containers;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
public class BiosynthMetaboliteProperties {
public static final String NONE = "NONE";
private String source;
private String entryID = NONE;
private Set<String> synonyms;
private String formula = NONE;
private String remark;
private String bestReferenceURL = NONE;
private String bestReferenceID = NONE;
private String bestReferenceSource = NONE;
private Map<String, Map<String, Object>> allReferences;
private Set<Long> inherentNodeIDChilds;
public BiosynthMetaboliteProperties(String entryID, String source, Set<String> synonyms) {
this.source = source;
this.entryID = entryID;
this.synonyms = new HashSet<>();
this.allReferences = new HashMap<>();
this.synonyms = synonyms;
}
/**
* @return the synonyms
*/
public Set<String> getSynonyms() {
return synonyms;
}
/**
* @param synonyms the synonyms to set
*/
public void setSynonyms(Set<String> synonyms) {
this.synonyms = synonyms;
}
/**
* @return the formula
*/
public String getFormula() {
return formula;
}
/**
* @param formula the formula to set
*/
public void setFormula(String formula) {
this.formula = formula;
}
/**
* @return the references
*/
public String getRemark() {
return remark;
}
/**
* @param references the references to set
*/
public void setRemark(String references) {
this.remark = references;
}
/**
* @return the entry
*/
public String getEntry() {
return entryID;
}
/**
* @return the references
*/
public Map<String, Map<String, Object>> getReferences() {
return allReferences;
}
/**
* @param references the references to set
*/
public void setReferences(Map<String, Map<String, Object>> references) {
this.allReferences = references;
}
/**
* @return the source
*/
public String getSource() {
return source;
}
/**
* @param source the source to set
*/
public void setSource(String source) {
this.source = source;
}
/**
* @return the bestReferenceSource
*/
public String getBestReferenceSource() {
return bestReferenceSource;
}
/**
* @param bestReferenceSource the bestReferenceSource to set
*/
public void setBestReferenceSource(String bestReferenceSource) {
this.bestReferenceSource = bestReferenceSource;
}
/**
* @return the bestReferenceID
*/
public String getBestReferenceID() {
return bestReferenceID;
}
/**
* @param bestReferenceID the bestReferenceID to set
*/
public void setBestReferenceID(String bestReferenceID) {
this.bestReferenceID = bestReferenceID;
}
/**
* @return the keggLink
*/
public String getBestReferenceURL() {
return bestReferenceURL;
}
/**
* @param keggLink the keggLink to set
*/
public void setBestReferenceURL(String bestReferenceURL) {
this.bestReferenceURL = bestReferenceURL;
}
/**
* @return the inherentNodeIDChilds
*/
public Set<Long> getInherentNodeIDChilds() {
return inherentNodeIDChilds;
}
/**
* @param inherentNodeIDChilds the inherentNodeIDChilds to set
*/
public void setInherentNodeIDChilds(Set<Long> inherentNodeIDChilds) {
this.inherentNodeIDChilds = inherentNodeIDChilds;
}
}
package containers;
public class FastaTcdb {
private String accession = null;
private String sequence = null;
private String tcNumber = null;
private String organism = null;
private String description = null;
public FastaTcdb(String id, String sequence, String tcNumber, String organism, String description) {
this.accession = id;
this.organism = organism;
this.sequence = sequence;
this.tcNumber = tcNumber;
this.description = description;
}
/**
* @return the id
*/
public String getAccession() {
return accession;
}
/**
* @return the sequence
*/
public String getSequence() {
return sequence;
}
/**
* @return the tcNumber
*/
public String getTcNumber() {
return tcNumber;
}
/**
* @return the organism
*/
public String getOrganism() {
return organism;
}
/**
* @return the description
*/
public String getDescription() {
return description;
}
}
package containers;
import java.util.Map;
import java.util.Set;
import scala.Double;
/**
* @author Davide
*
*/
public class GeneContainer {
private String sequence = null;
private Map<String, Integer> commomTaxaCount = null;
private Set<String> homologousGenes = null;
private Map<String, Double> similarities = null;
/**
* Contain
*
* @param gene
* @param homologousGenes
*/
public GeneContainer(String sequence, Set<String> homologousGenes, Map<String, Integer> commomTaxaCount, Map<String, Double> similarities){
this.sequence = sequence;
this.homologousGenes = homologousGenes;
this.commomTaxaCount = commomTaxaCount;
this.similarities = similarities;
}
/**
* @return the sequence
*/
public String getSequence() {
return sequence;
}
/**
* @return the commomTaxaCount
*/
public Map<String, Integer> getCommomTaxaCount() {
return commomTaxaCount;
}
/**
* @return the homologousGenes
*/
public Set<String> getHomologousGenes() {
return homologousGenes;
}
/**
* @return the similarities
*/
public Map<String, Double> getSimilarities() {
return similarities;
}
// /**
// * @param homologousGenes the homologousGenes to set
// */
// public void setHomologousGenes(Set<String> homologousGenes) {
// this.homologousGenes = homologousGenes;
//
// }
}
package containers;
import java.util.HashMap;
import java.util.Map;
/**
* @author Davide
*
*/
public class ReactionContainer {
public static final String REVERSIBLE_TOKEN = "$REV$";
public static final String IRREVERSIBLE_TOKEN = "$IRREV$";
public static final String REV_TOKEN = "\\$REV\\$";
public static final String IRREV_TOKEN = "\\$IRREV\\$";
public static final String INTERIOR_COMPARTMENT = "in";
public static final String EXTERIOR_COMPARTMENT = "out";
private String originalReaction = "";
private String product = "";
private String reactant = "";
private Boolean reversible = false;
private TypeOfTransporter transportType;
private Map<String, String> properties;
private Integer reactionID = null;
private String confidenceLevel = "0";
/**
* Changes the reactant of the reaction.
*
* @param key
* @param value
*/
public void replaceReactant(String reactant) {
this.reactant = reactant;
}
/**
* Changes the product of the reaction.
*
* @param key
* @param value
*/
public void replaceProduct(String product) {
this.product = product;
}
/**
* Add property to properties map.
*
* @param key
* @param value
*/
public void addProperty(String key, String value) {
properties.put(key, value);
}
/**
* @return the properties
*/
public Map<String, String> getProperties() {
return properties;
}
/**
* Container to store information regarding a single reaction;
*
* @param product
* @param reactant
* @param reversible
*/
public ReactionContainer(String reactant, String product, boolean reversible) {
this.product = product;
this.reactant = reactant;
this.reversible = reversible;
properties = new HashMap<>();
}
/**
* @return the product
*/
public String getProduct() {
return product;
}
/**
* @return the reactant
*/
public String getReactant() {
return reactant;
}
/**
* @return the reversible
*/
public Boolean getReversible() {
return reversible;
}
/**
* @return the transportType
*/
public TypeOfTransporter getTransportType() {
return transportType;
}
/**
* @param transportType the transportType to set
*/
public void setTransportType(TypeOfTransporter transportType) {
this.transportType = transportType;
}
/**
* Get reaction in string format.
*
* @return
*/
public String getReaction() {
String reaction = reactant.concat(" ");
if(reversible)
reaction = reaction.concat(REVERSIBLE_TOKEN);
else
reaction =reaction.concat(IRREVERSIBLE_TOKEN);
reaction = reaction.concat(" ").concat(product);
return reaction;
}
/**
* @param product the product to set
*/
public void setProduct(String product) {
this.product = product;
}
/**
* @param reactant the reactant to set
*/
public void setReactant(String reactant) {
this.reactant = reactant;
}
/**
* @return the reactionID
*/
public Integer getReactionID() {
return reactionID;
}
/**
* @param reactionID the reactionID to set
*/
public void setReactionID(Integer reactionID) {
this.reactionID = reactionID;
}
/**
* @param properties the properties to set
*/
public void setProperties(Map<String, String> properties) {
this.properties = properties;
}
/**
* @return the originalReaction
*/
public String getOriginalReaction() {
return originalReaction;
}
/**
* @param originalReaction the originalReaction to set
*/
public void setOriginalReaction(String originalReaction) {
this.originalReaction = originalReaction;
}
/**
* @return the originalReaction
*/
public String getDirection() {
if(this.reversible)
return REVERSIBLE_TOKEN;
else
return IRREVERSIBLE_TOKEN;
}
/**
* @return the confidenceLevel
*/
public String getConfidenceLevel() {
return confidenceLevel;
}
/**
* @param confidenceLevel the confidenceLevel to set
*/
public void setConfidenceLevel(String confidenceLevel) {
this.confidenceLevel = confidenceLevel;
}
}
package containers;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
public class TcNumberContainer {
private Map<Integer, ReactionContainer> reactions;
private Integer id = 0;
private String superFamily;
private String family;
private String tcNumber;
/**
* Container with all information about a given transporter.
*/
public TcNumberContainer(String tcNumber){
this.tcNumber = tcNumber;
this.reactions = new HashMap<>();
}
/**
* Method to add reaction to the container.
*
* @param reaction
* @param transporter
* @param reversibility
*/
public void addReaction(ReactionContainer reaction) {
reactions.put(id, reaction);
id++;
}
/**
* Get all ids stored in the container.
*
* @return
*/
public Set<Integer> getAllReactionsIds(){
return reactions.keySet();
}
/**