- Timestamp:
- 04/17/23 01:50:13 (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
framspy/dissimilarity/density-distribution.py
r1214 r1219 8 8 libm = cdll.LoadLibrary(find_library('m')) 9 9 EPSILON = 0.0001 10 def __init__(self, FramsLib=None, density = 10, steps = 3, reduce=True, frequency=False, metric = 'emd', fixedZaxis=False, verbose=False):10 def __init__(self, frams_module=None, density = 10, steps = 3, reduce=True, frequency=False, metric = 'emd', fixedZaxis=False, verbose=False): 11 11 """ __init__ 12 12 Args: … … 20 20 verbose (bool, optional): Turning on logging, works only for calculateEMDforGeno. Defaults to False. 21 21 """ 22 if FramsLib ==None:23 raise ValueError('Frams librarynot provided!')24 self.frams _lib = FramsLib22 if frams_module is None: 23 raise ValueError('Framsticks module not provided!') 24 self.frams = frams_module 25 25 26 26 self.density = density … … 220 220 np.array([np.array(,dtype=float)]: list of voxels representing model. 221 221 """ 222 model = self.frams _lib.Model.newFromString(geno)222 model = self.frams.Model.newFromString(geno) 223 223 align(model, self.fixedZaxis) 224 model_geometry = self.frams _lib.ModelGeometry.forModel(model)224 model_geometry = self.frams.ModelGeometry.forModel(model) 225 225 226 226 model_geometry.geom_density = self.density … … 296 296 297 297 def calculateDissimforGeno(self, geno1, geno2): 298 """Calculates EMD for pair of genos.298 """Calculates EMD for a pair of genotypes. 299 299 Args: 300 300 geno1 (string): representation of model1 in one of the formats handled by frams http://www.framsticks.com/a/al_genotype.html
Note: See TracChangeset
for help on using the changeset viewer.