biopython v1.71.0 Bio.SeqIO.PirIO.PirWriter

Class to write PIR format files.

Link to this section Summary

Functions

Create a PIR writer

Write a single PIR record to the file

Link to this section Functions

Create a PIR writer.

Arguments:

  • handle - Handle to an output file, e.g. as returned by open(filename, “w”)
  • wrap - Optional line length used to wrap sequence lines. Defaults to wrapping the sequence at 60 characters Use zero (or None) for no wrapping, giving a single long line for the sequence.
  • record2title - Optional function to return the text to be used for the title line of each record. By default a combination of the record.id, record.name and record.description is used.
  • code - Optional sequence code must be one of P1, F1, D1, DL, DC, RL, RC, N3 and XX. By default None is used, which means auto detection based on record alphabet.

You can either use::

handle = open(filename, "w")
writer = PirWriter(handle)
writer.write_file(myRecords)
handle.close()

Or, follow the sequential file writer system, for example::

handle = open(filename, "w")
writer = PirWriter(handle)
writer.write_header() 
...
Multiple writer.write_record() and/or writer.write_records() calls
...
writer.write_footer() 
handle.close()

Write a single PIR record to the file.