Skip to content
This repository has been archived by the owner on May 5, 2024. It is now read-only.

Commit

Permalink
Cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
golgauth13 committed Mar 31, 2018
1 parent 5025318 commit f010aa8
Show file tree
Hide file tree
Showing 9 changed files with 198 additions and 161 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,13 @@

package net.sf.mzmine.modules.peaklistmethods.alignment.hierarchical;

import java.util.logging.Logger;

import org.gnf.clustering.DistanceMatrix;

public class DistanceMatrixTriangular1D2D implements DistanceMatrix {

private Logger logger = Logger.getLogger(this.getClass().getName());

private int dimension;

Expand Down Expand Up @@ -83,7 +87,7 @@ public void setValue(int nRow, int nCol, float fVal) {

public void printVector() {
// System.out.println(Arrays.toString(this.getVector()));
System.out.println(list.toString());
logger.info(list.toString());
}

// -
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,80 +38,71 @@

public class HierarAlignerGCParameters extends SimpleParameterSet {


//-- Save RAM 1
// -- Save RAM 1
public static final BooleanParameter saveRAMratherThanCPU_1 = new BooleanParameter(
"Save RAM (!! <FULL-EXPENSE-ON-CPU> !!)",
"Save RAM (!! <FULL-EXPENSE-ON-CPU> !!)",
"Ignored if clusterer type is not 'Cached'. Saves RAM at the expense of CPU during the whole clustering process (NO precomputed distances).",
false
);
//-- Save RAM 2
false);
// -- Save RAM 2
public static final BooleanParameter saveRAMratherThanCPU_2 = new BooleanParameter(
"Save RAM (!! <LAST-PART-ONLY> !!)",
"Save RAM (!! <LAST-PART-ONLY> !!)",
"Ignored if clusterer type is not 'Cached'. Saves RAM at the expense of CPU during the 2nd step of the clustering (building clusters from tree).",
false
);
false);



public static final PeakListsParameter peakLists = new PeakListsParameter();

public static final StringParameter peakListName = new StringParameter(
"Peak list name", "Peak list name", "Aligned peak list");



// Clusterer choice
public static final ComboParameter<ClustererType> clusterer_type = new ComboParameter<ClustererType>(
"Hierarchical clusterer",
"Which clustering algorithm should be used (See: \"Hierarchical clustering\" algorithms in general).",
ClustererType.values(),
ClustererType.CACHED
);

"Hierarchical clusterer",
"Which clustering algorithm should be used (See: \"Hierarchical clustering\" algorithms in general).",
ClustererType.values(), ClustererType.CACHED);

// Clustering linkage strategy
public static final ComboParameter<ClusteringLinkageStrategyType> linkageStartegyType_0 = new ComboParameter<ClusteringLinkageStrategyType>(
"Clustering strategy",
"What strategy shall be used for the clustering algorithm decision making (See: \"Hierarchical clustering\" algorithms in general).",
"Clustering strategy",
"What strategy shall be used for the clustering algorithm decision making (See: \"Hierarchical clustering\" algorithms in general).",
ClusteringLinkageStrategyType.values(),
ClusteringLinkageStrategyType.AVERAGE
);
ClusteringLinkageStrategyType.AVERAGE);

public static final IntegerParameter hybrid_K_value = new IntegerParameter(
"'K' value (Hybrid clusterer)",
"Ignored if clusterer type is not 'Hybrid'. Number of clusters for 1st pass (-1 => Let the algorithm decide) - 'Hybrid' uses 'K-Mean algorithm' as a first clustering pass.",
-1
);
"'K' value (Hybrid clusterer)",
"Ignored if clusterer type is not 'Hybrid'. Number of clusters for 1st pass (-1 => Let the algorithm decide) - 'Hybrid' uses 'K-Mean algorithm' as a first clustering pass.",
-1);


//-- Use unaltered RDF...
// -- Use unaltered RDF...
public static final BooleanParameter useOldestRDFAncestor = new BooleanParameter(
"Use original raw data file",
"Use original raw data file",
"Chemical similarity is computed using unaltered m/z profile at given scan from the very oldest Raw Data File ancestor (if it has not been removed). "
+ "Unchecked: information are grabbed as usual (from the data file the peak list to be merged was built from).",
false
);
//--

+ "Unchecked: information are grabbed as usual (from the data file the peak list to be merged was built from).",
false);
// --

public static final MZToleranceParameter MZTolerance = new MZToleranceParameter();
public static final DoubleParameter MZWeight = new DoubleParameter(
"Weight for m/z", "Weight for chemical similarity. Score for perfectly matching m/z values.");
"Weight for m/z",
"Weight for chemical similarity. Score for perfectly matching m/z values.");

public static final RTToleranceParameter RTTolerance = new RTToleranceParameter();
public static final DoubleParameter RTWeight = new DoubleParameter(
"Weight for RT", "Weight for retention times similarity. Score for perfectly matching RT values.");

public static final DoubleParameter minScore = new DoubleParameter(
"Minimum score",
"Minimum score for blast to be considered as successful " +
"(WARN: 'Pearson correlation' similarity method can imply scores < 0.0 and/or > 1.0)",
NumberFormat.getNumberInstance(), HierarAlignerGCTask.MIN_SCORE_ABSOLUTE);

// public static final DoubleParameter IDWeight = new DoubleParameter(
// "Weight for identity", "Weight for identities similarity. Score for perfectly matching identities.");

"Weight for RT",
"Weight for retention times similarity. Score for perfectly matching RT values.");

//*** GLG HACK: Added...
public static final BooleanParameter useKnownCompoundsAsRef = new BooleanParameter(
public static final DoubleParameter minScore = new DoubleParameter(
"Minimum score",
"Minimum score for blast to be considered as successful "
+ "(WARN: 'Pearson correlation' similarity method can imply scores < 0.0 and/or > 1.0)",
NumberFormat.getNumberInstance(),
HierarAlignerGCTask.MIN_SCORE_ABSOLUTE);

// public static final DoubleParameter IDWeight = new DoubleParameter(
// "Weight for identity", "Weight for identities similarity. Score for
// perfectly matching identities.");

// *** GLG HACK: Added...
public static final BooleanParameter useKnownCompoundsAsRef = new BooleanParameter(
"Use RT recalibration",
"If checked, uses compounds with known identities to ease alignment",
true);
Expand All @@ -123,7 +114,7 @@ public class HierarAlignerGCParameters extends SimpleParameterSet {
public static final RTToleranceParameter RTToleranceAfter = new RTToleranceParameter(
"RT tolerance post-recalibration",
"Ignored if \"Use RT recalibration\" is unchecked. Maximum allowed difference between two RT values after RT recalibration");

public static final BooleanParameter exportDendrogramTxt = new BooleanParameter(
"Export dendrogram as TXT/CDT",
"If checked, exports the clustering resulting dendrogram to the given TXT file.",
Expand All @@ -135,40 +126,38 @@ public class HierarAlignerGCParameters extends SimpleParameterSet {
+ " If the file already exists, it will be overwritten.",
"txt");

/** GLG HACK: temporarily removed for clarity
public static final BooleanParameter SameChargeRequired = new BooleanParameter(
"Require same charge state",
"If checked, only rows having same charge state can be aligned");
public static final BooleanParameter SameIDRequired = new BooleanParameter(
"Require same ID",
"If checked, only rows having same compound identities (or no identities) can be aligned");
public static final OptionalModuleParameter compareIsotopePattern = new OptionalModuleParameter(
"Compare isotope pattern",
"If both peaks represent an isotope pattern, add isotope pattern score to match score",
new IsotopePatternScoreParameters());
**/

/**
* GLG HACK: temporarily removed for clarity public static final
* BooleanParameter SameChargeRequired = new BooleanParameter( "Require same
* charge state", "If checked, only rows having same charge state can be
* aligned");
*
* public static final BooleanParameter SameIDRequired = new
* BooleanParameter( "Require same ID", "If checked, only rows having same
* compound identities (or no identities) can be aligned");
*
* public static final OptionalModuleParameter compareIsotopePattern = new
* OptionalModuleParameter( "Compare isotope pattern", "If both peaks
* represent an isotope pattern, add isotope pattern score to match score",
* new IsotopePatternScoreParameters());
**/

// Since clustering is now order independent, option removed!
public HierarAlignerGCParameters() {
super(new Parameter[] { peakLists,
// useOldestRDFAncestor,
////clusterer_type,
////saveRAMratherThanCPU_1, saveRAMratherThanCPU_2,
linkageStartegyType_0,
// hybrid_K_value,
peakListName,
MZTolerance, MZWeight,
RTTolerance, RTWeight,
super(new Parameter[] { peakLists,
// useOldestRDFAncestor,
//// clusterer_type,
//// saveRAMratherThanCPU_1, saveRAMratherThanCPU_2,
linkageStartegyType_0,
// hybrid_K_value,
peakListName, MZTolerance, MZWeight, RTTolerance, RTWeight,
minScore,
// useKnownCompoundsAsRef,
// useDetectedMzOnly,
// RTToleranceAfter,
// useKnownCompoundsAsRef,
// useDetectedMzOnly,
// RTToleranceAfter,
exportDendrogramTxt, dendrogramTxtFilename
/*SameChargeRequired, SameIDRequired, compareIsotopePattern*/
});
/* SameChargeRequired, SameIDRequired, compareIsotopePattern */
});
}

}
Loading

0 comments on commit f010aa8

Please sign in to comment.