1
2
3
4
5
6
7 """Bio.SeqIO support for the "phd" file format.
8
9 PHD files are output by PHRED and used by PHRAP and CONSED.
10
11 You are expected to use this module via the Bio.SeqIO functions.
12 See also the underlying Bio.Sequencing.Phd module."""
13
14 from Bio.SeqRecord import SeqRecord
15 from Bio.Sequencing import Phd
16
17
19 """Returns SeqRecord objects from a PHD file.
20
21 This uses the Bio.Sequencing.Phy module to do the hard work.
22 """
23
24 phd_records = Phd.parse(handle)
25 for phd_record in phd_records:
26
27 seq_record = SeqRecord(phd_record.seq,
28 id = phd_record.file_name,
29 name = phd_record.file_name)
30
31 seq_record.annotations = phd_record.comments
32 yield seq_record
33
34
35 if __name__ == "__main__" :
36 print "Quick self test"
37 handle = open("../../Tests/Phd/Phd1")
38 for record in PhdIterator(handle) :
39 print record
40 handle.close()
41 print "Done"
42