4.3.4 Text Streams

NewPedigree::tostream() returns a text stream from an instance of a NewPedigree object. The text stream contains an ASD-formatted pedigree as a string in which individual IDs are separated by commas and successive records are separated by newlines.
>>> pedstream = 'a1,s1,d1\na2,s2,d2\na3,a1,a2\n'
>>> test = pyp_newclasses.loadPedigree(options,pedsource='textstream',pedstream=pedstream)
>>> pedstream2 = test.tostream()
>>> print pedstream2
'd1,0,0\nd2,0,0\ns1,0,0\ns2,0,0\na2,s2,d2\na1,s1,d1\na3,a1,a2\n'
Note that in this example the input and output text streams differ because the input stream did not include pedigree entries for all animals in the pedigree (for example, sire "s1"). Recall that PyPedal adds missing entries for parents when the pedigree is loaded.

See About this document... for information on suggesting changes.