Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compute GC fraction from genbank (automate the process for other organisms) #12

Open
yseif opened this issue Aug 23, 2017 · 0 comments
Open

Comments

@yseif
Copy link

yseif commented Aug 23, 2017

def getGC_content(genbank_file):
for seqrecord in SeqIO.parse(genbank_file, 'genbank'):
sequence = str(seqrecord.seq)
GC_fraction = (sequence.count('G')+sequence.count('C'))/float(sequence.count('G')+sequence.count('C')+sequence.count('T')+sequence.count('A'))
return GC_fraction

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant