Skip to content
Snippets Groups Projects
Commit 006b3d7c authored by langella's avatar langella
Browse files

AlgoGrouping created

git-svn-id: https://subversion.renater.fr/xtandempipeline/trunk@338 b8ef2a07-7df7-436f-90b9-41648038564b
parent 9847b717
No related branches found
No related tags found
No related merge requests found
......@@ -11,12 +11,12 @@ import fr.inra.pappso.xtandempipeline.filter_print.FilterGroupFromFastaDatabase;
import fr.inra.pappso.xtandempipeline.filter_print.filter_base;
import fr.inra.pappso.xtandempipeline.filter_print.print_base;
import fr.inra.pappso.xtandempipeline.filter_print.swt_table_base;
import fr.inra.pappso.xtandempipeline.grouping.AlgoGrouping;
import fr.inra.pappso.xtandempipeline.grouping.AlgoGroupingPhospho;
import fr.inra.pappso.xtandempipeline.grouping.Group;
import fr.inra.pappso.xtandempipeline.grouping.GroupSet;
import fr.inra.pappso.xtandempipeline.grouping.HashSampleScanSetPhospho;
import fr.inra.pappso.xtandempipeline.grouping.HashSampleScanSetProt;
import fr.inra.pappso.xtandempipeline.grouping.SubGroup;
import fr.inra.pappso.xtandempipeline.grouping.SubGroupSet;
public class Identification {
......@@ -31,7 +31,7 @@ public class Identification {
private ModifsList mods;
private MsRunSet msRunSet = new MsRunSet();
private DatabaseSet databaseSet = new DatabaseSet();
public Identification() {
......@@ -40,12 +40,12 @@ public class Identification {
this.grouping = null;
this.mods = new ModifsList();
}
@Override
protected void finalize() throws Throwable {
logger.debug("finalize identification");
logger.debug("Match : "+protein_liste.size());
logger.debug("Peptide : "+peptide_liste.size());
logger.debug("Match : " + protein_liste.size());
logger.debug("Peptide : " + peptide_liste.size());
}
public void add_peptide(PeptideId P) {
......@@ -92,7 +92,7 @@ public class Identification {
public MsRunSet getMsRunSet() {
return this.msRunSet;
}
public Match get_match(Protein P) {
if (this.protein_liste.containsKey(P.getAccession()))
return (this.protein_liste.get(P.getAccession()));
......@@ -115,7 +115,7 @@ public class Identification {
}
public void remove_contaminant_submatch(File database) {
//TODO Remove group containing prot from this database
// TODO Remove group containing prot from this database
new FilterGroupFromFastaDatabase(database).filter(grouping);
}
......@@ -139,40 +139,26 @@ public class Identification {
public void performedGroupSet() throws Exception {
logger.info("Performed grouping");
GroupSet resultGroupSet = new GroupSet();
SubGroupSet subGroupSet = new SubGroupSet();
AlgoGrouping groupingAlgo = new AlgoGrouping();
for (Match m : protein_liste.values()) {
if (m.isIsvalidate()) {
subGroupSet.addHashSampleScanSetProt(new HashSampleScanSetProt(
m));
groupingAlgo
.addHashSampleScanSetProt(new HashSampleScanSetProt(m));
}
}
logger.info("Number of subgroup before group creation : "+subGroupSet.size());
resultGroupSet.groupingSubGroupSet(subGroupSet);
grouping = resultGroupSet;
grouping = groupingAlgo.getGroupSet();
}
public void performedPhosphoGroupSet() throws Exception {
GroupSet resultGroupSet = new GroupSet();
SubGroupSet subGroupSet = new SubGroupSet();
AlgoGroupingPhospho groupingAlgoPhospho = new AlgoGroupingPhospho();
for (Match m : protein_liste.values()) {
if (m.isIsvalidate()) {
ArrayList<HashSampleScanSetPhospho> phosphoSites = m
.getHashSampleScanSetPhosphoList();
for (HashSampleScanSetPhospho phospho : phosphoSites) {
subGroupSet.addHashSampleScanSetProt(phospho);
}
groupingAlgoPhospho.addAllHashSampleScanSetPhospho(m
.getHashSampleScanSetPhosphoList());
}
}
/*
* for (SubGroup sg:subGroupSet) { sg.loggerDebug(); }
*/
resultGroupSet.groupingSubGroupSet(subGroupSet);
this.grouping = resultGroupSet;
grouping = groupingAlgoPhospho.getGroupSet();
}
public ArrayList<Database> get_database_list() {
......
package fr.inra.pappso.xtandempipeline.grouping;
import org.apache.log4j.Logger;
import fr.inra.pappso.xtandempipeline.MsException.MSMSException;
public class AlgoGrouping {
private static final Logger logger = Logger.getLogger(AlgoGrouping.class);
SubGroupSet subGroupSet = new SubGroupSet();
public void addHashSampleScanSetProt(HashSampleScanSetProt hashSampleScanSetProt) {
subGroupSet.addHashSampleScanSetProt(hashSampleScanSetProt);
}
public GroupSet getGroupSet() throws Exception {
if (subGroupSet.size() == 0) {
String message = "There is nothing to group, please use the addHashSampleScanSetProt function";
logger.error(message);
throw new MSMSException(message);
}
try {
logger.info("Perform grouping");
logger.info("Number of subgroup before group creation : "
+ subGroupSet.size());
GroupSet resultGroupSet = new GroupSet();
resultGroupSet.groupingSubGroupSet(subGroupSet);
return resultGroupSet;
} catch (Exception e) {
String message = "ERROR in AlgoGrouping : " + e.getMessage();
logger.error(message);
throw new MSMSException(message);
}
}
}
package fr.inra.pappso.xtandempipeline.grouping;
import java.util.Collection;
import org.apache.log4j.Logger;
import fr.inra.pappso.xtandempipeline.MsException.MSMSException;
public class AlgoGroupingPhospho {
private static final Logger logger = Logger
.getLogger(AlgoGroupingPhospho.class);
SubGroupSet subGroupSet = new SubGroupSet();
public void addAllHashSampleScanSetPhospho(
Collection<HashSampleScanSetPhospho> arrHashSampleScanSetPhospho) {
for (HashSampleScanSetPhospho HashSampleScanSetPhospho : arrHashSampleScanSetPhospho) {
subGroupSet.addHashSampleScanSetProt(HashSampleScanSetPhospho);
}
}
public GroupSet getGroupSet() throws Exception {
if (subGroupSet.size() == 0) {
String message = "There is nothing to group, please use the addArrHashSampleScanSetPhospho function";
logger.error(message);
throw new MSMSException(message);
}
try {
logger.info("Perform phospho grouping");
GroupSet resultGroupSet = new GroupSet();
resultGroupSet.groupingSubGroupSet(subGroupSet);
return resultGroupSet;
} catch (Exception e) {
String message = "ERROR in AlgoGroupingPhospho : " + e.getMessage();
logger.error(message);
throw new MSMSException(message);
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment