Skip to content

add missing caculation #3

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions DNAcalc2.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,18 @@
#Get Length of sequence
SeqLength=len(DNAseq)

GC_count=0
Missing_count=0

#Go through each base
for Base in ('A','G','T','C', 'N'):
for Base in ('A','G','T','C', 'N','?'):
#Count the number of times the base occurs
NumBase=DNAseq.count.upper(Base)
Missing_NumBase=DNAseq.count(Base)

#print("Percent %s: %.2f" %(Base,NumBase/SeqLength*100))
#Count Gs and Cs
if Base == "G" or Base == "C":
GC_count+=NumBase
if Base == "?":
Missing_count+=Missing_NumBase
#End of for Base in loop.
#print ("Sequence is %d bp long" %(SeqLength))
print ("GC content of %s is %.2f" %(Record.id, GC_count/SeqLength*100))
#End for Record in loop.
print ("Missing data of %s is %.2f" %(Record.id, Missing_count/SeqLength*100))
#End for Record in loop.