diff --git a/xtandempipeline/src/fr/inra/pappso/xtandempipeline/ui/results/Peptide_Details_item.java b/xtandempipeline/src/fr/inra/pappso/xtandempipeline/ui/results/Peptide_Details_item.java index b110cc575aad9d95356a1e82cbb1038657dca2fc..0047c0aeefe67cd4c845d7854e814d66d349b826 100644 --- a/xtandempipeline/src/fr/inra/pappso/xtandempipeline/ui/results/Peptide_Details_item.java +++ b/xtandempipeline/src/fr/inra/pappso/xtandempipeline/ui/results/Peptide_Details_item.java @@ -28,19 +28,14 @@ import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Text; import org.eclipse.swt.widgets.Widget; -import fr.inra.moulon.proticport.model.Controller; -import fr.inra.moulon.proticport.model.entities.Spectrum; -import fr.inra.moulon.proticport.model.exceptions.ProticDataNotFoundException; import fr.inra.moulon.svgutils.svgspectrum.SvgAaMod; import fr.inra.moulon.svgutils.svgspectrum.SvgAaModPhospho; import fr.inra.moulon.svgutils.svgspectrum.SvgPeptideSequence; import fr.inra.moulon.svgutils.svgspectrum.SvgSpectrumDocument; -import fr.inra.pappso.xtandempipeline.XtandemPipelineSession; import fr.inra.pappso.xtandempipeline.MsException.MSMSException; import fr.inra.pappso.xtandempipeline.MsException.StopException; import fr.inra.pappso.xtandempipeline.class_msms.Modifs; import fr.inra.pappso.xtandempipeline.class_msms.Peptide; -import fr.inra.pappso.xtandempipeline.class_msms.IdentificationDataFile.IdentificationDataFile; public class Peptide_Details_item extends CTabItem { diff --git a/xtandempipeline/src/fr/inra/pappso/xtandempipeline/ui/results/Protein_List_item.java b/xtandempipeline/src/fr/inra/pappso/xtandempipeline/ui/results/Protein_List_item.java index 94e37d6aae2fad2236b07dac9ac437aecedb0233..14f2742073febc68963065ba6ddc34e28318ef5a 100644 --- a/xtandempipeline/src/fr/inra/pappso/xtandempipeline/ui/results/Protein_List_item.java +++ b/xtandempipeline/src/fr/inra/pappso/xtandempipeline/ui/results/Protein_List_item.java @@ -44,8 +44,9 @@ public class Protein_List_item extends CTabItem { private Table table; private Label description; - - private static final Logger logger = Logger.getLogger(Protein_List_item.class); + + private static final Logger logger = Logger + .getLogger(Protein_List_item.class); public Protein_List_item(window_base parent, int posi) { super(parent.getFolder(), SWT.CLOSE, posi); @@ -57,7 +58,7 @@ public class Protein_List_item extends CTabItem { for (Button but : buttons) but.setEnabled(false); } - + @Override protected void finalize() throws Throwable { logger.debug("finalize Protein_List_item"); @@ -128,10 +129,12 @@ public class Protein_List_item extends CTabItem { public void widgetSelected(SelectionEvent e) { logger.debug("selected"); TableItem item = (TableItem) e.item; - HashSampleScanSetProt m = (HashSampleScanSetProt) item.getData("match"); + HashSampleScanSetProt m = (HashSampleScanSetProt) item + .getData("match"); SubGroup sg = (SubGroup) item.getData("subgroup"); if (e.detail == SWT.CHECK) { - Protein_List_item.this.changeProtValidity(sg,item.getChecked()); + Protein_List_item.this.changeProtValidity(sg, + item.getChecked()); logger.debug("Change prot validité"); action_time = e.time; } else if (e.time != action_time) { @@ -147,34 +150,38 @@ public class Protein_List_item extends CTabItem { return compo; } - protected void changeProtValidity(SubGroup sg,boolean change) { - // On change la validité des peptides associé à chaque protéine du sous-groupe + protected void changeProtValidity(SubGroup sg, boolean change) { + // On change la validité des peptides associé à chaque protéine du + // sous-groupe for (TableItem it : table.getItems()) { if (it.getData("subgroup").equals(sg)) { it.setChecked(change); - HashSampleScanSetProt hp = (HashSampleScanSetProt) it.getData("match"); - if(change==false){ - //unvalidate + HashSampleScanSetProt hp = (HashSampleScanSetProt) it + .getData("match"); + if (change == false) { + // unvalidate ArrayList<Peptide> peptidechecked = new ArrayList<Peptide>(); - for(HashSampleScan hash : hp){ - for(Peptide pep : hp.getMatch().getAllValidPeptideToHashSampleScan(hash)){ + for (HashSampleScan hash : hp) { + for (Peptide pep : hp.getMatch() + .getAllValidPeptideToHashSampleScan(hash)) { pep.setValidate(false); peptidechecked.add(pep); } } - it.setData("peptide_checked",peptidechecked); - } - else{ - //validate - ArrayList<Peptide> peptidechecked = (ArrayList<Peptide>) it.getData("peptide_checked"); - if(peptidechecked!=null){ - for(Peptide pep : peptidechecked){ - pep.setValidate(true); + it.setData("peptide_checked", peptidechecked); + } else { + // validate + ArrayList<?> objectList = (ArrayList<?>) it + .getData("peptide_checked"); + if (objectList != null) { + for (Object objectPeptide : objectList) { + ((Peptide) objectPeptide).setValidate(true); } } } - //Si analyse non phospho, on peux aussi modifier l'etat du match pour affichage - if(!this.data_type.getIs_phosphopeptide()){ + // Si analyse non phospho, on peux aussi modifier l'etat du + // match pour affichage + if (!this.data_type.getIs_phosphopeptide()) { hp.getMatch().setIsvalidate(change); } } @@ -205,20 +212,26 @@ public class Protein_List_item extends CTabItem { ident.view_result(swt); // on mets à jour le texte du shell if (data_type.getIs_invididual()) - this.setText(ident.get_samples().getMsRunList().get(0).getSampleName()); + this.setText(ident.get_samples().getMsRunList().get(0) + .getSampleName()); else if (!data_type.getIs_phosphopeptide()) this.setText("Combine results"); else this.setText("Phosphosite results"); // on rempli la description - if(this.data_type.getIs_phosphopeptide()){ - description.setText("Phosphoprotein Group : " + ident.getGrouping().getGroupList().size() - + " - Phosphosite SubGroup : " + swt.getSubgroup_count() - + " - Total Phosphosite (redundancy) : " + table.getItemCount()); - }else{ - description.setText("Protein Group : " + ident.getGrouping().getGroupList().size() + if (this.data_type.getIs_phosphopeptide()) { + description.setText("Phosphoprotein Group : " + + ident.getGrouping().getGroupList().size() + + " - Phosphosite SubGroup : " + + swt.getSubgroup_count() + + " - Total Phosphosite (redundancy) : " + + table.getItemCount()); + } else { + description.setText("Protein Group : " + + ident.getGrouping().getGroupList().size() + " - Protein SubGroup : " + swt.getSubgroup_count() - + " - Total Protein (redundancy) : " + table.getItemCount()); + + " - Total Protein (redundancy) : " + + table.getItemCount()); } } catch (Exception e) { window.view_error(e, "Problems with drawing protein list");