Split multple gbk records by molecule type
1
0
Entering edit mode
20 months ago
AveryB • 0

I have multiple genbank gz files that I'm trying to sort by the molecule_type in biopython. For it to grab the protein gz files and the nucleotides in a separate entry.

Multi sort split type molecule • 732 views
ADD COMMENT
0
Entering edit mode
20 months ago

Here is a recent post on how to extract the qualifiers of the source feature.

As you can see there the mol_type is a key in the same ordered dictionary

How can I print and write the strain /isolate/voucher number of a SeqRecord objec in biopython?

to open a gz file, use gzopen.open

ADD COMMENT
0
Entering edit mode

@Istvan Albert I'm new to Biopython and trying to figure it out, I was able to print out what you suggested above. I have three gb records, genome.gb, bacteria1.gb, bacteria2.gb that have several entries inside them and I want to sort them just the records themselves by type?

ADD REPLY
0
Entering edit mode

Make a list that contains all records, then use the sort function with a key as explained here:

https://docs.python.org/3/howto/sorting.html

then you'll have a sorted list

ADD REPLY

Login before adding your answer.

Traffic: 1022 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6