|
|
| * -35 box of the promoter <pre>... <minus35box>...</minus35box> ...</pre> | | * -35 box of the promoter <pre>... <minus35box>...</minus35box> ...</pre> |
| ** First, I knew I needed to identify the sequence that I'd be looking for within the file. The week 4 assignment indicated that the consensus sequence for the -35 promoter sequence is <code>tt[gt]ac[at]</code>. In thus, I knew I needed to plug this sequence into <code>sed</code> in order to filter for this sequence. Because I wanted a single replacement of one sequence, I knew that <code>sed s//g</code> would be the best option. My first theory was to try for <code>sed s/tt[gt]ac[at]/ & /g</code>, to put a space on either side of the sequence. This would test whether or not it was finding the sequence correctly, before I put in the tag. | | ** First, I knew I needed to identify the sequence that I'd be looking for within the file. The week 4 assignment indicated that the consensus sequence for the -35 promoter sequence is <code>tt[gt]ac[at]</code>. In thus, I knew I needed to plug this sequence into <code>sed</code> in order to filter for this sequence. Because I wanted a single replacement of one sequence, I knew that <code>sed s//g</code> would be the best option. My first theory was to try for <code>sed s/tt[gt]ac[at]/ & /g</code>, to put a space on either side of the sequence. This would test whether or not it was finding the sequence correctly, before I put in the tag. |
− | ** I tested using the command <code> cat infA-E.coli-K12.txt | sed "s/tt[gt]ac[at]/ & /g" </code> However, this command did not work, since it changed every single one that appeared, not just the first! Since I only wanted the first one to be changed, I did some research to find out how to change the first iteration using sed. Using [http://unix.stackexchange.com/questions/155805/sed-replace-first-k-instances-of-a-word-in-the-file this link from Stack Overflow], I learned that the /g in the command was indicating to change every single iteration. Changing it to /1 would cause it to change only the first iteration! Running <code> cat infA-E.coli-K12.txt | sed "s/tt[gt]ac[at]/ & /1" </code> resulted in the output I expected. As a result, all that was left was to find the first and last space and replace then with the starting and ending tags. | + | ** I tested using the command <code>cat infA-E.coli-K12.txt | sed "s/tt[gt]ac[at]/ & /g"</code>. However, this command did not work, since it changed every single one that appeared, not just the first! Since I only wanted the first one to be changed, I did some research to find out how to change the first iteration using sed. Using [http://unix.stackexchange.com/questions/155805/sed-replace-first-k-instances-of-a-word-in-the-file this link from Stack Overflow], I learned that the /g in the command was indicating to change every single iteration. Changing it to /1 would cause it to change only the first iteration! Running <code> cat infA-E.coli-K12.txt | sed "s/tt[gt]ac[at]/ & /1" </code> resulted in the output I expected. As a result, all that was left was to find the first and last space and replace then with the starting and ending tags. |
| ** However, this ended up being harder than expected. Because </minus35box> had a / key, sed interpreted that as the end of the input. The forward slash would need to be escaped in order for sed to treat it not as a part of the command, but rather as a string. I knew that in other command line arguments, a backslash placed before the offending character would escape the character, allowing it to be read as a character. This held true for the sed command as well. The final command and output was as follows: | | ** However, this ended up being harder than expected. Because </minus35box> had a / key, sed interpreted that as the end of the input. The forward slash would need to be escaped in order for sed to treat it not as a part of the command, but rather as a string. I knew that in other command line arguments, a backslash placed before the offending character would escape the character, allowing it to be read as a character. This held true for the sed command as well. The final command and output was as follows: |
Exception encountered, of type "Error"
[70264371] /biodb/fall2015/index.php?diff=1624&oldid=1623&title=Nanguiano_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}