class_docstr: Class containing a list of trios, with extra functionality.
  
  :param trios: list of trio objects to include in pedigree
  :type trios: list of :class:`.Trio`
docstr: Filter the pedigree to a given list of sample IDs.
  
  **Notes**
  
  For any trio, the following steps will be applied:
  
   - If the proband is not in the list of samples provided, the trio is removed.
   - If the father is not in the list of samples provided, `pat_id` is set to ``None``.
   - If the mother is not in the list of samples provided, `mat_id` is set to ``None``.
  
  Parameters
  ----------
  samples: :obj:`list` [:obj:`str`]
      Sample IDs to keep.
  
  Returns
  -------
  :class:`.Pedigree`
docstr_tok: ["Filter","the","pedigree","to","a","given","list","of","sample","IDs",".","*","*","Notes","*","*","For","any","trio",",","the","following","steps","will","be","applied",":","-","If","the","proband","is","not","in","the","list","of","samples","provided",",","the","trio","is","removed",".","-","If","the","father","is","not","in","the","list","of","samples","provided",",","`","pat_id","`","is","set","to","``","None","``",".","-","If","the","mother","is","not","in","the","list","of","samples","provided",",","`","mat_id","`","is","set","to","``","None","``",".","Parameters","--","--","--","--","--","samples",":",":","obj",":","`","list","`","[",":","obj",":","`","str","`","]","Sample","IDs","to","keep",".","Returns","--","--","--","-",":","class",":","`",".Pedigree","`"]
code: def filter_to(self, samples):
      """Filter the pedigree to a given list of sample IDs.
  
      **Notes**
  
      For any trio, the following steps will be applied:
  
       - If the proband is not in the list of samples provided, the trio is removed.
       - If the father is not in the list of samples provided, `pat_id` is set to ``None``.
       - If the mother is not in the list of samples provided, `mat_id` is set to ``None``.
  
      Parameters
      ----------
      samples: :obj:`list` [:obj:`str`]
          Sample IDs to keep.
  
      Returns
      -------
      :class:`.Pedigree`
      """
      sample_set = set(samples)
  
      filtered_trios = []
      for trio in self._trios:
          restricted_trio = trio._restrict_to(sample_set)
          if restricted_trio is not None:
              filtered_trios.append(restricted_trio)
  
      return Pedigree(filtered_trios)
  
imports: import re
  from collections import Counter
  from hail.typecheck import typecheck_method, nullable, sequenceof
  from hail.utils.java import Env, FatalError, warning
label_desc: Use image node_id 8 for calling the Pedigree obj's underlying member method code with example usage: obj.filter_to(samples) and returns: Pedigree