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

confidence level init

parent 551ef907
Pipeline #2 failed with stages
......@@ -13,11 +13,7 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-10">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
......
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=10
org.eclipse.jdt.core.compiler.codegen.targetPlatform=9
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=10
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
......@@ -11,4 +11,4 @@ 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.release=enabled
org.eclipse.jdt.core.compiler.source=10
org.eclipse.jdt.core.compiler.source=9
......@@ -2,12 +2,12 @@
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>
<groupId>transyt</groupId>
<artifactId>transyt-scraper</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>triage</name>
<name>transyt-scraper</name>
<url>http://maven.apache.org</url>
<properties>
......@@ -31,8 +31,8 @@
<dependencies>
<dependency>
<groupId>utilities</groupId>
<artifactId>triage-utilities</artifactId>
<groupId>transyt</groupId>
<artifactId>transyt-utilities</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
......
package transmembraneDomains;
import java.util.HashMap;
import java.util.Map;
import org.biojava.nbio.core.sequence.template.AbstractSequence;
import transmembraneDomains.alpha.SearchAlphaHelices;
import transmembraneDomains.betaBarrels.PREDTMBB2;
import transmembraneDomains.betaBarrels.ReadPREDTMBB2;
public class TransmembraneDomainsSearcher {
Map<String, Integer> alphaHelices = new HashMap<>();
Map<String, Integer> betaBarrels = new HashMap<>();
public TransmembraneDomainsSearcher(Map<String, AbstractSequence<?>> genome, String email) {
SearchAlphaHelices.SearchAlphaHelices(genome, email);
// String link = PREDTMBB2.getLink(submap);
//
// System.out.println("AQUIIII -----> " + link);
//
// Map<String, Integer> results = ReadPREDTMBB2.readResults(link, identifiers);
//
// System.out.println("SubResultado ---> " + results);
// // Create two threads:
// Thread thread1 = new Thread() {
// public void run() {
// new Downloader().downloadFromConstructedUrl("http:xxxxx",
// new File("./references/word.txt"),
// new File("./references/words.txt"));
// }
// };
//
// Thread thread2 = new Thread() {
// public void run() {
// new Downloader().downloadFromConstructedUrl("http:xxxxx",
// new File("./references/word1.txt"),
// new File("./references/words1.txt"));
// }
// };
//
//
// // Start the downloads.
// thread1.start();
// thread2.start();
//
// // Wait for them both to finish
// thread1.join();
// thread2.join();
//
// // Continue the execution...
//
}
}
package transmembraneDomains.alpha;
import java.util.Map;
import org.biojava.nbio.core.sequence.template.AbstractSequence;
import pt.uminho.ceb.biosystems.merlin.bioapis.externalAPI.ebi.EbiAPI;
public class SearchAlphaHelices {
public static Map<String, Integer> SearchAlphaHelices(Map<String, AbstractSequence<?>> genome, String email){
long waitingPeriod = 300000;
Map<String, Integer> results = null;
try {
results = EbiAPI.getHelicesFromPhobius(genome, waitingPeriod, email);
}
catch (InterruptedException e) {
e.printStackTrace();
}
return results;
}
}
package betaBarrels;
package transmembraneDomains.betaBarrels;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.htmlunit.HtmlUnitDriver;
@Deprecated
public class Navigate {
public static void main(String[] args) throws InterruptedException {
......
package betaBarrels;
package transmembraneDomains.betaBarrels;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import org.biojava.nbio.core.sequence.template.AbstractSequence;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
......@@ -11,9 +14,61 @@ import org.openqa.selenium.htmlunit.HtmlUnitDriver;
public class PREDTMBB2 {
public static String getLink(String path){
private final static String LINK = "http://195.251.108.230/PRED-TMBB2/";
private final static int LIMIT = 5;
public static String getLink(Map<String, AbstractSequence<?>> sequences) throws InterruptedException{
String query = getCorrectFormatFasta(sequences);
//verificar se funciona com esta dependencia!!!!!
WebDriver driver = new HtmlUnitDriver();
// And now use this to visit the website
driver.get(LINK);
// 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
boolean go = false;
String currentUrl = null;
int errorCounter = 0;
String query = getCorrectFormatFasta(path);
while(!go && errorCounter < LIMIT){
try{
currentUrl = driver.getCurrentUrl();
go = true;
}
catch(Exception e){
errorCounter ++;
TimeUnit.SECONDS.sleep(10);
}
}
return currentUrl;
}
@Deprecated
public static String getLink2(String path){
String query = getCorrectFormatFasta2(path);
WebDriver driver = new HtmlUnitDriver();
......@@ -37,8 +92,28 @@ public class PREDTMBB2 {
return driver.getCurrentUrl();
}
/**
* Method to put the query in fasta format for submission
*
* @param sequences
* @return
*/
public static String getCorrectFormatFasta(Map<String, AbstractSequence<?>> sequences){
String query = "";
for(String sequence : sequences.keySet()){
query = query.concat(">").concat(sequence).concat("\n").concat(sequences.get(sequence).toString()).concat("\n");
}
return query;
}
public static String getCorrectFormatFasta(String path){
@Deprecated
public static String getCorrectFormatFasta2(String path){
String query = "";
......
package betaBarrels;
package transmembraneDomains.betaBarrels;
import java.io.BufferedReader;
import java.util.HashMap;
......@@ -10,9 +10,9 @@ import org.jsoup.nodes.Document;
import connection.LinkConnection;
public class ReadResults {
public class ReadPREDTMBB2 {
public static Map<String, Integer> readResults(String link){
public static Map<String, Integer> readResults(String link, Map<String, String> identifiers){
boolean go = false;
......@@ -102,7 +102,8 @@ public class ReadResults {
if (i < (lastCol)){
if(i == entry){
entryRes = text.trim();
// entryRes = text.trim();
entryRes = identifiers.get(text.replaceAll("[^A-Za-z0-9]", ""));
}
else if(i == tmNumber){
......
package betaBarrels;
package transmembraneDomains.betaBarrels;
import java.io.BufferedReader;
import java.util.Map;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import connection.LinkConnection;
public class main {
......@@ -6,36 +14,30 @@ public class main {
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");
// String link = PREDTMBB2.getLink("/Users/davidelagoa/OneDrive - Universidade do Minho/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);
// }
// }
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) {
......
Manifest-Version: 1.0
Built-By: davidelagoa
Build-Jdk: 11.0.1
Created-By: Maven Integration for Eclipse
#Generated by Maven Integration for Eclipse
#Thu Nov 08 17:49:52 WET 2018
m2e.projectLocation=/Users/davidelagoa/TranSyT/transyt-scraper
m2e.projectName=transyt-scraper
groupId=tcdb
artifactId=triage
version=0.0.1-SNAPSHOT
<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>9</source> <target>9</target>
</configuration> </plugin> -->
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<release>10</release>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>utilities</groupId>
<artifactId>triage-utilities</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<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>
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