def write_cf_from_MFaStream(refMFaStr, cfWr):
    """Write counts file using the given MFaStream and CFWriter.

    Write the counts format file using the first sequences of all
    alignments in the MFaStream.  The sequences are automatically
    reversed and complemented if this is needed (indicated in the
    header line).  This is very useful if you e.g. want to compare the
    VCF files to a CCDC alignment.

    :param FMaStream refMFaStr: The reference :class:`MFaStream
      <cflib.fasta.MFaStream>`.
    :param CFWriter cfWf: The :class:`CFWriter` object that contains
      the VCF files.

    """
    while True:
        refMFaStr.orient(firstOnly=True)
        rg = refMFaStr.seqL[0].get_region()
        cfWr.set_seq(refMFaStr.seqL[0])
        cfWr.write_Rn(rg)
        if refMFaStr.read_next_align() is None:
            break
