{"id":493,"date":"2024-07-17T15:40:17","date_gmt":"2024-07-17T15:40:17","guid":{"rendered":"https:\/\/mahtabio.com\/?p=493"},"modified":"2025-10-23T21:24:15","modified_gmt":"2025-10-23T21:24:15","slug":"cs50-final-project-inrtroduction-to-programming-with-python","status":"publish","type":"post","link":"https:\/\/mahtabio.com\/?p=493","title":{"rendered":"CS50 Final Project: Inrtroduction to Programming with Python"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"493\" class=\"elementor elementor-493\" data-elementor-post-type=\"post\">\n\t\t\t\t<div class=\"elementor-element elementor-element-643b994 e-flex e-con-boxed e-con e-parent\" data-id=\"643b994\" data-element_type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-a14f22f elementor-widget elementor-widget-heading\" data-id=\"a14f22f\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<style>\/*! elementor - v3.21.0 - 26-05-2024 *\/\n.elementor-heading-title{padding:0;margin:0;line-height:1}.elementor-widget-heading .elementor-heading-title[class*=elementor-size-]>a{color:inherit;font-size:inherit;line-height:inherit}.elementor-widget-heading .elementor-heading-title.elementor-size-small{font-size:15px}.elementor-widget-heading .elementor-heading-title.elementor-size-medium{font-size:19px}.elementor-widget-heading .elementor-heading-title.elementor-size-large{font-size:29px}.elementor-widget-heading .elementor-heading-title.elementor-size-xl{font-size:39px}.elementor-widget-heading .elementor-heading-title.elementor-size-xxl{font-size:59px}<\/style><h2 class=\"elementor-heading-title elementor-size-default\">CS50 Final Project: Introduction to Programming with Python\n<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-5301062 e-flex e-con-boxed e-con e-parent\" data-id=\"5301062\" data-element_type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-4e7e110 elementor-widget elementor-widget-text-editor\" data-id=\"4e7e110\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<style>\/*! elementor - v3.21.0 - 26-05-2024 *\/\n.elementor-widget-text-editor.elementor-drop-cap-view-stacked .elementor-drop-cap{background-color:#69727d;color:#fff}.elementor-widget-text-editor.elementor-drop-cap-view-framed .elementor-drop-cap{color:#69727d;border:3px solid;background-color:transparent}.elementor-widget-text-editor:not(.elementor-drop-cap-view-default) .elementor-drop-cap{margin-top:8px}.elementor-widget-text-editor:not(.elementor-drop-cap-view-default) .elementor-drop-cap-letter{width:1em;height:1em}.elementor-widget-text-editor .elementor-drop-cap{float:left;text-align:center;line-height:1;font-size:50px}.elementor-widget-text-editor .elementor-drop-cap-letter{display:inline-block}<\/style>\t\t\t\t<div class=\"markdown-heading\" dir=\"auto\"><h4 dir=\"auto\" tabindex=\"-1\"><a href=\"https:\/\/github.com\/Leemoonus\/dna-sequence-alignment\">GitHub link<\/a><\/h4><h4 class=\"heading-element\" dir=\"auto\" tabindex=\"-1\"><strong>Description:<\/strong> The program aligns two DNA sequences globally using the Needleman-Wunsch algorithm. This algorithm is particularly useful for identifying the differences between two similar sequences. Normally, you would have to manually create a matrix and calculate the best value for each cell in the matrix, followed by identifying the pathway between each cell to determine the gaps, mismatches, and matches between the sequences. However, for longer sequences, these manual steps can be time-consuming and complex. To simplify this process, I have developed a program that can perform these tasks effortlessly. You just need to input your sequences, and the program will handle the rest!<\/h4><\/div><div class=\"markdown-heading\" dir=\"auto\"><h4 class=\"heading-element\" dir=\"auto\" tabindex=\"-1\"><strong>Program structure:<\/strong> The program contains four functions (other than the main function). 1. The &#8220;validity_checker&#8221; function which checks the query and target sequences to ensure they are standard. 2. The &#8220;needleman_wunsch_algorithm&#8221; function which creates a matrix, finds the highest value for each cell, and finally returns the results as two lists of sequences, with &#8220;-&#8221; if needed. 3. The &#8220;needle_to_string&#8221; function creates required lines (\u201c|\u201d) if there are matches between sequences and returns the lines and sequences as strings. 4. The &#8220;alignment_type_checker&#8221; function that returns each string in 100 characters per line, in either colorful or colorless format based on the user&#8217;s preference.<\/h4><\/div><div class=\"markdown-heading\" dir=\"auto\"><h4 class=\"heading-element\" dir=\"auto\" tabindex=\"-1\"><strong>Testing the program:<\/strong> The program was tested with the module &#8220;Pytest&#8221; and it passed all the tests successfully.\u00a0<\/h4><\/div><h4 class=\"heading-element\" dir=\"auto\" tabindex=\"-1\"><strong>Limitations:<\/strong> The program can only align two sequences, which could sometimes be a problem. It also does not save your results, so you must analyze them in the terminal section.<\/h4>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-5faea59 e-flex e-con-boxed e-con e-parent\" data-id=\"5faea59\" data-element_type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-61fef17 elementor-widget elementor-widget-video\" data-id=\"61fef17\" data-element_type=\"widget\" data-settings=\"{&quot;youtube_url&quot;:&quot;https:\\\/\\\/youtu.be\\\/ffddjXs-Y2k?si=K4kjXfztCKhqoy5K&quot;,&quot;mute&quot;:&quot;yes&quot;,&quot;modestbranding&quot;:&quot;yes&quot;,&quot;yt_privacy&quot;:&quot;yes&quot;,&quot;video_type&quot;:&quot;youtube&quot;,&quot;controls&quot;:&quot;yes&quot;}\" data-widget_type=\"video.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<style>\/*! elementor - v3.21.0 - 26-05-2024 *\/\n.elementor-widget-video .elementor-widget-container{overflow:hidden;transform:translateZ(0)}.elementor-widget-video .elementor-wrapper{aspect-ratio:var(--video-aspect-ratio)}.elementor-widget-video .elementor-wrapper iframe,.elementor-widget-video .elementor-wrapper video{height:100%;width:100%;display:flex;border:none;background-color:#000}@supports not (aspect-ratio:1\/1){.elementor-widget-video .elementor-wrapper{position:relative;overflow:hidden;height:0;padding-bottom:calc(100% \/ var(--video-aspect-ratio))}.elementor-widget-video .elementor-wrapper iframe,.elementor-widget-video .elementor-wrapper video{position:absolute;top:0;right:0;bottom:0;left:0}}.elementor-widget-video .elementor-open-inline .elementor-custom-embed-image-overlay{position:absolute;top:0;right:0;bottom:0;left:0;background-size:cover;background-position:50%}.elementor-widget-video .elementor-custom-embed-image-overlay{cursor:pointer;text-align:center}.elementor-widget-video .elementor-custom-embed-image-overlay:hover .elementor-custom-embed-play i{opacity:1}.elementor-widget-video .elementor-custom-embed-image-overlay img{display:block;width:100%;aspect-ratio:var(--video-aspect-ratio);-o-object-fit:cover;object-fit:cover;-o-object-position:center center;object-position:center center}@supports not (aspect-ratio:1\/1){.elementor-widget-video .elementor-custom-embed-image-overlay{position:relative;overflow:hidden;height:0;padding-bottom:calc(100% \/ var(--video-aspect-ratio))}.elementor-widget-video .elementor-custom-embed-image-overlay img{position:absolute;top:0;right:0;bottom:0;left:0}}.elementor-widget-video .e-hosted-video .elementor-video{-o-object-fit:cover;object-fit:cover}.e-con-inner>.elementor-widget-video,.e-con>.elementor-widget-video{width:var(--container-widget-width);--flex-grow:var(--container-widget-flex-grow)}<\/style>\t\t<div class=\"elementor-wrapper elementor-open-inline\">\n\t\t\t<div class=\"elementor-video\"><\/div>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-d1dd194 e-flex e-con-boxed e-con e-parent\" data-id=\"d1dd194\" data-element_type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-43622a8 elementor-widget elementor-widget-image\" data-id=\"43622a8\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<style>\/*! elementor - v3.21.0 - 26-05-2024 *\/\n.elementor-widget-image{text-align:center}.elementor-widget-image a{display:inline-block}.elementor-widget-image a img[src$=\".svg\"]{width:48px}.elementor-widget-image img{vertical-align:middle;display:inline-block}<\/style>\t\t\t\t\t\t\t\t\t\t<img fetchpriority=\"high\" decoding=\"async\" width=\"800\" height=\"562\" src=\"https:\/\/mahtabio.com\/wp-content\/uploads\/2024\/07\/Annotation-2024-07-17-205704.png\" class=\"elementor-animation-grow attachment-large size-large wp-image-512\" alt=\"\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>CS50 Final Project: Introduction to Programming with Python GitHub link Description: The program aligns two DNA sequences globally using the Needleman-Wunsch algorithm. This algorithm is particularly useful for identifying the differences between two similar sequences. Normally, you would have to manually create a matrix and calculate the best value for each cell in the matrix, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"elementor_theme","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-493","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/mahtabio.com\/index.php?rest_route=\/wp\/v2\/posts\/493","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mahtabio.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mahtabio.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mahtabio.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mahtabio.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=493"}],"version-history":[{"count":27,"href":"https:\/\/mahtabio.com\/index.php?rest_route=\/wp\/v2\/posts\/493\/revisions"}],"predecessor-version":[{"id":864,"href":"https:\/\/mahtabio.com\/index.php?rest_route=\/wp\/v2\/posts\/493\/revisions\/864"}],"wp:attachment":[{"href":"https:\/\/mahtabio.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=493"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mahtabio.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=493"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mahtabio.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=493"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}