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: Write a .fam file to the given path.
  
  **Examples**
  
  >>> ped = hl.Pedigree.read('data/test.fam')
  >>> ped.write('output/out.fam')
  
  **Notes**
  
  This method writes a `PLINK .fam file <https://www.cog-genomics.org/plink2/formats#fam>`_.
  
  .. caution::
  
      Phenotype information is not preserved in the Pedigree data
      structure in Hail.  Reading and writing a PLINK .fam file will
      result in loss of this information.  Use :func:`~.import_fam` to
      manipulate this information.
  
  :param path: output path
  :type path: str
docstr_tok: ["Write","a",".fam","file","to","the","given","path",".","*","*","Examples","*","*",">",">",">","ped","=","hl.Pedigree.read","(","'data\/test.fam","'",")",">",">",">","ped.write","(","'output\/out.fam","'",")","*","*","Notes","*","*","This","method","writes","a","`","PLINK",".fam","file","<","https",":","\/\/www.cog-genomics.org\/plink2\/formats","#","fam",">","`","_",".","..","caution",":",":","Phenotype","information","is","not","preserved","in","the","Pedigree","data","structure","in","Hail",".","Reading","and","writing","a","PLINK",".fam","file","will","result","in","loss","of","this","information",".","Use",":","func",":","`","~.import_fam","`","to","manipulate","this","information",".",":","param","path",":","output","path",":","type","path",":","str"]
code: def write(self, path):
      """Write a .fam file to the given path.
  
      **Examples**
  
      >>> ped = hl.Pedigree.read('data/test.fam')
      >>> ped.write('output/out.fam')
  
      **Notes**
  
      This method writes a `PLINK .fam file <https://www.cog-genomics.org/plink2/formats#fam>`_.
  
      .. caution::
  
          Phenotype information is not preserved in the Pedigree data
          structure in Hail.  Reading and writing a PLINK .fam file will
          result in loss of this information.  Use :func:`~.import_fam` to
          manipulate this information.
  
      :param path: output path
      :type path: str
      """
  
      lines = [t._to_fam_file_line() for t in self._trios]
  
      with Env.fs().open(path, mode="w") as file:
          for line in lines:
              file.write(line + "\n")
  
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 9 for calling the Pedigree obj's underlying member method code with example usage: obj.write(path) without return types