This may sound like a dumb question, but how do I extract a specific text value from a GenBank file? I want to be able to take that text value and print that onto a separate text file but for now I just want to figure out how to retrieve that specific number.
I was able to achieve this with the GenBank file ID by using some Biopython commands but I am very new to Biopython and cannot seem to figure a way to retrieve the CDS number.
The SeqRecord
object has additional attributes, among which features
is a list
of SeqFeature
objects and will be where CDS information would be stored (if present).
For example, the following would print the start location of all CDS features in a SeqRecord
:
for f in genbank_object.features:
if f.type == "CDS":
print(f.location.start.position)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.