code: def strip_transcript_versions(fasta, out_file):
      
      if file_exists(out_file):
          return out_file
      with file_transaction(out_file) as tx_out_file:
          with open(tx_out_file, "w") as out_handle:
              with open(fasta) as in_handle:
                  for line in in_handle:
                      if line.startswith(">"):
                          out_handle.write(line.split(" ")[0].split(".")[0] + "\n")
                      else:
                          out_handle.write(line)
      return out_file
docs: strip transcript versions from a FASTA file. these appear like this:
      >ENST00000434970.2 cdna chromosome:GRCh38:14:22439007:22439015:1 etc