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

initial commit

parents
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>triage</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>
eclipse.preferences.version=1
encoding//src/main/java=UTF-8
encoding//src/test/java=UTF-8
encoding/<project>=UTF-8
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=9
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=9
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=9
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>tcdb</groupId>
<artifactId>triage</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>triage</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<source>1.9</source>
<target>1.9</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.17</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.xmlbeans/xmlbeans -->
<dependency>
<groupId>org.apache.xmlbeans</groupId>
<artifactId>xmlbeans</artifactId>
<version>2.6.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.17</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml-schemas -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>3.17</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.dom4j/dom4j -->
<dependency>
<groupId>org.dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>2.1.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.jsoup/jsoup -->
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.11.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.github.cliftonlabs/json-simple -->
<dependency>
<groupId>com.github.cliftonlabs</groupId>
<artifactId>json-simple</artifactId>
<version>3.0.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple -->
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-server -->
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-server</artifactId>
<version>3.9.1</version>
</dependency>
</dependencies>
</project>
package betaBarrels;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.htmlunit.HtmlUnitDriver;
public class Navigate {
public static void main(String[] args) throws InterruptedException {
// Create a new instance of the html unit driver
// Notice that the remainder of the code relies on the interface,
// not the implementation.
WebDriver driver = new HtmlUnitDriver();
// And now use this to visit Google
driver.get("http://195.251.108.230/PRED-TMBB2/");
// Find the text input element by its name
WebElement element = driver.findElement(By.name("sequence"));
// Enter something to search for
element.sendKeys(">2K4T_A Chain A, Solution Structure Of Human Vdac-1 In Ldao Micelles\nMAVPPTYADLGKSARDVFTKGYGFGLIKLDLKTKSENGLEFTSSGSANTETTKVTGSLETKYRWTEYGLTFTEKWNTDNTLGTEITVEDQLARGLKLTFDSSFSPNTGKKNAKIKTGYKREHINLGCDMDFDIAGPSIRGALVLGYEGWLAGYQMNFETAKSRVTQSNFAVGYKTDEFQLHTNVNDGTEFGGSIYQKVNKKLETAVNLAWTAGNSNTRFGIAAKYQIDPDACFSAKVNNSSLIGLGYTQTLKPGIKLTLSALLDGKNVNAGGHKLGLGLEFQALEHHHHHH\n"+
">5JDP_A Chain A, E73v Mutant Of The Human Voltage-dependent Anion Channel\nSAVPPTYADLGKSARDVFTKGYGFGLIKLDLKTKSENGLEFTSSGSANTETTKVTGSLETKYRWTEYGLTFTVKWNTDNTLGTEITVEDQLARGLKLTFDSSFSPNTGKKNAKIKTGYKREHINLGCDMDFDIAGPSIRGALVLGYEGWLAGYQMNFETAKSRVTQSNFAVGYKTDEFQLHTNVNDGTEFGGSIYQKVNKKLETAVNLAWTAGNSNTRFGIAAKYQIDPDACFSAKVNNSSLIGLGYTQTLKPGIKLTLSALLDGKNVNAGGHKLGLGLEFQARS\n"+
">2JK4_A Chain A, Structure Of The Human Voltage-Dependent Anion Channel\nMRGSAVPPTYADLGKSARDVFTKGYGFGLIKLDLKTKSENGLEFTSSGSANTETTKVTGSLETKYRWTEYGLTFTEKWNTDNTLGTEITVEDQLARGLKLTFDSSFSPNTGKKNAKIKTGYKREHINLGCDMDFDIAGPSIRGALVLGYEGWLAGYQMNFETAKSRVTQSNFAVGYKTDEFQLHTNVNDGTEFGGSIYQKVNKKLETAVNLAWTAGNSNTRFGIAAKYQIDPDACFSAKVNNSSLIGLGYTQTLKPGIKLTLSALLDGKNVNAGGHKLGLGLEFQARSHHHHHH\n"+
">5XDO_A Chain A, Crystal Structure Of Human Voltage-dependent Anion Channel 1 (hvdac1) In C222 Space Group\nMRGSHHHHHHGSMAVPPTYADLGKSARDVFTKGYGFGLIKLDLKTKSENGLEFTSSGSANTETTKVTGSLETKYRWTEYGLTFTEKWNTDNTLGTEITVEDQLARGLKLTFDSSFSPNTGKKNAKIKTGYKREHINLGCDMDFDIAGPSIRGALVLGYEGWLAGYQMNFETAKSRVTQSNFAVGYKTDEFQLHTNVNDGTEFGGSIYQKVNKKLETAVNLAWTAGNSNTRFGIAAKYQIDPDACFSAKVNNSSLIGLGYTQTLKPGIKLTLSALLDGKNVNAGGHKLGLGLEFQA\n");
System.out.println(driver.getCurrentUrl());
element = driver.findElement(By.xpath("/html/body/form/input[2]"));
element.click();
System.out.println(element.isSelected());
element = driver.findElement(By.xpath("/html/body/form/input[3]"));
element.click();
System.out.println(element.isSelected());
// Now submit the form. WebDriver will find the form for us from the element
// element.submit();
// driver.findElement(By.tagName("Run prediction")).click();
WebElement element2 = driver.findElement(By.xpath("/html/body/form/input[7]"));
element2.click();
// TimeUnit.SECONDS.sleep();
System.out.println(driver.getCurrentUrl());
// System.out.println(driver.getPageSource());
// System.out.println(driver.getCurrentUrl());
// Check the title of the page
System.out.println("Page title is: " + driver.getTitle());
}
}
package betaBarrels;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.htmlunit.HtmlUnitDriver;
public class PREDTMBB2 {
public static String getLink(String path){
String query = getCorrectFormatFasta(path);
WebDriver driver = new HtmlUnitDriver();
// And now use this to visit Google
driver.get("http://195.251.108.230/PRED-TMBB2/");
// Find the text input element by its name
WebElement element = driver.findElement(By.name("sequence")); //text area
element.sendKeys(query);
element = driver.findElement(By.xpath("/html/body/form/input[2]")); //check prediction for batch
element.click();
element = driver.findElement(By.xpath("/html/body/form/input[3]")); //uncheck Signal peptide predictions
element.click();
element = driver.findElement(By.xpath("/html/body/form/input[7]")); //run prediction
element.click();
// TimeUnit.SECONDS.sleep(); see if necessary
return driver.getCurrentUrl();
}
public static String getCorrectFormatFasta(String path){
String query = "";
FileReader file;
try {
file = new FileReader(path);
BufferedReader br = new BufferedReader(file);
String sCurrentLine;
while ((sCurrentLine = br.readLine()) != null) {
if(sCurrentLine.contains(">"))
query = query.concat("\n").concat(sCurrentLine).concat("\n");
else
query = query.concat(sCurrentLine);
}
br.close();
}
catch (FileNotFoundException e) {
System.out.println("FILE NOT FOUND");
e.printStackTrace();
}
catch (Exception e) {
e.printStackTrace();
}
return query;
}
}
package betaBarrels;
import java.io.BufferedReader;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import tcdb.connection.LinkConnection;
public class ReadResults {
public static Map<String, Integer> readResults(String link){
boolean go = false;
Map<String, Integer> results = new HashMap<>();
try {
while(!go){
go = true;
LinkConnection conn = new LinkConnection();
conn.getCodeConnection(link);
BufferedReader in = conn.getPage();
if(in != null){
String html;
Document doc;
String text;
int entry = -1, length = -1, sp = -1, score = -1, ompdbFamily = -1, tmNumber = -1, reliability = -1, image = -1;
String entryRes = "";
int tmNumberRes = 0;
boolean header = true;
int i = 0, lastCol = 0;
while ((html = in.readLine()) != null){
doc = Jsoup.parse(html);
text = doc.body().text().trim();
System.out.println(text + " >>>>>>>>> " + i);
if(text.contains("This page will be automatically reloaded")){
go = false;
}
else{
if(header){
if(text.equalsIgnoreCase("Entry")){
entry = i;
i++;
}
else if(text.equalsIgnoreCase("Length")){
length = i;
i++;
}
else if(text.equalsIgnoreCase("SP")){
sp = i;
i++;
}
else if(text.contains("β-score")){
score = i;
i++;
}
else if(text.equalsIgnoreCase("OMPdb family")){
ompdbFamily = i;
i++;
}
else if(text.equalsIgnoreCase("#TM")){
tmNumber = i;
i++;
}
else if(text.equalsIgnoreCase("Reliability")){
reliability = i;
i++;
}
else if(text.equalsIgnoreCase("Image")){
image = i;
lastCol = i;
i = -2;
header = false;
// System.out.println(entry + " " + length + " " + sp + " " + score + " " + ompdbFamily + " " + tmNumber + " " + reliability + " " + image );
}
}
else{
if (i < (lastCol)){
if(i == entry){
entryRes = text.trim();
}
else if(i == tmNumber){
if(text.contains("--"))
tmNumberRes = 0;
else
tmNumberRes = Integer.parseInt(text);
}
i++;
}
else{
results.put(entryRes, tmNumberRes);
i = -2;
}
}
}
}
if(!go){
System.out.println("Waiting...");
TimeUnit.MINUTES.sleep(1);
}
}
in.close();
}
}
catch (Exception e) {
e.printStackTrace();
}
return results;
}
}
package betaBarrels;
import java.util.HashMap;
import java.util.Map;
public class main {
public static void main(String[] args) {
try {
String word = "rg2162.;47/fjds_ADSDpre";
word = word.replaceAll("[^A-Za-z0-9]", "");
System.out.println(word);
//
// Map<String, Integer> res = ReadResults.readResults("http://195.251.108.230/PRED-TMBB2/index.php?id=2yyvNhmDuu");
//
// System.out.println("RESULTADOS ---> " + res);
// String link = PREDTMBB2.getLink("/Users/davidelagoa/Desktop/UMinho/Tese/Beta barrels/search.faa");
// System.out.println(link);
// LinkConnection conn = new LinkConnection();
//
// if(conn.getCodeConnection("http://195.251.108.230/PRED-TMBB2/index.php?id=VebVC1VSEi") == 200){
// BufferedReader in = conn.getPage();
//
// String html;
//
// while ((html = in.readLine()) != null){
//
// Document doc = Jsoup.parse(html);
// String text = doc.body().text().trim();
//
// System.out.println(text);
// }
// }
} catch (Exception e) {
e.printStackTrace();
}
}
}
package tcdb.capsules;
import java.util.HashMap;
import java.util.Map;
import tcdb.tcdbTransportTypesRetriever.TypeOfTransporter;
/**
* @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\\$";
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;
}