-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New Peptide decoy generation options for Peptide utility module
Two dimensional q-value calculation for fragments Bump to 3.0.0
- Loading branch information
1 parent
83c1a52
commit 665058e
Showing
12 changed files
with
435 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
src/edu/umich/andykong/ptmshepherd/core/AAMutationRules.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package edu.umich.andykong.ptmshepherd.core; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
public class AAMutationRules { | ||
public static Map<Character, Character> mutateFrom = new HashMap<>(); | ||
|
||
// These rules are taken from DIA-NN | ||
static { | ||
mutateFrom.put('G', 'L'); | ||
mutateFrom.put('A', 'L'); | ||
mutateFrom.put('V', 'L'); | ||
mutateFrom.put('L', 'V'); | ||
mutateFrom.put('I', 'V'); | ||
mutateFrom.put('F', 'L'); | ||
mutateFrom.put('M', 'L'); | ||
mutateFrom.put('P', 'L'); | ||
mutateFrom.put('W', 'L'); | ||
mutateFrom.put('S', 'T'); | ||
mutateFrom.put('C', 'S'); | ||
mutateFrom.put('T', 'S'); | ||
mutateFrom.put('Y', 'S'); | ||
mutateFrom.put('H', 'S'); | ||
mutateFrom.put('K', 'L'); | ||
mutateFrom.put('R', 'L'); | ||
mutateFrom.put('Q', 'N'); | ||
mutateFrom.put('E', 'D'); | ||
mutateFrom.put('N', 'Q'); | ||
mutateFrom.put('D', 'E'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
96 changes: 96 additions & 0 deletions
96
src/edu/umich/andykong/ptmshepherd/iterativelocalization/TwoDimJointCMF.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
package edu.umich.andykong.ptmshepherd.iterativelocalization; | ||
|
||
public class TwoDimJointCMF { | ||
double probGrid[][]; | ||
int countGrid[][]; | ||
int nVals; | ||
TwoDimJointPMF PMF; | ||
boolean direction1; | ||
boolean direction2; | ||
|
||
public TwoDimJointCMF(TwoDimJointPMF PMF, boolean direction1, boolean direction2) { | ||
this.probGrid = new double[PMF.getXDim()][PMF.getYDim()]; | ||
this.countGrid = new int[PMF.getXDim()][PMF.getYDim()]; | ||
this.PMF = PMF; | ||
this.nVals = PMF.nVals; | ||
this.direction1 = direction1; | ||
this.direction2 = direction2; | ||
|
||
calculateCMF(); | ||
} | ||
|
||
private void calculateCMF() { | ||
// First two loops are to calculate this for every value | ||
for (int i1 = 0; i1 < getXDim(); i1++) { | ||
for (int j1 = 0; j1 < getYDim(); j1++) { | ||
int count = 0; // Number of vals to be integrated | ||
// These two loops are the values that will be integrated | ||
for (int i2 = 0; i2 <= i1; i2++) { // Sum values up to X (intensity) | ||
for (int j2 = j1; j2 >= 0; j2--) { // Sum values great than Y (mass error) | ||
count++; | ||
} | ||
} | ||
this.countGrid[i1][j1] = count; | ||
this.probGrid[i1][j1] = (double) count / (double) this.nVals; | ||
} | ||
} | ||
} | ||
|
||
public int getXDim() { | ||
return this.countGrid.length; | ||
} | ||
|
||
public int getYDim() { | ||
return this.countGrid[0].length; | ||
} | ||
|
||
public String toString() { | ||
StringBuffer sb = new StringBuffer(); | ||
|
||
sb.append("count grid"); | ||
for (int j = 0; j < getXDim(); j++) { | ||
sb.append(j + ".\t"); | ||
} | ||
sb.append("\n"); | ||
for (int i = 0; i < getYDim(); i++) { | ||
sb.append(i + ".\t"); | ||
for (int j = 0; j < getXDim(); j++) | ||
sb.append(String.format("%d\t", this.countGrid[j][i])); | ||
sb.append("\n"); | ||
} | ||
sb.append("\t"); | ||
sb.append("\n"); | ||
|
||
sb.append("prob grid\n"); | ||
for (int i = 0; i < getYDim(); i++) { | ||
sb.append(i + ".\t"); | ||
for (int j = 0; j < getXDim(); j++) | ||
sb.append(String.format("%.2f\t", this.probGrid[j][i])); | ||
sb.append("\n"); | ||
} | ||
sb.append("\t"); | ||
for (int j = 0; j < getXDim(); j++) { | ||
sb.append(j + ".\t\t"); | ||
} | ||
sb.append("\n"); | ||
return sb.toString(); | ||
} | ||
|
||
|
||
public static void main(String args[]) { | ||
TwoDimJointPMF tmpPMF = new TwoDimJointPMF(2,4,true,true); | ||
tmpPMF.addVal(0, 0); | ||
tmpPMF.addVal(0, 1); | ||
tmpPMF.addVal(0, 2); | ||
tmpPMF.addVal(0, 3); | ||
tmpPMF.addVal(1, 0); | ||
tmpPMF.addVal(1, 1); | ||
tmpPMF.addVal(1, 2); | ||
tmpPMF.addVal(1, 3); | ||
|
||
TwoDimJointCMF tmpCMF = new TwoDimJointCMF(tmpPMF, true, true); | ||
|
||
System.out.println(tmpCMF); | ||
|
||
} | ||
} |
Oops, something went wrong.