===Complement of a Strand===
 
===Complement of a Strand===
 
Write a sequence of piped text processing commands that, when given a nucleotide sequence, returns its complementary strand.
 
Write a sequence of piped text processing commands that, when given a nucleotide sequence, returns its complementary strand.
#Begin with a cat command to view a text file with a DNA sequence
+
#I begin with a cat command to view a text file with a DNA sequence
#After the pipe character, link together a sed command that invokes a letter by letter replacement of A, T, C, and G with their complementary bases (T, A, G, and C in that order).
+
#After the pipe character, I linked together a sed command that invokes a letter by letter replacement of A, T, C, and G with their complementary bases (T, A, G, and C in that order).
 
  cat ''sequence_file'' | sed "y/atcg/tagc/"
 
  cat ''sequence_file'' | sed "y/atcg/tagc/"
    
====Building the Command Sequences====
 
====Building the Command Sequences====
 
Write ''6'' sets of text processing commands that, when given a nucleotide sequence, returns the resulting amino acid sequence, one for each possible reading frame for the nucleotide sequence.
 
Write ''6'' sets of text processing commands that, when given a nucleotide sequence, returns the resulting amino acid sequence, one for each possible reading frame for the nucleotide sequence.
*To tackle this problem, start by crafting the simplest sequence of commands that will carry out the central dogma by translating DNA sequences to amino acid sequences. This command sequence will serve as the "backbone" from which all 6 reading frame sequences are built. Incidentally, this code will also align with that necessary to transcribe the ''+1 reading frame''.
+
*To tackle this problem, I started by crafting the simplest sequence of commands that carried out the central dogma by translating DNA sequences to amino acid sequences. This command sequence served as the "backbone" from which all 6 reading frame sequences are built. Incidentally, this code also aligned with that necessary to transcribe the ''+1 reading frame''.
*#Begin with a cat command to view a text file with a DNA sequence
+
*#I began with a cat command to view a text file with a DNA sequence
 
*#*cat ''sequence_file''
 
*#*cat ''sequence_file''
*#Add a sed command representing the transcription of DNA to RNA, replacing "T" nucleotides with "U" nucleotides
+
*#I added a sed command that represented the transcription of DNA to RNA, replacing "T" nucleotides with "U" nucleotides
 
*#*cat ''sequence_file'' | sed "s/t/u/g"
 
*#*cat ''sequence_file'' | sed "s/t/u/g"
*#Add a sed command representing the (+1) reading frame for the codons, inserting a space after every three characters
+
*#I added a sed command that represented the (+1) reading frame for the codons and inserted a space after every three characters
 
*#*cat ''sequence_file'' | sed "s/t/u/g" | sed "s/.../& /g"
 
*#*cat ''sequence_file'' | sed "s/t/u/g" | sed "s/.../& /g"
*#Add a sed command to translate each codon to its associated amino acid. For this exercise, the simplest way to do this is to read from the rules file ''~dondi/xmlpipedb/data/genetic-code.sed''
+
*#I added a sed command to translate each codon to its associated amino acid. For this exercise, the simplest way I found to do this was to read from the rules file ''~dondi/xmlpipedb/data/genetic-code.sed''
 
*#*cat ''sequence_file'' | sed "s/t/u/g" | sed "s/.../& /g" | sed -f genetic-code.sed
 
*#*cat ''sequence_file'' | sed "s/t/u/g" | sed "s/.../& /g" | sed -f genetic-code.sed
*#Add a sed command to remove lingering nucleotides at the beginning and/or end of the output that were not translated due to not being present in a triplet in the present reading frame. This will prevent confusing these untranslated nucleotides with amino acids
+
*#I added a sed command to remove lingering nucleotides at the beginning and/or end of the output that were not translated due to not being present in a triplet in the present reading frame. This prevented confusing these untranslated nucleotides with amino acids
 
*#*cat ''sequence_file'' | sed "s/t/u/g" | sed "s/.../& /g" | sed -f genetic-code.sed | sed "[atcg]//g"
 
*#*cat ''sequence_file'' | sed "s/t/u/g" | sed "s/.../& /g" | sed -f genetic-code.sed | sed "[atcg]//g"
*#Finally, remove spaces from in between the separate amino acid designations to condense the output (has both aesthetic and practical purposes). This will yield the final command sequence:
+
*#Finally, I removed spaces from in between the separate amino acid designations to condense the output (has both aesthetic and practical purposes). This yielded the final command sequence:
 
*#*cat ''sequence_file'' | sed "s/t/u/g" | sed "s/.../& /g" | sed -f genetic-code.sed | sed "s/[atcg]//g" | sed "s/ //g"
 
*#*cat ''sequence_file'' | sed "s/t/u/g" | sed "s/.../& /g" | sed -f genetic-code.sed | sed "s/[atcg]//g" | sed "s/ //g"
    
*'''+1 Reading Frame'''
 
*'''+1 Reading Frame'''
**The command sequence above already processes the genetic code within the +1 reading frame:
+
**The command sequence above already processed the genetic code within the +1 reading frame:
 
  cat ''sequence_file'' | sed "s/t/u/g" | sed "s/.../& /g" | sed -f genetic-code.sed | sed "s/[atcg]//g" | sed "s/ //g"
 
  cat ''sequence_file'' | sed "s/t/u/g" | sed "s/.../& /g" | sed -f genetic-code.sed | sed "s/[atcg]//g" | sed "s/ //g"
 
*'''+2 Reading Frame'''
 
*'''+2 Reading Frame'''
**Simply alter the +1 reading frame code to include a sed command for the deletion of the first character of the text file (i.e. nucleotide) prior to division into triplets:
+
**I simply altered the +1 reading frame code to include a sed command for the deletion of the first character of the text file (i.e. nucleotide) prior to division into triplets:
 
  cat ''sequence_file'' | sed "s/t/u/g" | sed "s/^.//g" | sed "s/.../& /g" | sed -f genetic-code.sed | sed "s/[atcg]//g" | sed "s/ //g"
 
  cat ''sequence_file'' | sed "s/t/u/g" | sed "s/^.//g" | sed "s/.../& /g" | sed -f genetic-code.sed | sed "s/[atcg]//g" | sed "s/ //g"
 
*'''+3 Reading Frame'''
 
*'''+3 Reading Frame'''
**Alter the +1 reading frame code to include a sed command for the deletion of the first ''two'' characters of the text file (i.e. nucleotides) prior to division into triplets:
+
**I altered the +1 reading frame code to include a sed command for the deletion of the first ''two'' characters of the text file (i.e. nucleotides) prior to division into triplets:
 
  cat ''sequence_file'' | sed "s/t/u/g" | sed "s/^..//g" | sed "s/.../& /g" | sed -f genetic-code.sed | sed "s/[atcg]//g" | sed "s/ //g"
 
  cat ''sequence_file'' | sed "s/t/u/g" | sed "s/^..//g" | sed "s/.../& /g" | sed -f genetic-code.sed | sed "s/[atcg]//g" | sed "s/ //g"
 
*'''-1 Reading Frame'''
 
*'''-1 Reading Frame'''
**The "backbone" command sequence from above will have to be slightly altered for the negative reading frames to account for the reading of a complimentary, antiparallel strand of DNA
+
**The "backbone" command sequence from above had to be slightly altered for the negative reading frames to account for the reading of a complimentary, antiparallel strand of DNA
 
**#Begin with the code from the +1 reading frame
 
**#Begin with the code from the +1 reading frame
 
**#*cat ''sequence_file'' | sed "s/t/u/g" | sed "s/.../& /g" | sed -f genetic-code.sed | sed "s/[atcg]//g" | sed "s/ //g"
 
**#*cat ''sequence_file'' | sed "s/t/u/g" | sed "s/.../& /g" | sed -f genetic-code.sed | sed "s/[atcg]//g" | sed "s/ //g"
**#Add the sed command from the "Compliment of a Strand" section above at the beginning of this sequence. This will yield the DNA sequence complimentary to that which we were originally working with
+
**#I added the sed command from the "Compliment of a Strand" section above at the beginning of this sequence. This yielded the DNA sequence complimentary to that which we were originally working with
 
**#*cat ''sequence_file'' | sed "y/atcg/tagc/" | sed "s/t/u/g" | sed "s/.../& /g" | sed -f genetic-code.sed | sed "s/[atcg]//g" | sed "s/ //g"
 
**#*cat ''sequence_file'' | sed "y/atcg/tagc/" | sed "s/t/u/g" | sed "s/.../& /g" | sed -f genetic-code.sed | sed "s/[atcg]//g" | sed "s/ //g"
Exception encountered, of type "Error"
[d7f299d7] /biodb/fall2015/index.php?diff=prev&oldid=1490&title=Bklein7_Week_3 Error from line 434 of /apps/xmlpipedb/biodb/fall2015/includes/diff/DairikiDiff.php: Call to undefined function each()
Backtrace:
#0 /apps/xmlpipedb/biodb/fall2015/includes/diff/DairikiDiff.php(544): DiffEngine->diag()
#1 /apps/xmlpipedb/biodb/fall2015/includes/diff/DairikiDiff.php(344): DiffEngine->compareSeq()
#2 /apps/xmlpipedb/biodb/fall2015/includes/diff/DairikiDiff.php(227): DiffEngine->diffLocal()
#3 /apps/xmlpipedb/biodb/fall2015/includes/diff/DairikiDiff.php(721): DiffEngine->diff()
#4 /apps/xmlpipedb/biodb/fall2015/includes/diff/DairikiDiff.php(859): Diff->__construct()
#5 /apps/xmlpipedb/biodb/fall2015/includes/diff/DairikiDiff.php(980): MappedDiff->__construct()
#6 /apps/xmlpipedb/biodb/fall2015/includes/diff/TableDiffFormatter.php(194): WordLevelDiff->__construct()
#7 /apps/xmlpipedb/biodb/fall2015/includes/diff/DiffFormatter.php(140): TableDiffFormatter->changed()
#8 /apps/xmlpipedb/biodb/fall2015/includes/diff/DiffFormatter.php(82): DiffFormatter->block()
#9 /apps/xmlpipedb/biodb/fall2015/includes/diff/DifferenceEngine.php(888): DiffFormatter->format()
#10 /apps/xmlpipedb/biodb/fall2015/includes/diff/DifferenceEngine.php(802): DifferenceEngine->generateTextDiffBody()
#11 /apps/xmlpipedb/biodb/fall2015/includes/diff/DifferenceEngine.php(733): DifferenceEngine->generateContentDiffBody()
#12 /apps/xmlpipedb/biodb/fall2015/includes/diff/DifferenceEngine.php(662): DifferenceEngine->getDiffBody()
#13 /apps/xmlpipedb/biodb/fall2015/includes/diff/DifferenceEngine.php(632): DifferenceEngine->getDiff()
#14 /apps/xmlpipedb/biodb/fall2015/includes/diff/DifferenceEngine.php(453): DifferenceEngine->showDiff()
#15 /apps/xmlpipedb/biodb/fall2015/includes/page/Article.php(795): DifferenceEngine->showDiffPage()
#16 /apps/xmlpipedb/biodb/fall2015/includes/page/Article.php(506): Article->showDiffPage()
#17 /apps/xmlpipedb/biodb/fall2015/includes/actions/ViewAction.php(44): Article->view()
#18 /apps/xmlpipedb/biodb/fall2015/includes/MediaWiki.php(395): ViewAction->show()
#19 /apps/xmlpipedb/biodb/fall2015/includes/MediaWiki.php(273): MediaWiki->performAction()
#20 /apps/xmlpipedb/biodb/fall2015/includes/MediaWiki.php(566): MediaWiki->performRequest()
#21 /apps/xmlpipedb/biodb/fall2015/includes/MediaWiki.php(414): MediaWiki->main()
#22 /apps/xmlpipedb/biodb/fall2015/index.php(44): MediaWiki->run()
#23 {main}