Skip to content

FloatingPointError: divide by zero encountered in true_divide #26

Description

@SternLabTAU

When running the Exp_CM model, the error below keeps coming up. This occurs even when running on the beta_lactamase dataset given as an example:

module load python/python-anaconda3.2019.7
phydms betaLactamase_alignment.fasta.phy.fasta betaLactamase_alignment.fasta.phy_phyml_tree.txt ExpCM_betaLactamase_prefs.txt test.out
/powerapps/share/python-anaconda-3.2019.7/lib/python3.7/site-packages/Bio/Alphabet/__init__.py:26: PendingDeprecationWarning: We intend to remove or replace Bio.Alphabet in 2020, ideally avoid using it explicitly in your code. Please get in touch if you will be adversely affected by this. https://github.com/biopython/biopython/issues/2046
  PendingDeprecationWarning)
2020-01-09 16:57:12,435 - INFO - Beginning execution of phydms in directory /sternadi/home/volume1/sternadi/CVB3_RG/test

2020-01-09 16:57:12,436 - INFO - Progress is being logged to test.out_log.log

2020-01-09 16:57:12,436 - INFO - Version information:
	Time and date: Thu Jan  9 16:57:08 2020
	Platform: Linux-3.10.0-514.el7.x86_64-x86_64-with-centos-7.3.1611-Core
	Python version: 3.7.3 (default, Mar 27 2019, 22:11:17)  [GCC 7.3.0]
	phydms version: 2.3.6
	Bio version: 1.74
	cython version: 0.29.12
	numpy version: 1.16.4
	scipy version: 1.3.0
	matplotlib version: 3.1.0
	natsort version: 6.0.0
	sympy version: 1.4
	six version: 1.12.0
	pandas version: 0.24.2
	pyvolve version: 1.0.0
	statsmodels version: 0.10.0
	weblogolib version: 3.5.0
	PyPDF2 version: 1.26.0

2020-01-09 16:57:12,437 - INFO - Parsed the following arguments:
	alignment = betaLactamase_alignment.fasta.phy.fasta
	tree = betaLactamase_alignment.fasta.phy_phyml_tree.txt
	model = ('ExpCM', 'betaLactamase_prefs.txt')
	outprefix = test.out
	brlen = optimize
	gammaomega = False
	gammabeta = False
	omegabysite = False
	omegabysite_fixsyn = False
	diffprefsbysite = False
	diffprefsprior = ('invquadratic', 150.0, 0.5)
	fitphi = False
	randprefs = False
	avgprefs = False
	divpressure = None
	ncpus = 1
	fitprefsmethod = 2
	ncats = 4
	minbrlen = 1e-06
	minpref = 0.002
	seed = 1
	initparams = None
	profile = False
	opt_details = False
	nograd = False

2020-01-09 16:57:12,437 - INFO - Random number seed: 1

2020-01-09 16:57:12,438 - INFO - Reading alignment from betaLactamase_alignment.fasta.phy.fasta
2020-01-09 16:57:13,083 - INFO - Read 50 aligned sequences from betaLactamase_alignment.fasta.phy.fasta, each consisting of 263 codons.

2020-01-09 16:57:13,084 - INFO - The model will be an ExpCM informed by site-specific amino-acid preferences in betaLactamase_prefs.txt
2020-01-09 16:57:14,735 - INFO - Successfully read site-specific amino-acid preferences for all 263 sites.

2020-01-09 16:57:14,736 - INFO - Nucleotide frequency parameters phi will be set so stationary state matches alignment nucleotide frequencies of A = 0.239, C = 0.269, G = 0.292, T = 0.201

2020-01-09 16:57:15,055 - ERROR - Terminating phydms at Thu Jan  9 16:57:15 2020 with ERROR
Traceback (most recent call last):
  File "/powerapps/share/python-anaconda-3.2019.7/bin/phydms", line 299, in main
    freeparams=freeparams)
  File "/powerapps/share/python-anaconda-3.2019.7/lib/python3.7/site-packages/phydmslib/models.py", line 1279, in __init__
    omega=omega, beta=beta, mu=mu, freeparams=freeparams)
  File "/powerapps/share/python-anaconda-3.2019.7/lib/python3.7/site-packages/phydmslib/models.py", line 434, in __init__
    self.updateParams({}, update_all=True)
  File "/powerapps/share/python-anaconda-3.2019.7/lib/python3.7/site-packages/phydmslib/models.py", line 539, in updateParams
    self._update_Frxy()
  File "/powerapps/share/python-anaconda-3.2019.7/lib/python3.7/site-packages/phydmslib/models.py", line 706, in _update_Frxy
    / (1 - self.piAx_piAy_beta), where=scipy.logical_and(
FloatingPointError: divide by zero encountered in true_divide
Traceback (most recent call last):
  File "/powerapps/share/python-anaconda-3.2019.7/bin/phydms", line 551, in <module>
    main() # run the script
  File "/powerapps/share/python-anaconda-3.2019.7/bin/phydms", line 299, in main
    freeparams=freeparams)
  File "/powerapps/share/python-anaconda-3.2019.7/lib/python3.7/site-packages/phydmslib/models.py", line 1279, in __init__
    omega=omega, beta=beta, mu=mu, freeparams=freeparams)
  File "/powerapps/share/python-anaconda-3.2019.7/lib/python3.7/site-packages/phydmslib/models.py", line 434, in __init__
    self.updateParams({}, update_all=True)
  File "/powerapps/share/python-anaconda-3.2019.7/lib/python3.7/site-packages/phydmslib/models.py", line 539, in updateParams
    self._update_Frxy()
  File "/powerapps/share/python-anaconda-3.2019.7/lib/python3.7/site-packages/phydmslib/models.py", line 706, in _update_Frxy
    / (1 - self.piAx_piAy_beta), where=scipy.logical_and(
FloatingPointError: divide by zero encountered in true_divide

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions