Skip to content

Commit

Permalink
minor pymc/pytensor version upgrades, fix 2-interval edge case, updat…
Browse files Browse the repository at this point in the history
…e some theano docs
  • Loading branch information
samuelklee committed Dec 13, 2023
1 parent 9c9d0c5 commit 74f8fa7
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 22 deletions.
8 changes: 4 additions & 4 deletions scripts/gatkcondaenv.yml.template
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ dependencies:
- conda-forge::python=3.10.13 # do not update without good reason
- conda-forge:pip=23.3.1
- conda-forge:blas=1.0=mkl # our official environment uses MKL versions of various packages; if other versions are desired, users should edit this YML accordingly
- conda-forge::numpy=1.26.2 # MKL
- conda-forge::pymc=5.10.0 # do not update without good reason, this may break gcnvkernel
- conda-forge::pytensor=2.18.1 # do not update without good reason, this may break gcnvkernel
- conda-forge::numpy=1.26.2
- conda-forge::pymc=5.10.1
- conda-forge::pytensor=2.18.3
- conda-forge::scipy=1.11.4
- conda-forge::h5py=3.10.0
- conda-forge::pytorch=2.1.0=*mkl*100 # CPU MKL
- conda-forge::pytorch=2.1.0=*mkl*100
- conda-forge::scikit-learn=1.3.2
- conda-forge::matplotlib=3.8.2
- conda-forge::pandas=2.1.3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@
* <p>OpenMP and MKL parallelism can be controlled by setting the <code>OMP_NUM_THREADS</code> and <code>MKL_NUM_THREADS</code>
* environment variables, respectively.</p>
*
* <p>Advanced users may wish to set the <code>THEANO_FLAGS</code> environment variable to override the GATK theano
* <p>Advanced users may wish to set the <code>PYTENSOR_FLAGS</code> environment variable to override the GATK PyTensor
* configuration. For example, by running
* <code>THEANO_FLAGS="base_compiledir=PATH/TO/BASE_COMPILEDIR" gatk DetermineGermlineContigPloidy ...</code>, users can specify
* the theano compilation directory (which is set to <code>$HOME/.theano</code> by default). See theano documentation
* at <a href="https://theano-pymc.readthedocs.io/en/latest/library/config.html">
* https://theano-pymc.readthedocs.io/en/latest/library/config.html</a>.
* <code>PYTENSOR_FLAGS="base_compiledir=PATH/TO/BASE_COMPILEDIR" gatk DetermineGermlineContigPloidy ...</code>, users can specify
* the PyTensor compilation directory (which is set to <code>$HOME/.pytensor</code> by default). See PyTensor documentation
* at <a href="https://pytensor.readthedocs.io/en/latest/library/config.html">
* https://pytensor.readthedocs.io/en/latest/library/config.html</a>.
* </p>
*
* <h3>Tool run modes</h3>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@
* <p>OpenMP and MKL parallelism can be controlled by setting the <code>OMP_NUM_THREADS</code> and <code>MKL_NUM_THREADS</code>
* environment variables, respectively.</p>
*
* <p>Advanced users may wish to set the <code>THEANO_FLAGS</code> environment variable to override the GATK theano
* <p>Advanced users may wish to set the <code>PYTENSOR_FLAGS</code> environment variable to override the GATK PyTensor
* configuration. For example, by running
* <code>THEANO_FLAGS="base_compiledir=PATH/TO/BASE_COMPILEDIR" gatk GermlineCNVCaller ...</code>, users can specify
* the theano compilation directory (which is set to <code>$HOME/.theano</code> by default). See theano documentation
* at <a href="https://theano-pymc.readthedocs.io/en/latest/library/config.html">
* https://theano-pymc.readthedocs.io/en/latest/library/config.html</a>.
* <code>PYTENSOR_FLAGS="base_compiledir=PATH/TO/BASE_COMPILEDIR" gatk DetermineGermlineContigPloidy ...</code>, users can specify
* the PyTensor compilation directory (which is set to <code>$HOME/.pytensor</code> by default). See PyTensor documentation
* at <a href="https://pytensor.readthedocs.io/en/latest/library/config.html">
* https://pytensor.readthedocs.io/en/latest/library/config.html</a>.
* </p>
*
* <h3>Resource usage</h3>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@
* the python environment is already set up. Otherwise, the environment must be created and activated as described in the
* main GATK README.md file.</p>
*
* <p>Advanced users may wish to set the <code>THEANO_FLAGS</code> environment variable to override the GATK theano
* <p>Advanced users may wish to set the <code>PYTENSOR_FLAGS</code> environment variable to override the GATK PyTensor
* configuration. For example, by running
* <code>THEANO_FLAGS="base_compiledir=PATH/TO/BASE_COMPILEDIR" gatk PostprocessGermlineCNVCalls ...</code>, users can specify
* the theano compilation directory (which is set to <code>$HOME/.theano</code> by default). See theano documentation
* at <a href="https://theano-pymc.readthedocs.io/en/latest/library/config.html">
* https://theano-pymc.readthedocs.io/en/latest/library/config.html</a>.
* <code>PYTENSOR_FLAGS="base_compiledir=PATH/TO/BASE_COMPILEDIR" gatk DetermineGermlineContigPloidy ...</code>, users can specify
* the PyTensor compilation directory (which is set to <code>$HOME/.pytensor</code> by default). See PyTensor documentation
* at <a href="https://pytensor.readthedocs.io/en/latest/library/config.html">
* https://pytensor.readthedocs.io/en/latest/library/config.html</a>.
* </p>
*
* <h3>Required inputs:</h3>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@
from .tasks.inference_task_base import ConvergenceError
from .utils import cli_commons, math

assert pymc_version == "5.10.0", "gcnvkernel currently only supports PyMC 5.9.0; version found: {0}; " \
assert pymc_version == "5.10.1", "gcnvkernel currently only supports PyMC 5.10.1; version found: {0}; " \
"please upgrade or downgrade the PyMC module in your python environment " \
"accordingly.".format(pymc_version)
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import pytensor
import pytensor.sparse as pst
import pytensor.tensor as pt
from pytensor.tensor.shape import unbroadcast
from pymc import Normal, Deterministic, Potential, Lognormal, Exponential, TruncatedNormal, NegativeBinomial, Mixture

from . import commons
Expand Down Expand Up @@ -1236,10 +1237,9 @@ def _get_update_log_class_emission_tk_pytensor_func(self) -> pytensor.compile.Fu
self.calling_config.num_copy_number_classes),
dtype=types.floatX)

# TODO unbroadcast seems to have been removed?
# this converts TensorType from row to matrix in the edge case when number of intervals is equal to 2
# (to avoid type mismatch later on)
# log_class_emission_cum_sum_tk = pytensor.shape.unbroadcast(log_class_emission_cum_sum_tk, 0)
log_class_emission_cum_sum_tk = unbroadcast(log_class_emission_cum_sum_tk, 0)

def inc_log_class_emission_tk_except_for_first_interval(pi_jkc, q_c_tc, cum_sum_tk):
"""Adds the contribution of a given sample to the log class emission (symbolically).
Expand Down

0 comments on commit 74f8fa7

Please sign in to comment.