code: def pandas_series_to_biopython_seqrecord(
      series,
      id_col='uid',
      sequence_col='sequence',
      extra_data=None,
      alphabet=None
      ):
      
      # Get sequence
      seq = Seq(series[sequence_col], alphabet=alphabet)
  
      # Get id
      id = series[id_col]
  
      # Build a description
      description = ""
      if extra_data is not None:
          description = " ".join([series[key] for key in extra_data])
  
      # Build a record
      record = SeqRecord(
          seq=seq,
          id=id,
          description=description,
      )
  
      seq_records = [record]
      return seq_records
docs: Convert pandas series to biopython seqrecord for easy writing.
  
      Parameters
      ----------
      series : Series
          Pandas series to convert
  
      id_col : str
          column in dataframe to use as sequence label
  
      sequence_col : str
          column in dataframe to use as sequence data
  
      extra_data : list
          extra columns to use in sequence description line
  
      Returns
      -------
      seq_records :
          List of biopython seqrecords.