GC content calculation in percentage
Hello!
I have an output of DNA sequences generated in the CSV file format. I would like to know the percentage of GC Content. Is there any way I can write a command statement in Linux to get the GC content in percentage?
Many thanks!
• 2,303 views
•
link
2 answers
There is a bioinformatics tool for linux called Emboss which is great for such tasks. The emboss command you want is geecee
$ sudo apt update && sudo apt install emboss
$ geecee mtdna.fa
Calculate fractional GC content of nucleic acid sequences
Output file [nc_012920.geecee]:
$ cat nc_012920.geecee
#Sequence GC content
NC_012920.1 0.44
• 0 views
•
link
In Python using the PyDNA library:
dna_sequence_string = "ATATATCCCGGGAATTTTCGTAGTTAGGCTGATTTTATTGGCGCGAAAATTT"
gc_content = PyDNA.dna_count_gc_content(dna_sequence_string)
print(“DNA sequence string:\n{}”.format(dna_sequence_string))
print(“GC-content:\n{}”.format(gc_content))
Result:
DNA sequence string: ATATATCCCGGGAATTTTCGTAGTTAGGCTGATTTTATTGGCGCGAAAATTT
GC-content: 36.5%
• 0 views
•
link
Log in to answer this question.