Week 3
This journal entry is due on Tuesday, September 19, at 12:01 AM PDT.
Contents
Overview
The purpose of this assignment is:
- To acquaint you with what goes on behind the scenes when you visit a web page.
- To give you some hands-on practice time with a command-line interface.
- To show you an example of how a manual task can be automated.
- To reinforce the material from the previous week.
These readings/resources will be of direct help in completing the assignment:
- Where's my Stuff?
- Introduction to the Command Line
- http://explainshell.com/ —lets you type in a command and will display a visual explanation of what it does (to the best of its ability)
Individual Journal Assignment
- Store this journal entry as "username Week 3" (i.e., this is the text to place between the square brackets when you link to this page).
- Link from your user page to this Assignment page.
- Link to your journal entry from your user page.
- Link back from your journal entry to your user page.
- Don't forget to add the "Journal Entry" category to the end of your wiki page.
- Note: you can easily fulfill all of these links by adding them to your template and then using your template on your journal entry.
- For your assignment this week, you will keep an electronic laboratory notebook on your individual wiki page. An electronic laboratory notebook records all the manipulations you perform on the data and the answers to the questions throughout the protocol. Like a paper lab notebook found in a wet lab, it should contain enough information so that you or someone else could reproduce what you did using only the information from the notebook.
Homework Partners
For most weeks in the semester, you will be assigned a "homework partner" from a complementary discipline. You will be expected to consult with your partner, sharing your domain expertise, in order to complete the assignment. However, unless otherwise stated, each partner must submit his or her own work as the individual journal entry (direct copies of each other's work is not allowed). You must give the details of the interaction with your partner in the Acknowledgments section of your journal assignment. Homework partners for this week are:
Hack-a-Page
- Visit any web page of your choice, with a decent mix of text and image content (LMU’s home page, for example)
- Using the web browser’s developer tools, “hack” the page in the following ways:
- Modify some text content—make it pretty obvious that you modified the page and that it couldn’t possibly be actual content on the page
- Modify an
img
element so that itssrc
links to an image on this wiki (feel free to upload something new)
- Take a screenshot of your “hacked” page with the developer tools open, showing the sections that you modified
- Take a screenshot of your “hacked” page without the developer tools open, for hours of fake news fun with friends and family
- The two screenshots comprise your deliverables for this part of the assignment; make sure to display them in your Week 3 submission page
- Don’t forget to also document what you did in your electronic notebook page for this week
Be creative, funny, clever, satirical, entertaining…enjoy your newfound capabilities!
The Genetic Code, by Way of the Web
Now, let’s circle back around to biology. The [ExPASy Translate Tool http://web.expasy.org/translate/] automates many of the activities that you performed on pencil and paper for Week 2. Try out a few sequences on it to get a feel for what it does.
For this portion of the assignment, we will go behind the scenes of this tool. As indicated in class, all web page activities are simply request-response cycles, with the web browser sending a request to a server on the Internet then displaying that server’s response. As you use the ExPASy translate tool, you are performing such a request-response cycle when you submit a DNA or RNA sequence.
You also saw in class that a web browser happens to be just one of many applications that can perform this request and response. Specifically, we covered how the curl
command can do the exact same thing, except that it does not do any fancy code conversion or layout: you see the web server’s response purely at the data level—HTML thus far, and we will see other data formats later.
“DMing” the Server with curl
For this part of the assignment, you are asked to communicate with the ExPASy Translate Tool using curl
then perform some command-line-based processing of the data that you receive (which, it should be noted, is exactly the same data that your web browser displays as a web page):
- Visit http://web.expasy.org/translate and open your web browser’s developer tools
- Invoke the Inspect command on the text area that is meant to receive your DNA or RNA sequence
- In the developer tools, you should see a
textarea
representing this entry field, and right above it, you should see an element that begins withform method="POST"
- Take note of the
action
attribute on that element
- Take note of the
- Enclosed within the
form
element are thetextarea
that you clicked on and twoselect
elements- Take note of their
name
attributes and the data that they might hold
- Take note of their
- These activities should lead you to infer the correct
curl
command that will perform the exact same translation request but outside the web browser - Invoke the command and tweak it until you are sure that you are getting it right
- You can compare the raw data that you receive to the Elements tab in the developer tools, to ensure that you’re getting the same thing
- You might also want to watch the Network tab on your web browser, to see what happens when you interact with the page normally
= Using the Command Line to Extract Just the Answers
Include the following on your Week 3 submission page:
- The
curl
command that requests a translation at the command-line, raw-data level - The sequence of commands that extracts “just the answers” from the raw-data response
- The standard Acknowledgments and References sections as indicated in the Week 1 assignment
- Notes on your electronic notebook page for this week documenting how you worked through this exercise
Unless you do this kind of thing everyday, you are almost certain to engage in some trial-and-error plus will need to look up some web resources as well as consult with your homework partner—this is exactly the kind of activity to document in your electronic notebook.