ccpn.AnalysisScreen.lib package

Module Documentation here

Submodules

ccpn.AnalysisScreen.lib.MixtureGeneration module

class ccpn.AnalysisScreen.lib.MixtureGeneration.ObjectClustering(spectra)[source]

Bases: object

getNComponentsPerSample(n)[source]
getNSamples(n)[source]
initialiseClusters(spectra, clustercount)[source]
ccpn.AnalysisScreen.lib.MixtureGeneration.allCombinations(ss, value)[source]
ccpn.AnalysisScreen.lib.MixtureGeneration.bestMatch(spectra, minimalOverlap)[source]

This function creates all possible clusters. From one cluster with one mixture with all spectra until a cluster with the maximum number of mixtures with at least 2 spectra in each. The minimum score is calculated for each spectrum in each mixture. Each cluster is given the minimum score of the mixture. :return: cluster with less mixtures (higher num of spectra inside) with best score

ccpn.AnalysisScreen.lib.MixtureGeneration.createSample(cluster)[source]
ccpn.AnalysisScreen.lib.MixtureGeneration.scoring(spectrum, mixtureSpectra, minimalOverlap=None)[source]

The score is given by the distance of the best resolved peak to its closest neighbour. value = Distance in ppm to closest peak. Smaller is the distance and consequently lower the score and more overlapped is that component to its neighbour. func used: - empty: returns a new array of given shape and type, without initializing entries. Parameters: shape and type - nanmin: returns minimum of an array or minimum along an axis, ignoring any NaNs. - ufunc.outer(A, B) applies the ufunc op to all pairs (a, b) with a in A and b in B - fabs: returns the absolute values

ccpn.AnalysisScreen.lib.MixtureGeneration.setupSamples(spectra=None, mode: str = None, n: int = None, minimalOverlap: float = None, mixtureName: str = None)[source]

Analyses the peak positions in experiments (should be one reference experiment per component) and suggests samples with low overlap of at least one peak in each sample. ignoredRegions can be used to specify parts of the spectra that should be ignored. mode can be ‘nSamples’ or ‘nComponentsPerSample’ to choose if n is the number of wanted samples or the number of components in each sample.

ccpn.AnalysisScreen.lib.MixturesGeneration module

ccpn.AnalysisScreen.lib.MixturesGeneration.getCompounds(spectra)[source]

ccpn.AnalysisScreen.lib.Screening module

class ccpn.AnalysisScreen.lib.Screening.Peak(frequency, linewidth, intensity, phase)

Bases: tuple

frequency

Alias for field number 0

intensity

Alias for field number 2

linewidth

Alias for field number 1

phase

Alias for field number 3

ccpn.AnalysisScreen.lib.Screening.createStdDifferenceSpectrum(stdOffResonance, stdOnResonance)[source]
ccpn.AnalysisScreen.lib.Screening.estimateNoise(spectrum)[source]
ccpn.AnalysisScreen.lib.Screening.lorentzian(points, center, linewidth, intensity=1, phase=0)[source]
ccpn.AnalysisScreen.lib.Screening.matchedPosition(stdPeaks, componentPeaks, tolerance: float = 0.005, minimumMatches: int = 1)[source]

Matches peaks from the std spectrum ( Std off resonance - Std on resonance) to a given reference component.

ccpn.AnalysisScreen.lib.Screening.spectrumFromPeaks(x, peaks)[source]
ccpn.AnalysisScreen.lib.Screening.writeBruker(directory, data)[source]

ccpn.AnalysisScreen.lib.SimulatedAnnealing module

ccpn.AnalysisScreen.lib.SimulatedAnnealing.annealMixtures(mixtures, coolingMethod='Linear', startTemp=1000, finalTemp=0.01, maxSteps=1000, tempK=200, minDistance=0.01)[source]
ccpn.AnalysisScreen.lib.SimulatedAnnealing.calculateOverlapCount(compoundA, mixture, minimalOverlap)[source]
ccpn.AnalysisScreen.lib.SimulatedAnnealing.calculateTotalScore(mixturesDict, peaksDistance=0.01)[source]
ccpn.AnalysisScreen.lib.SimulatedAnnealing.exponentialCooling(startTemp=1000.0, finalTemp=0.1, maxSteps=100)[source]
ccpn.AnalysisScreen.lib.SimulatedAnnealing.findBestMixtures(mixturesSteps)[source]
ccpn.AnalysisScreen.lib.SimulatedAnnealing.generatePeakPositions(numberOfPeaks, ppmStart, ppmEnd)[source]
ccpn.AnalysisScreen.lib.SimulatedAnnealing.generateSimpleCompounds(numb, numberOfPeaks, ppmStart, ppmEnd)[source]
ccpn.AnalysisScreen.lib.SimulatedAnnealing.getAllOverlappedPositions(mixtures, minDist)[source]
ccpn.AnalysisScreen.lib.SimulatedAnnealing.getMixtureInfo(mixture, minDist)[source]
ccpn.AnalysisScreen.lib.SimulatedAnnealing.getOverlappedCount(mixtureCompounds, minDist=0.01)[source]
ccpn.AnalysisScreen.lib.SimulatedAnnealing.getProbability(scoreDiff, currentTemp, tempK)[source]
ccpn.AnalysisScreen.lib.SimulatedAnnealing.greedyMixtures(compounds, maxSize, minDistance, maxPeaksOverlapped=None)[source]
ccpn.AnalysisScreen.lib.SimulatedAnnealing.iterateAnnealing(mixtures, startTemp=1000, finalTemp=0.01, maxSteps=1000, tempK=200, coolingMethod='linear', nIterations=1, minDistance=0.01)[source]
ccpn.AnalysisScreen.lib.SimulatedAnnealing.linearCooling(startTemp=1000.0, finalTemp=0.1, maxSteps=1000)[source]
ccpn.AnalysisScreen.lib.SimulatedAnnealing.mixTwoMixturesDict(mixtures)[source]
ccpn.AnalysisScreen.lib.SimulatedAnnealing.randomDictMixtures(name, compounds, nMixtures)[source]
ccpn.AnalysisScreen.lib.SimulatedAnnealing.runCooling(type, startTemp=1000.0, finalTemp=0.1, maxSteps=1000)[source]
ccpn.AnalysisScreen.lib.SimulatedAnnealing.scoreCompound(compoundA, compoundB, minDist, scalingFactor=1)[source]
ccpn.AnalysisScreen.lib.SimulatedAnnealing.scoreMixture(mixture, minDist)[source]
ccpn.AnalysisScreen.lib.SimulatedAnnealing.showScoresPerMixture(mixtures, minDistance)[source]