*<code>aaaaggtcggtttaaccggcctttttatt</code> is 29 characters long, and given that <code>aaaaggt</code> is 7 characters long, a ''sed'' command that works on the 22 characters after <code>aaaaggt</code> will be useful.
 
*<code>aaaaggtcggtttaaccggcctttttatt</code> is 29 characters long, and given that <code>aaaaggt</code> is 7 characters long, a ''sed'' command that works on the 22 characters after <code>aaaaggt</code> will be useful.
 
*From the [[More Text Processing Features |More Text Processing Features page]], I learned that <code>sed ':a;N;$!ba;s/\n//g'</code> removes all of the line-breaks in text and makes it into a single "line".
 
*From the [[More Text Processing Features |More Text Processing Features page]], I learned that <code>sed ':a;N;$!ba;s/\n//g'</code> removes all of the line-breaks in text and makes it into a single "line".
 +
*I later noticed that there weren't any spaces between the tagged regions and the sequence itself, I added <code>sed -r "s/<minus35box>|<minus10box>|<tss>|<rbs>|<start_codon>|<stop_codon>|<terminator>/ &/g" | sed -r "s/<\/minus35box>|<\/minus10box>|<\/tss>|<\/rbs>|<\/start_codon>|<\/stop_codon>|<\/terminator>/& /g"</code> to the current chain in order to add the spaces between the tagged regions and the sequence itself.
 
*I added <code>sed "s/aaaaggt/<terminator>&\n/g" | sed -r "10s/^.{22}/&<\/terminator>/g" | sed ':a;N;$!ba;s/\n//g'</code> to the current chain; I found that every region was properly tagged and that all of the line-breaks were removed. <code>sed -r "10s/^.{22}/&<\/terminator>/g"</code> involves the first 22 characters of line 10 because the terminator is 29 bp (22 + 7 = 29).
 
*I added <code>sed "s/aaaaggt/<terminator>&\n/g" | sed -r "10s/^.{22}/&<\/terminator>/g" | sed ':a;N;$!ba;s/\n//g'</code> to the current chain; I found that every region was properly tagged and that all of the line-breaks were removed. <code>sed -r "10s/^.{22}/&<\/terminator>/g"</code> involves the first 22 characters of line 10 because the terminator is 29 bp (22 + 7 = 29).
*The final chain of commands is: <code>cat infA-E.coli-K12.txt | sed "s/tt[gt]ac[at]/<minus35box>&<\/minus35box>\n/1" | sed -r "2s/^.{17}/&<minus10box>\n/g" | sed -r "3s/^.{6}/&<\/minus10box>\n/g" | sed -r "4s/^.{5}/&<tss>\n/g" | sed -r "5s/^.{1}/&<\/tss>\n/g" | sed "s/gagg/<rbs>&<\/rbs>\n/g" | sed -r "7s/atg/<start_codon>&<\/start_codon>\n/1" | sed "s/.../ & /g" | sed -r "8,100000s/taa|tag|tga/<stop_codon>&<\/stop_codon>\n/1" | sed "s/ //g" | sed "s/aaaaggt/<terminator>&\n/g" | sed -r "10s/^.{22}/&<\/terminator>/g" | sed ':a;N;$!ba;s/\n//g'</code>
+
*The final chain of commands is: <code>cat infA-E.coli-K12.txt | sed "s/tt[gt]ac[at]/<minus35box>&<\/minus35box>\n/1" | sed -r "2s/^.{17}/&<minus10box>\n/g" | sed -r "3s/^.{6}/&<\/minus10box>\n/g" | sed -r "4s/^.{5}/&<tss>\n/g" | sed -r "5s/^.{1}/&<\/tss>\n/g" | sed "s/gagg/<rbs>&<\/rbs>\n/g" | sed -r "7s/atg/<start_codon>&<\/start_codon>\n/1" | sed "s/.../ & /g" | sed -r "8,100000s/taa|tag|tga/<stop_codon>&<\/stop_codon>\n/1" | sed "s/ //g" | sed "s/aaaaggt/<terminator>&\n/g" | sed -r "10s/^.{22}/&<\/terminator>/g" | sed ':a;N;$!ba;s/\n//g' | sed -r "s/<minus35box>|<minus10box>|<tss>|<rbs>|<start_codon>|<stop_codon>|<terminator>/ &/g" | sed -r "s/<\/minus35box>|<\/minus10box>|<\/tss>|<\/rbs>|<\/start_codon>|<\/stop_codon>|<\/terminator>/& /g"</code>
 
'''[[Media:bl_output_final.png|Final Output]]'''
 
'''[[Media:bl_output_final.png|Final Output]]'''
 
===Fully Tagged Sequence===
 
===Fully Tagged Sequence===
Exception encountered, of type "Error"
[874234f5] /biodb/fall2015/index.php?diff=prev&oldid=2008&title=Blitvak_Week_4 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}