1+ {
2+ "nbformat" : 4 ,
3+ "nbformat_minor" : 0 ,
4+ "metadata" : {
5+ "colab" : {
6+ "provenance" : [],
7+ "authorship_tag" : " ABX9TyMjbzVd8eLCiO4IlNk5wBCD" ,
8+ "include_colab_link" : true
9+ },
10+ "kernelspec" : {
11+ "name" : " python3" ,
12+ "display_name" : " Python 3"
13+ },
14+ "language_info" : {
15+ "name" : " python"
16+ }
17+ },
18+ "cells" : [
19+ {
20+ "cell_type" : " markdown" ,
21+ "metadata" : {
22+ "id" : " view-in-github" ,
23+ "colab_type" : " text"
24+ },
25+ "source" : [
26+ " <a href=\" https://colab.research.google.com/github/Siddharth-lab-cmd/python-bioinformatics-basics/blob/main/Genomic_GC_Analysis.ipynb\" target=\" _parent\" ><img src=\" https://colab.research.google.com/assets/colab-badge.svg\" alt=\" Open In Colab\" /></a>"
27+ ]
28+ },
29+ {
30+ "cell_type" : " code" ,
31+ "execution_count" : 1 ,
32+ "metadata" : {
33+ "colab" : {
34+ "base_uri" : " https://localhost:8080/"
35+ },
36+ "id" : " 4ul2-PKqbks7" ,
37+ "outputId" : " 7424d0c9-c985-4db6-d0f5-94f66d6a3518"
38+ },
39+ "outputs" : [
40+ {
41+ "output_type" : " stream" ,
42+ "name" : " stdout" ,
43+ "text" : [
44+ " 🧬 --- Genomic Sequence Analysis --- 🧬\n " ,
45+ " Sequence: ATCGATCGATGGATCGATCG\n " ,
46+ " Total Base Pairs: 20\n " ,
47+ " GC Percentage Score: 50.00%\n "
48+ ]
49+ }
50+ ],
51+ "source" : [
52+ " # Our first cloud bioinformatics calculation\n " ,
53+ " dna_sequence = \" ATCGATCGATGGATCGATCG\"\n " ,
54+ " \n " ,
55+ " # Calculate total length\n " ,
56+ " total_length = len(dna_sequence)\n " ,
57+ " \n " ,
58+ " # Calculate GC count using built-in counts\n " ,
59+ " g_count = dna_sequence.count(\" G\" )\n " ,
60+ " c_count = dna_sequence.count(\" C\" )\n " ,
61+ " gc_total = g_count + c_count\n " ,
62+ " \n " ,
63+ " # Compute percentage matrix score\n " ,
64+ " gc_percentage = (gc_total / total_length) * 100\n " ,
65+ " \n " ,
66+ " print(\" 🧬 --- Genomic Sequence Analysis --- 🧬\" )\n " ,
67+ " print(f\" Sequence: {dna_sequence}\" )\n " ,
68+ " print(f\" Total Base Pairs: {total_length}\" )\n " ,
69+ " print(f\" GC Percentage Score: {gc_percentage:.2f}%\" )\n "
70+ ]
71+ }
72+ ]
73+ }
0 commit comments