Skip to content

Commit

Permalink
Version 1.2.0
Browse files Browse the repository at this point in the history
Luciphor's score (pep1score) incorporated
  • Loading branch information
smdb21 committed Mar 2, 2021
1 parent b95e53e commit 47c6670
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</parent>
<groupId>edu.scripps.yates</groupId>
<artifactId>luciphor_dtaselect_integrator</artifactId>
<version>1.1.0</version>
<version>1.2.0</version>
<name>luciphor_dtaselect_integrator</name>
<description>Program that takes output from luciphor and some thresholds on its scores and integrates the results into a DTASelect-filter.txt file.</description>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public class LuciphorDtaselectIntegrator {
private static final String COL_LOCAL_FLR = "localFLR";
private static final String DTA_COL_PSMID = "FileName";
private static final String DTA_COL_SEQUENCE = "Sequence";
private static final String COL_PEP1SCORE = "pep1score";

public LuciphorDtaselectIntegrator(String luciphorPath, String dtaselectPath, Double lflrThreshold,
Double gflrThreshold) {
Expand Down Expand Up @@ -91,7 +92,8 @@ private void processDTASelect(Map<String, LuciphorEntry> filteredLuciphorEntries
// get the indexes of the headers
indexByHeader = getIndexByHeader(line);
// add new columns for the original sequence and the luciphor scores
fw.write(line + "\toriginal_sequence\t" + COL_GLOBAL_FLR + "\t" + COL_LOCAL_FLR + "\n");
fw.write(line + "\toriginal_sequence\tluciphor_score\t" + COL_GLOBAL_FLR + "\t" + COL_LOCAL_FLR
+ "\n");
continue;
}
if (!isPSMLine) {
Expand All @@ -108,7 +110,7 @@ private void processDTASelect(Map<String, LuciphorEntry> filteredLuciphorEntries
final String originalSequence = split[indexByHeader.get(DTA_COL_SEQUENCE)];
final String sequenceToReplace = luciphorEntry.getFormattedPredictedSequence(originalSequence);
// if (originalSequence.equals(sequenceToReplace)) {
// fw.write(line + "\t\t\t\n");
// fw.write(line + "\t\t\t\t\n");
// continue;
// }
// create new array of values
Expand All @@ -127,8 +129,10 @@ private void processDTASelect(Map<String, LuciphorEntry> filteredLuciphorEntries
numChanged++;
newLineValues.add(originalSequence);
}
newLineValues.add(String.valueOf(luciphorEntry.getScore()));
newLineValues.add(String.valueOf(luciphorEntry.getGlobalFLR()));
newLineValues.add(String.valueOf(luciphorEntry.getLocalFLR()));

// get the new line as string
final StringBuilder newLine = new StringBuilder();
int i = 0;
Expand All @@ -144,7 +148,7 @@ private void processDTASelect(Map<String, LuciphorEntry> filteredLuciphorEntries

continue;
} else {
fw.write(line + "\t\t\t\n");
fw.write(line + "\t\t\t\t\n");
}
}
}
Expand Down Expand Up @@ -213,12 +217,24 @@ private List<LuciphorEntry> readLuciphorFile() throws IOException {
for (int numLine = 1; numLine < lines.size(); numLine++) {
final String line = lines.get(numLine);
final String[] split = line.split("\t");
if (!indexByHeader.containsKey(COL_SPEC_ID) || !indexByHeader.containsKey(COL_PRED_PEP1)) {
continue;
}
final String psmID = split[indexByHeader.get(COL_SPEC_ID)];
final String predictedSequence = split[indexByHeader.get(COL_PRED_PEP1)];
final double localFLR = Double.valueOf(split[indexByHeader.get(COL_LOCAL_FLR)]);
final double globalFLR = Double.valueOf(split[indexByHeader.get(COL_GLOBAL_FLR)]);
final LuciphorEntry luciphorEntry = new LuciphorEntry(psmID, predictedSequence, localFLR, globalFLR);

double localFLR = Double.NaN;
if (indexByHeader.containsKey(COL_LOCAL_FLR)) {
localFLR = Double.valueOf(split[indexByHeader.get(COL_LOCAL_FLR)]);
}
double globalFLR = Double.NaN;
if (indexByHeader.containsKey(COL_GLOBAL_FLR)) {
globalFLR = Double.valueOf(split[indexByHeader.get(COL_GLOBAL_FLR)]);
}
double score = Double.NaN;
if (indexByHeader.containsKey(COL_PEP1SCORE)) {
score = Double.valueOf(split[indexByHeader.get(COL_PEP1SCORE)]);
}
final LuciphorEntry luciphorEntry = new LuciphorEntry(psmID, predictedSequence, localFLR, globalFLR, score);
ret.add(luciphorEntry);
}
System.out.println(ret.size() + " PSMs read from Luciphor file");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ public class LuciphorEntry {
private final String predictedSequence;
private final double localFLR;
private final double globalFLR;
private final double score;
private static Set<Character> modifiedAAs = new THashSet<Character>();

public LuciphorEntry(String psmID, String predictedSequence, double localFLR, double globalFLR) {
public LuciphorEntry(String psmID, String predictedSequence, double localFLR, double globalFLR, double score) {
this.psmID = psmID;
this.predictedSequence = predictedSequence;
this.localFLR = localFLR;
this.globalFLR = globalFLR;
this.score = score;
findModifiedAAs(predictedSequence);
}

Expand Down Expand Up @@ -123,4 +125,8 @@ private TIntObjectMap<PTMInPeptide> getPTMsByPosition(List<PTMInPeptide> ptms) {
return ret;
}

public double getScore() {
return score;
}

}

0 comments on commit 47c6670

Please sign in to comment.