counting nucleotides is an important task in bioinformatics, one would need to write a long procedural code block in languages like Visual Basic to achive this task. However, in Phython 3.5 it is just the mater of few lines of codes. below is an example of a simple method used to write such a software to count nucleotides frequency of a DNA sequence.
>>> DNA = input("please enter your DNA sequence below: \n")
please enter your DNA sequence below:
"ATGCTGGATGCACACCGTCGATCGTATATTAAA"
>>> A = "A"
>>> T = "T"
>>> C = "C"
>>> G = "G"
>>> print("Adenine count is :",DNA.count(A))
Adenine count is : 10
>>> print("Thymine count is :",DNA.count(T))
Thymine count is : 9
>>> print("Cytosine count is :",DNA.count(C))
Cytosine count is : 7
>>> print("Guanine count is :",DNA.count(G))
Guanine count is : 7
>>> print("the total number of Nucleotides in your DNA seq is :",DNA.count(A)+ DNA.count(T)+DNA.count(C)+DNA.count(G))
the total number of Nucleotides in your DNA seq is : 33
_____________________________________________________________________________
To understand this procedure more easily you may need to watch the video tutorial below:
"CLICK HERE"
>>> DNA = input("please enter your DNA sequence below: \n")
please enter your DNA sequence below:
"ATGCTGGATGCACACCGTCGATCGTATATTAAA"
>>> A = "A"
>>> T = "T"
>>> C = "C"
>>> G = "G"
>>> print("Adenine count is :",DNA.count(A))
Adenine count is : 10
>>> print("Thymine count is :",DNA.count(T))
Thymine count is : 9
>>> print("Cytosine count is :",DNA.count(C))
Cytosine count is : 7
>>> print("Guanine count is :",DNA.count(G))
Guanine count is : 7
>>> print("the total number of Nucleotides in your DNA seq is :",DNA.count(A)+ DNA.count(T)+DNA.count(C)+DNA.count(G))
the total number of Nucleotides in your DNA seq is : 33
_____________________________________________________________________________
To understand this procedure more easily you may need to watch the video tutorial below:
"CLICK HERE"
No comments:
Post a Comment