Skip to content
This repository was archived by the owner on Aug 3, 2019. It is now read-only.

Commit 52d7dc5

Browse files
Luis Francisco Hernández SánchezLuis Francisco Hernández Sánchez
authored andcommitted
Added distinction between get accession and get isoform.
1 parent a720ee3 commit 52d7dc5

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

src/no/uib/pap/model/Pathway.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ public String getEntitiesFoundString(InputType inputType) {
200200
case PROTEOFORMS:
201201
str.append("\"" + ProteoformFormat.SIMPLE.getString(proteoform) + "\"");
202202
default:
203-
str.append(proteoform.getUniProtAcc());
203+
str.append(proteoform.getUniProtAccWithIsoform());
204204
}
205205

206206
first = false;

src/no/uib/pap/model/Proteoform.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import java.io.Serializable;
44
import java.util.*;
55

6-
import com.google.common.collect.TreeMultimap;
76
import org.apache.commons.lang3.tuple.MutablePair;
87
import org.apache.commons.lang3.tuple.Pair;
98

@@ -37,6 +36,14 @@ public Proteoform(String uniProtAcc, List<Pair<String, Long>> ptms) {
3736
}
3837

3938
public String getUniProtAcc() {
39+
if (UniProtAcc.contains("-")) {
40+
return UniProtAcc.substring(0, UniProtAcc.indexOf("-"));
41+
} else {
42+
return UniProtAcc;
43+
}
44+
}
45+
46+
public String getUniProtAccWithIsoform() {
4047
return UniProtAcc;
4148
}
4249

@@ -134,11 +141,10 @@ public void setSourceSnpSet(Set<Snp> sourceSnpSet) {
134141

135142
@Override
136143
public String toString() {
137-
return this.getUniProtAcc();
144+
return this.getUniProtAccWithIsoform();
138145
}
139146

140147
public String toString(ProteoformFormat format) {
141-
142148
if (format != null) {
143149
return format.getString(this);
144150
} else {

src/no/uib/pap/model/ProteoformFormat.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import java.util.regex.Pattern;
77

88
import com.google.common.base.CharMatcher;
9-
import com.google.common.collect.Multimap;
109
import org.apache.commons.lang3.tuple.Pair;
1110

1211
/**
@@ -23,7 +22,7 @@ public boolean matches(String str) {
2322
@Override
2423
public String getString(Proteoform proteoform) {
2524
StringBuilder str = new StringBuilder();
26-
str.append(proteoform.getUniProtAcc() + ";");
25+
str.append(proteoform.getUniProtAccWithIsoform() + ";");
2726

2827
int cont = 0;
2928
for (Map.Entry<String, Long> ptm : proteoform.getPtms()) {
@@ -148,7 +147,7 @@ public String getString(Proteoform proteoform) {
148147
StringBuilder str = new StringBuilder();
149148

150149
// Print the protein accession
151-
str.append("UniProtKB:" + proteoform.getUniProtAcc());
150+
str.append("UniProtKB:" + proteoform.getUniProtAccWithIsoform());
152151

153152
// Print the subsequence range
154153
Long start = proteoform.getStartCoordinate();
@@ -393,13 +392,16 @@ private String getResidue(String mod) {
393392

394393
},
395394
NEO4J {
395+
396+
// Example: """Q15303-2""","[""00048:1046"",""00048:1178"",""00048:1232""]"
397+
396398
@Override
397399
public String getString(Proteoform proteoform) {
398400
try {
399401
StringBuilder str = new StringBuilder();
400402
boolean isFirst = true;
401403

402-
str.append("\"\"\"" + proteoform.getUniProtAcc() + "\"\"\"");
404+
str.append("\"\"\"" + proteoform.getUniProtAccWithIsoform() + "\"\"\"");
403405
str.append(",");
404406
if (proteoform.getPtms().size() > 0) {
405407
str.append("\"");

0 commit comments

Comments
 (0)