Skip to content

dipraj02/DNA-Sequence-Analyzer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 

Repository files navigation

🧬 DNA Sequence Analyzer

A lightweight Python tool to analyze DNA sequences β€” directly from a file or user input β€” and get insights like base composition, GC content, transcription, translation, and reverse complement.


πŸš€ Features

  • βœ… DNA Validation – Ensures the input contains only valid bases: A, T, G, C
  • πŸ”’ Base Counting – Counts total occurrences and percentage of each nucleotide
  • πŸ§ͺ GC Content Calculation – Measures GC richness of the sequence
  • πŸ” Reverse Complement – Generates the reverse complement strand
  • πŸ”¬ Transcription – Converts DNA to RNA by replacing T with U
  • 🧬 Translation – Translates DNA into a protein sequence using a codon table

πŸ“¦ Requirements

  • Python 3.x
    (No external libraries required)

πŸ“ Input Options

You can analyze DNA from:

  1. A text file (.txt)
    Format: Plain sequence (A/T/G/C only), optionally multiline

  2. Manual input
    Just paste your DNA sequence when prompted


πŸ› οΈ How It Works

Run the script: python dna_analyzer.py

Then follow the interactive prompt: πŸ“‚ Do you have a file? (yes/no): yes πŸ“ Enter your DNA file path or name (.txt): my_sequence.txt

Sample output: βœ… DNA is valid!

🧾 Base Count: {'A': 22, 'T': 20, 'G': 18, 'C': 15} πŸ“Š Base Percentage: {'A': '29.33%', 'T': '26.67%', 'G': '24.00%', 'C': '20.00%'}

πŸ§ͺ GC Content: 44.0%

πŸ” RNA Sequence: AUGCGUUAAG...

🧬 Protein Sequence: Met-Arg-Stop...

🧬 Reverse Complement: TTACGCTA...


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages