Skip to content

Commit ad87667

Browse files
Luis Francisco Hernández SánchezLuis Francisco Hernández Sánchez
authored andcommitted
MODget tool created to get list of proteins associated with a type of Post Translational Modification.
1 parent c9ca992 commit ad87667

24 files changed

+555
-58
lines changed

Java/PathwayQuery/nbactions.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<goal>org.codehaus.mojo:exec-maven-plugin:1.2.1:exec</goal>
1111
</goals>
1212
<properties>
13-
<exec.args>-classpath %classpath no.uib.pathwayquery.ProteinGraphExtractor</exec.args>
13+
<exec.args>-classpath %classpath no.uib.tools.MODGet -m 00064 -o ./output.txt</exec.args>
1414
<exec.executable>java</exec.executable>
1515
</properties>
1616
</action>
@@ -24,7 +24,7 @@
2424
<goal>org.codehaus.mojo:exec-maven-plugin:1.2.1:exec</goal>
2525
</goals>
2626
<properties>
27-
<exec.args>-Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address} -classpath %classpath no.uib.pathwayquery.ProteinGraphExtractor</exec.args>
27+
<exec.args>-Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address} -classpath %classpath no.uib.tools.MODGet -m 00064 -o ./output.txt</exec.args>
2828
<exec.executable>java</exec.executable>
2929
<jpda.listen>true</jpda.listen>
3030
</properties>
@@ -39,7 +39,7 @@
3939
<goal>org.codehaus.mojo:exec-maven-plugin:1.2.1:exec</goal>
4040
</goals>
4141
<properties>
42-
<exec.args>-classpath %classpath no.uib.pathwayquery.ProteinGraphExtractor</exec.args>
42+
<exec.args>-classpath %classpath no.uib.tools.MODGet -m 00064 -o ./output.txt</exec.args>
4343
<exec.executable>java</exec.executable>
4444
</properties>
4545
</action>

Java/PathwayQuery/pom.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,18 @@
5959
<artifactId>trove4j</artifactId>
6060
<version>3.0.3</version>
6161
</dependency>
62+
63+
<dependency>
64+
<groupId>commons-cli</groupId>
65+
<artifactId>commons-cli</artifactId>
66+
<version>1.3.1</version>
67+
</dependency>
68+
69+
<dependency>
70+
<groupId>org.apache.httpcomponents</groupId>
71+
<artifactId>httpclient</artifactId>
72+
<version>4.1.1</version>
73+
</dependency>
6274
</dependencies>
6375
<build>
6476
<plugins>

Java/PathwayQuery/src/main/java/no/uib/DB/ConnectionNeo4j.java

Lines changed: 0 additions & 18 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package no.uib.db;
2+
3+
import org.neo4j.driver.v1.Driver;
4+
5+
/**
6+
* @author Luis Francisco Hernández Sánchez
7+
*/
8+
public class ConnectionNeo4j {
9+
10+
public static Driver driver;
11+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* Copyright 2017 Luis Francisco Hernández Sánchez.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package no.uib.db;
17+
18+
/**
19+
*
20+
* @author Luis Francisco Hernández Sánchez
21+
*/
22+
public class CypherQueries {
23+
24+
public enum Queries {
25+
getProteinsByPsiMod {
26+
public String toString() {
27+
return "MATCH (re:ReferenceEntity)<-[:referenceEntity]-(ewas:EntityWithAccessionedSequence)-[:hasModifiedResidue]->(mr)-[:psiMod]->(mod)\n"
28+
+ "WHERE mod.identifier IN {modList} AND ewas.speciesName = \"Homo sapiens\"\n"
29+
+ "RETURN DISTINCT re.identifier as protein";
30+
}
31+
},
32+
getCountAllPTMs {
33+
public String toString() {
34+
return "MATCH path = (re:ReferenceEntity)<-[:referenceEntity]-(ewas:EntityWithAccessionedSequence)-[:hasModifiedResidue]->(mr)-[:psiMod]->(mod) \n"
35+
+ "WHERE ewas.speciesName = \"Homo sapiens\" RETURN count(DISTINCT re), mod.identifier, mod.name";
36+
}
37+
}
38+
}
39+
}

Java/PathwayQuery/src/main/java/no/uib/DB/ReactomeAccess.java renamed to Java/PathwayQuery/src/main/java/no/uib/db/ReactomeAccess.java

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package no.uib.DB;
1+
package no.uib.db;
22

33
import java.io.BufferedReader;
44
import java.io.File;
@@ -7,18 +7,20 @@
77
import java.io.FileWriter;
88
import java.io.IOException;
99
import java.io.UnsupportedEncodingException;
10+
import java.util.ArrayList;
1011
import java.util.List;
1112
import java.util.logging.Level;
1213
import java.util.logging.Logger;
13-
import no.uib.Model.Pair;
14-
import no.uib.Model.Reaction;
14+
import no.uib.model.Pair;
15+
import no.uib.model.Reaction;
1516
import no.uib.pathwayquery.Conf;
1617
import static no.uib.pathwayquery.ProteinGraphExtractor.G;
1718
import org.neo4j.driver.v1.Record;
1819
import org.neo4j.driver.v1.Session;
1920
import org.neo4j.driver.v1.StatementResult;
2021
import org.neo4j.driver.v1.Transaction;
2122
import org.neo4j.driver.v1.Values;
23+
import no.uib.db.CypherQueries.Queries;
2224

2325
/**
2426
*
@@ -562,4 +564,22 @@ public static List<Record> getVerticesByType(Conf.EntityType t) {
562564
session.close();
563565
return result.list();
564566
}
567+
568+
public static List<String> getProteinListByMods(List<String> mods) {
569+
570+
String query = CypherQueries.Queries.getProteinsByPsiMod.toString();
571+
mods.replaceAll(mod -> "\"" + mod + "\"");
572+
query = query.replace("{modList}", mods.toString());
573+
List<String> result = new ArrayList<>();
574+
575+
Session session = ConnectionNeo4j.driver.session();
576+
StatementResult queryResult = session.run(query);
577+
578+
for (Record record : queryResult.list()) {
579+
result.add(record.get("protein").asString());
580+
}
581+
582+
session.close();
583+
return result;
584+
}
565585
}

Java/PathwayQuery/src/main/java/no/uib/DB/UniprotAccess.java renamed to Java/PathwayQuery/src/main/java/no/uib/db/UniprotAccess.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package no.uib.DB;
1+
package no.uib.db;
22

33
import java.io.FileWriter;
44
import java.io.InputStream;

Java/PathwayQuery/src/main/java/no/uib/Model/AdjacentNeighbor.java renamed to Java/PathwayQuery/src/main/java/no/uib/model/AdjacentNeighbor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package no.uib.Model;
1+
package no.uib.model;
22

33
/**
44
*

Java/PathwayQuery/src/main/java/no/uib/Model/BiMapByteString.java renamed to Java/PathwayQuery/src/main/java/no/uib/model/BiMapByteString.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package no.uib.Model;
1+
package no.uib.model;
22

33
import gnu.trove.map.hash.TObjectByteHashMap;
44

Java/PathwayQuery/src/main/java/no/uib/Model/BiMapByteToByteArray.java renamed to Java/PathwayQuery/src/main/java/no/uib/model/BiMapByteToByteArray.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package no.uib.Model;
1+
package no.uib.model;
22

33
import gnu.trove.map.hash.TObjectByteHashMap;
44
import java.io.UnsupportedEncodingException;

0 commit comments

Comments
 (0)