code: def ptrue_to_bounded_phred(ptrue, max_prob=_MAX_CONFIDENCE):
      """Computes the Phred-scaled confidence from the given ptrue probability.
  
      See https://en.wikipedia.org/wiki/Phred_quality_score for more information.
      The quality score is capped by _MAX_CONFIDENCE.
  
      Args:
        ptrue: float. The ptrue probability to Phred scale.
        max_prob: float. The maximum allowed probability.
  
      Returns:
        Phred-scaled version of 1 - ptrue.
  
      Raises:
        ValueError: If ptrue is outside of [0.0, 1.0].
      """
      if not 0 <= ptrue <= 1:
          raise ValueError(
              "ptrue must be between zero and one: {}".format(ptrue)
          )
      return perror_to_phred(1.0 - min(ptrue, max_prob))
  
file_path: deepvariant/third_party/nucleus/util/genomics_math.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import math
  import numpy
  from third_party.nucleus.util.python import math
label_desc: Use image node_id 2 for calling a global function with example usage: ptrue_to_bounded_phred(ptrue, max_prob) and returns: perror_to_phred