Group Bioinformatics Assignments

Q1: Assignment: DNA Sequence Analysis. Analyze a given DNA sequence and perform basic sequence manipulation, including finding motifs, calculating GC content, and identifying candidate coding regions. Summarize the analysis results and insights gained from the sequence.

DNA Sequence Analysis

Solution and implementation for Q1 from Bioinformatics (bif).

1_dna_sequence_analysis.py Download
dna = "ATGCGTACGTTAGCGATCGATGCTAGCTAGCGATCGATGCGTAA"

print("DNA:", dna)
print("Length:", len(dna))

for b in "ATGC":
    print(b, dna.count(b))

print("GC%:", round((dna.count("G") + dna.count("C")) / len(dna) * 100, 2))

print("ATG Motif:", dna.count("ATG"))

c = dna.translate(str.maketrans("ATGC", "TACG"))

print("Complement:", c)
print("Reverse Complement:", c[::-1])

for i in range(len(dna) - 2):
    if dna[i:i+3] == "ATG":
        for j in range(i+3, len(dna)-2, 3):
            if dna[j:j+3] in ["TAA", "TAG", "TGA"]:
                print("ORF:", dna[i:j+3])
                break

Other Questions in Bioinformatics

See All Available Questions
Download