private DefaultMutableTreeNode ProListToEquivTree(ArrayList<Protein> proList, String name) { DefaultMutableTreeNode root, child; int size = 0; PeptideProteinNameSet pps = ProteinListToPPNSet(proList); root = new DefaultMutableTreeNode(pps); HashSet<String> usedProteins = new HashSet<String>(); for (Protein p : proList) { if (!usedProteins.contains(p.getName())) { if (p.getEquivalent().size() > 0) { ArrayList<Protein> equivList = new ArrayList<Protein>(); equivList.add(p); equivList.addAll(p.getEquivalent()); PeptideProteinNameSet ppsEquiv = ProteinListToPPNSet(equivList); ppsEquiv.setName(p.getName() + " Group (" + equivList.size() + ")"); child = new DefaultMutableTreeNode(ppsEquiv); size++; for (Protein ps : equivList) { child.add(new DefaultMutableTreeNode(ps)); usedProteins.add(ps.getName()); } root.add(child); } else { root.add(new DefaultMutableTreeNode(p)); usedProteins.add(p.getName()); size++; } } } pps.setName(name + " (" + size + ")"); return root; }
private DefaultMutableTreeNode getParsimonyTree(ExperimentPanel expPanel) { DefaultMutableTreeNode root = new DefaultMutableTreeNode(getParsimonyListPanel(expPanel)); DefaultMutableTreeNode child; // Discrete PeptideProteinNameSet pps = ProteinListToPPNSet(getDiscretes()); pps.setName("Discrete (" + getDiscretes().size() + ")"); child = new DefaultMutableTreeNode(pps); for (Protein p : getDiscretes()) { child.add(new DefaultMutableTreeNode(p)); } root.add(child); // Differentiable pps = ProteinListToPPNSet(getDifferentiables()); pps.setName("Differentiable (" + getDifferentiables().size() + ")"); child = new DefaultMutableTreeNode(pps); for (Protein p : getDifferentiables()) { child.add(new DefaultMutableTreeNode(p)); } root.add(child); // Superset child = ProListToEquivTree(getSupersets(), "Superset"); root.add(child); // Subsumable child = ProListToEquivTree(getSubsumables(), "Subsumable"); root.add(child); // Subset child = ProListToEquivTree(getSubsets(), "Subset"); root.add(child); // Equivalent child = ProListToEquivTree(getEquivalents(), "Equivalent"); root.add(child); return root; }
private DefaultMutableTreeNode getPeptideTree(ExperimentPanel expPanel, boolean useListPanel) { DefaultMutableTreeNode root; if (useListPanel) { root = new DefaultMutableTreeNode(getPeptideListPanel(expPanel)); } else { PeptideProteinNameSet pps = getPeptideProteinNameSet(); pps.setName("Peptides (" + pps.getPeptides().size() + ")"); root = new DefaultMutableTreeNode(pps); } DefaultMutableTreeNode child; ArrayList<Peptide> sortPeptides = new ArrayList<Peptide>(); sortPeptides.addAll(minPeptides.values()); Collections.sort(sortPeptides); for (Peptide pg : sortPeptides) { // child = pg.getTree(); child = new DefaultMutableTreeNode(pg); root.add(child); } return root; }
private DefaultMutableTreeNode getProteinTree(ExperimentPanel expPanel, boolean useListPanel) { DefaultMutableTreeNode root; if (useListPanel) { ProteinListPanel plp = getProteinListPanel(expPanel); root = new DefaultMutableTreeNode(plp); } else { PeptideProteinNameSet pps = getPeptideProteinNameSet(); pps.setName("Proteins (" + pps.getProteins().size() + ")"); root = new DefaultMutableTreeNode(pps); } DefaultMutableTreeNode child; ArrayList<Protein> sortProteins = new ArrayList<Protein>(); sortProteins.addAll(minProteins.values()); Collections.sort(sortProteins); for (Protein prot : sortProteins) { // child = prot.getTree(expPanel); child = new DefaultMutableTreeNode(prot); root.add(child); } return root; }