{"id":4313,"date":"2008-06-17T01:21:00","date_gmt":"2008-06-17T01:21:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/vbteam\/2008\/06\/17\/protein-is-good-for-you-matt-gertz\/"},"modified":"2024-07-05T14:21:30","modified_gmt":"2024-07-05T21:21:30","slug":"protein-is-good-for-you-matt-gertz","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/vbteam\/protein-is-good-for-you-matt-gertz\/","title":{"rendered":"Protein is Good for You (Matt Gertz)"},"content":{"rendered":"<p class=\"MsoNormal\"><font size=\"3\"><font face=\"Calibri\">As I was preparing to graduate from the University of Michigan way back in the late eighties, I had a big decision to make regarding grad school &ndash; robotics at Carnegie Mellon, or biology at Washington State?<span>&nbsp; <\/span>On the one hand, biology was something I&rsquo;d always really loved, having even intended to go to med school at one point.<span>&nbsp; <\/span>On the other hand, robotics was <s>more likely to help me pay off my debts<\/s> a very exciting field with a lot of challenges still ahead of it.<span>&nbsp; <\/span>Ultimately, I chose robotics (gaining a degree that, to this day, I have never used), but I often wonder what it might have been like to go into biology.<span>&nbsp; <\/span><\/font><\/font><\/p>\n<p class=\"MsoNormal\"><font size=\"3\"><font face=\"Calibri\">Anyway, back when I was dating my future wife (who was in the molecular biology graduate program), I wrote a quick&rsquo;n&rsquo;dirty program to translate DNA coding sequences to chains of amino acids for her advisor.<span>&nbsp; <\/span>That was fun, and I got feel like I was participating in the research (in a very teeny-tiny way).<span>&nbsp; <\/span>Beyond that, I haven&rsquo;t had much interaction with hands-on biology work in many years, although I try to keep up with what&rsquo;s going on.<span>&nbsp; <\/span>Recently, though, I&rsquo;ve been scrambling trying to come up with new ideas for blog articles, and that program I wrote nearly 18 years ago came to mind.<span>&nbsp; <\/span>I&rsquo;d never been happy with the visualization of the data, so I decided to give it a second try, this time using the WPF designer to help me out.<span>&nbsp; <\/span><\/font><\/font><\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">In this blog, I&rsquo;ll cover the creation of a program to translate DNA from proteins, and tomorrow I&rsquo;ll talk about visualizing the results using StackPanel controls.<span>&nbsp; <\/span>The overall example requires VS2008 or later to code up, although today&rsquo;s blog code is mostly machinery that would pretty much work on either WinForms or WPF.<\/font><\/p>\n<h2><font face=\"Cambria\" color=\"#4f81bd\" size=\"4\">&ldquo;Captain&hellip; the alien virus is rewriting his DNA!<span>&nbsp; <\/span>He&rsquo;s changing!&rdquo;<\/font><\/h2>\n<p class=\"MsoNormal\"><font size=\"3\"><font face=\"Calibri\">One of the problems in being both a computer specialist and also somewhat knowledgeable about biology is that it&rsquo;s very difficult to make it through your average Star Trek episode, between the bad computer science and the bad biology.<span>&nbsp; <\/span>(For the record, changing your DNA won&rsquo;t change your appearance, since the protein structures they code for already exist and represent roughly seven years of dead-end energy investment on your part.<span>&nbsp; <\/span>If you&rsquo;re lucky, any changes will have no impact at all or even be beneficial; if you&rsquo;re less lucky, the cell will die or cause some deleterious behavior.)<span>&nbsp; <\/span>At any rate, this will be a simple DNA\/RNA\/protein visualization program, and no DNA altering will be allowed. <\/font><span><span>J<\/span><\/span><\/font><\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">I&rsquo;m not going to give a big overview on DNA transcription; if you don&rsquo;t remember enough from school to follow along, the <\/font><a href=\"http:\/\/en.wikipedia.org\/wiki\/DNA\"><font face=\"Calibri\" color=\"#800080\" size=\"3\">Wikipedia article on DNA<\/font><\/a><font size=\"3\"><font face=\"Calibri\"> is pretty good for refreshing one&rsquo;s memory (as I found out).<span>&nbsp; <\/span>For the purposes of this exercise, we&rsquo;ll just note that DNA is used to determine which proteins are created for a cell:<span>&nbsp; <\/span><\/font><\/font><\/p>\n<p class=\"MsoListParagraphCxSpFirst\"><span><span><font face=\"Calibri\" size=\"3\">(1)<\/font><span>&nbsp;&nbsp;&nbsp; <\/span><\/span><\/span><font face=\"Calibri\" size=\"3\">DNA is comprised of a combination of 4 base pairs (<b>A<\/b>, <b>T<\/b>, <b>C<\/b>, <b>G<\/b>) connected longitudinally by a sugar\/phosphate group and latitudinally by hydrogen bonds.<span>&nbsp; <\/span><b>A<\/b> (adenine) always connects latitudinally to <b>T<\/b> (thymine), and <b>C<\/b> (cytosine) always connects to <b>G <\/b>(guanine).<\/font><\/p>\n<p class=\"MsoListParagraphCxSpMiddle\"><span><span><font face=\"Calibri\" size=\"3\">(2)<\/font><span>&nbsp;&nbsp;&nbsp; <\/span><\/span><\/span><font face=\"Calibri\" size=\"3\">During transcription, the DNA (a double-helix) in a given chromosome is cut down the middle<\/font><\/p>\n<p class=\"MsoListParagraphCxSpMiddle\"><span><span><font face=\"Calibri\" size=\"3\">(3)<\/font><span>&nbsp;&nbsp;&nbsp; <\/span><\/span><\/span><font face=\"Calibri\" size=\"3\">An mRNA (&ldquo;messenger RNA&rdquo;) string is built up from the DNA side which contains the appropriate information for that part of the string.<span>&nbsp; <\/span><span>&nbsp;<\/span>(RNA is very similar to DNA except that the connective sugar is ribose instead of deoxyribose, and thymine is replaced with uracil (<b>U<\/b>)).<span>&nbsp; <\/span>The resulting mRNA string is an inverse copy of the strand it copied.<span>&nbsp; <\/span>I&rsquo;ll be using the terms mRNA and RNA interchangeably for the purpose of this blog.<\/font><\/p>\n<p class=\"MsoListParagraphCxSpLast\"><span><span><font face=\"Calibri\" size=\"3\">(4)<\/font><span>&nbsp;&nbsp;&nbsp; <\/span><\/span><\/span><font face=\"Calibri\" size=\"3\">Amino acids are assembled together based on the sequence of the mRNA.<span>&nbsp; <\/span>It takes three bases to code for one amino, so given four bases, there are 4^3 = 64 possible combinations for a given triplet (codon) of bases.<span>&nbsp; <\/span>Some codons code for the same amino; there are 20 standard aminos mapping to 61 codons.<span>&nbsp; <\/span>(Three of the possible codons simply indicate the end of a sequence; one codon indicates the start of a sequence and also codes for a specific amino, methionine.)<\/font><\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">Basically, the plan for the program is this:<span>&nbsp; <\/span>allow the user to read in a sequence of DNA, automatically convert it to an mRNA sequence, and then convert it to zero or more sequences of amino acids.<span>&nbsp; <\/span>We&rsquo;ll then throw a visual representation of all strings onto the form.<\/font><\/p>\n<h2><font face=\"Cambria\" color=\"#4f81bd\" size=\"4\">The basic application<\/font><\/h2>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">First, I&rsquo;ll create a new WPF application called &ldquo;VBProtein.&rdquo;<span>&nbsp; <\/span>On its grid, I&rsquo;m going to throw three main controls:<\/font><\/p>\n<p class=\"MsoListParagraphCxSpFirst\"><span><span><font face=\"Calibri\" size=\"3\">(1)<\/font><span>&nbsp;&nbsp;&nbsp; <\/span><\/span><\/span><font face=\"Calibri\" size=\"3\">A <b>ScrollViewer<\/b> control for display the sequences graphically.<span>&nbsp; <\/span>I&rsquo;ll set mine to be 112 pixels high (enough for three rows of sequences of height 32 pixels plus the scrollbar).<span>&nbsp; <\/span>In the properties of the ScrollViewer, I&rsquo;ll set &ldquo;HorizontalScrollbarVisibility&rdquo; to &ldquo;Visible&rdquo; and &ldquo;VerticalScrollbarVisibility&rdquo; to &ldquo;Disabled,&rdquo; since the sequences will be listed left-to-right.<span>&nbsp; <\/span>I&rsquo;ve also set its &ldquo;TabIndex&rdquo; to &ldquo;0&rdquo;.<\/font><\/p>\n<p class=\"MsoListParagraphCxSpMiddle\"><span><span><font face=\"Calibri\" size=\"3\">(2)<\/font><span>&nbsp;&nbsp;&nbsp; <\/span><\/span><\/span><font face=\"Calibri\" size=\"3\">A <b>Button<\/b> control labeled &ldquo;Load&rdquo; (&ldquo;TabIndex&rdquo; = &ldquo;1&rdquo;).<\/font><\/p>\n<p class=\"MsoListParagraphCxSpLast\"><span><span><font face=\"Calibri\" size=\"3\">(3)<\/font><span>&nbsp;&nbsp;&nbsp; <\/span><\/span><\/span><font face=\"Calibri\" size=\"3\">A <b>Button<\/b> control labeled &ldquo;Save&rdquo; (&ldquo;TabIndex&rdquo; = &ldquo;2&rdquo;).<\/font><\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">I&rsquo;ve also added a few label controls and changed a few colors, but that&rsquo;s the all of the important stuff.<span>&nbsp; <\/span>Everything else gets added in code, so let&rsquo;s ta\nke a look at that.<span>&nbsp;&nbsp; <\/span>Double-click on the window frame to generate the Window1_Loaded event.<span>&nbsp; <\/span>We&rsquo;ll populate it later, but for the moment we&rsquo;ll concentrate on the members we&rsquo;ll need for the application.<span>&nbsp; <\/span>These are:<\/font><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp; <\/span><span>Public<\/span> Translations <span>As<\/span> <span>New<\/span> Microsoft.VisualBasic.Collection<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp; <\/span><span>Public<\/span> DNA <span>As<\/span> <span>String<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp; <\/span><span>Public<\/span> RNA <span>As<\/span> <span>String<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp; <\/span><span>Public<\/span> Proteins <span>As<\/span> <span>New<\/span> List(<span>Of<\/span> <span>String<\/span>)<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p>&nbsp;<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">We&rsquo;ll load in the value of DNA, translate it to RNA, and then translate that to the Proteins &ndash; in other words, we&rsquo;ll deal with those later.<span>&nbsp; <\/span>Let&rsquo;s worry about the Translations instead.<\/font><\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">For the translations, I decided to go with a Collection since they are easy to work with, they support keys for lookup, and I&rsquo;m not dealing with too many objects &ndash; just the 64 possible codons.<span>&nbsp; <\/span>There&rsquo;s a lot of information I&rsquo;ll want to keep with each Translation:<\/font><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp; <\/span><span>Enum<\/span> Sequence<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Normal = 0<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>SequenceStart = 1<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>SequenceStop = 2<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp; <\/span><span>End<\/span> <span>Enum<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp; <\/span><span>Class<\/span> Translation<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span>Public<\/span> <span>Sub<\/span> <span>New<\/span>(<span>ByVal<\/span> Triplet <span>As<\/span> <span>String<\/span>, <span>ByVal<\/span> Acid <span>As<\/span> <span>String<\/span>, _<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>ByVal<\/span><span> Mnem <span>As<\/span> <span>Char<\/span>, <span>ByVal<\/span> Clue <span>As<\/span> Sequence)<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Codon = Triplet<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Amino = Acid<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>shortAmino = Mnem<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Usage = Clue<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span>End<\/span> <span>Sub<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span>Public<\/span> <span>Overrides<\/span> <span>Function<\/span> ToString() <span>As<\/span> <span>String<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span>Return<\/span> Codon<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span>End<\/span> <span>Function<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span>Public<\/span> Codon <span>As<\/span> <span>String<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span>Public<\/span> Amino <span>As<\/span> <span>String<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span>Public<\/span> shortAmino <span>As<\/span> <span>Char<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span>Public<\/span> Usage <span>As<\/span> Sequence<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp; <\/span><span>End<\/span> <span>Class<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p>&nbsp;<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">Note that I&rsquo;m overriding the &ldquo;ToString&rdquo; method to return the Codon value, which I&rsquo;ll be using as a key in the collection.<span>&nbsp;&nbsp; <\/span>With this structure, I can initialize the translation collection (abridged from the actual code for the purposes of legibility):<\/font><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp; <\/span><span>Private<\/span> <span>Sub<\/span> InitializeTranslations()<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Translations.Add(<span>New<\/span> Translation(<span>&#8220;UUU&#8221;<\/span>, <span>&#8220;Phe&#8221;<\/span>, <span>&#8220;F&#8221;<\/span>, Sequence.Normal), <span>&#8220;UUU&#8221;<\/span>) <span>&#8216; Phenylalanine<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Translations.Add(<span>New<\/span> Translation(<span>&#8220;UUC&#8221;<\/span>, <span>&#8220;Phe&#8221;<\/span>, <span>&#8220;F&#8221;<\/span>, Sequence.Normal), <span>&#8220;UUC&#8221;<\/span>) <span>&#8216; Phenylalanine<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Translations.Add(<span>New<\/span> Translation(<span>&#8220;UAA&#8221;<\/span>, <span>&#8220;OCH&#8221;<\/span>, <span>&#8220;.&#8221;<\/span>, Sequence.SequenceStop), <span>&#8220;UAA&#8221;<\/span>) <span>&#8216; Ochre stop sequence<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Translations.Add(<span>New<\/span> Translation(<span>&#8220;UAG&#8221;<\/span>, <span>&#8220;AMB&#8221;<\/span>, <span>&#8220;.&#8221;<\/span>, Sequence.SequenceStop), <span>&#8220;UAG&#8221;<\/span>) <span>&#8216; Amber stop sequence<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p>&nbsp;<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Translations.Add(<span>New<\/span> Translation(<span>&#8220;UGA&#8221;<\/span>, <span>&#8220;OPA&#8221;<\/span>, <span>&#8220;.&#8221;<\/span>, Sequence.SequenceStop), <span>&#8220;UGA&#8221;<\/span>) <span>&#8216; Opal stop sequence<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Translations.Add(<span>New<\/span> Translation(<span>&#8220;AUG&#8221;<\/span>, <span>&#8220;Met&#8221;<\/span>, <span>&#8220;M&#8221;<\/span>, Sequence.SequenceStart), <span>&#8220;AUG&#8221;<\/span>) <span>&#8216; Methionine<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p>&nbsp;<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>&#8216; Etc&hellip;<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p>&nbsp;<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp; <\/span><span>End<\/span> <span>Sub<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p>&nbsp;<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">Each translation has a codon, the abbreviated name of the matching amino, the one-character name of the matching amino (which I never use, but what the heck), and a setting which determines if this is a normal codon, a starting codon, or a stopping codon.<\/font><\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">Now, in the Window1_Load code, I&rsquo;ll add the following:<\/font><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>InitializeTranslations()<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>SaveResultsBtn.IsEnabled = <span>False<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p>&nbsp;<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">(The second line is unrelated to the previous code and just disables the Save button until we have something to s\nave.)<\/font><\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">I can now start writing the functional code.<span>&nbsp; <\/span>Back on the grid, I&rsquo;ll double-click the &ldquo;Load&rdquo; button, and in the resulting <\/font><span>LoadSequenceBtn_Click <\/span><font face=\"Calibri\" size=\"3\">event, I&rsquo;ll add the following code:<\/font><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span>&#8216; Load in the file<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span>Dim<\/span> dlg <span>As<\/span> <span>New<\/span> OpenFileDialog<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>dlg.Filter = <span>My<\/span>.Resources.FILT_FileFilter<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span>If<\/span> dlg.ShowDialog() = <span>True<\/span> <span>Then<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>DNA = <span>My<\/span>.Computer.FileSystem.ReadAllText(dlg.SafeFileName)<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span>End<\/span> <span>If<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p>&nbsp;<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><font size=\"3\"><font face=\"Calibri\">As you can see, first I&rsquo;m throwing up a file dialog to get the name of the file to load (which is just a TXT file fille<\/font><\/font><\/span><\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>As I was preparing to graduate from the University of Michigan way back in the late eighties, I had a big decision to make regarding grad school &ndash; robotics at Carnegie Mellon, or biology at Washington State?&nbsp; On the one hand, biology was something I&rsquo;d always really loved, having even intended to go to med [&hellip;]<\/p>\n","protected":false},"author":258,"featured_media":8818,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[22,195],"tags":[101,166,183],"class_list":["post-4313","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-matt-gertz","category-visual-basic","tag-matt-gertz","tag-vb2008","tag-wpf"],"acf":[],"blog_post_summary":"<p>As I was preparing to graduate from the University of Michigan way back in the late eighties, I had a big decision to make regarding grad school &ndash; robotics at Carnegie Mellon, or biology at Washington State?&nbsp; On the one hand, biology was something I&rsquo;d always really loved, having even intended to go to med [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/vbteam\/wp-json\/wp\/v2\/posts\/4313","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/vbteam\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/vbteam\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/vbteam\/wp-json\/wp\/v2\/users\/258"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/vbteam\/wp-json\/wp\/v2\/comments?post=4313"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/vbteam\/wp-json\/wp\/v2\/posts\/4313\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/vbteam\/wp-json\/wp\/v2\/media\/8818"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/vbteam\/wp-json\/wp\/v2\/media?parent=4313"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/vbteam\/wp-json\/wp\/v2\/categories?post=4313"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/vbteam\/wp-json\/wp\/v2\/tags?post=4313"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}