-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
create branched fragments for CUSTOM
- Loading branch information
1 parent
ac7d469
commit 2118496
Showing
2 changed files
with
96 additions
and
6 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
47 changes: 47 additions & 0 deletions
47
peptideSerumStability/src/com/github/juliomarcopineda/tests/BranchedFragmentTest.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,47 @@ | ||
package com.github.juliomarcopineda.tests; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
import com.github.juliomarcopineda.FragmentAnalyzer; | ||
import com.github.juliomarcopineda.PeptideSerumStability; | ||
import com.github.juliomarcopineda.peptide.Peptide; | ||
import com.github.juliomarcopineda.peptide.PeptideType; | ||
|
||
/** | ||
* This class prints out all the branched fragments for a peptide to check if the branched fragment builder | ||
* is working. | ||
* | ||
* @author Julio Pineda | ||
* | ||
*/ | ||
public class BranchedFragmentTest { | ||
|
||
public static void main(String[] args) { | ||
Peptide peptide = new Peptide(); | ||
|
||
String peptideSequence = "CGYEQDPWGVRYWYGCKKKKB"; | ||
PeptideType type = PeptideType.CUSTOM; | ||
double customWeight = 383.32; | ||
List<Integer> connections = Arrays.asList(4, 19); | ||
Map<Integer, List<Integer>> graph = PeptideSerumStability.createGraphStructure(peptideSequence, connections, type); | ||
|
||
peptide.setSequence(peptideSequence); | ||
peptide.setType(type); | ||
peptide.setConnections(connections); | ||
peptide.setCustomWeight(customWeight); | ||
peptide.setGraph(graph); | ||
|
||
FragmentAnalyzer analyzer = new FragmentAnalyzer(peptide); | ||
analyzer.findAllFragments() | ||
.measureAllFragmentWeights(); | ||
|
||
analyzer.getFragmentWeights() | ||
.keySet() | ||
.stream() | ||
.filter(s -> s.contains("#")) | ||
.forEach(System.out::println); | ||
} | ||
|
||
} |