<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 <img src="images/JHI_STRAP_Web.png" style="width
Step1:  After executing the code cell, you should see a table of values. The table has columns named gene1 and gene2, and rows that are indexed starting at zero (it is typical in many programming languages to start counting at zero).
<a id="summary"></a>
3. Summary statistics
<p></p>
<div class="alert-success">
<b>It can be very useful to get a quantitative overview of a new dataset by looking at some *bulk statistics*
Step2:  <a id="correlations"></a>
4. Correlations
<p></p>
<div class="alert-success">
<b>We have decided that, as a way of identifying potentially coregulated genes, we will look for *correlated expression* between `gene1` and `gene2`</b>
</div>
The dataframe provides another method that reports the (Pearson) correlation coefficient between the columns of the dataset
Step3:  You can now make a quantitative estimate of whether these two genes are likely to be coregulated.
<img src="images/exercise.png" style="width
<ASSISTANT_TASK:>
Python Code:
# Define your group, for this exercise
mygroup = "A"  # <- change the letter in quotes
# Import Python libraries
import os               # This lets us interact with the operating system
import pandas as pd     # This allows us to use dataframes
import seaborn as sns   # This gives us pretty graphics options
# Load the data
datafile = os.path.join('data', 'correlations', mygroup, 'expn.tab')
data = pd.read_csv(datafile, sep="\t")
# Show the first few lines of the data
data.head()
Explanation: <img src="images/JHI_STRAP_Web.png" style="width: 150px; float: right;">
01a - Correlations (15min)
Table of Contents
Biological Motivation
Dataset
Summary Statistics
Correlations
Visualising Data
Comments
<a id="motivation"></a>
1. Biological motivation
<p></p>
<div class="alert-info">
You have been given a dataset of transcript levels (e.g. RNAseq, microarray, qRT-PCR) for two genes in your organism of interest. These transcript levels have been measured over 11 timepoints. You would like to know whether those genes are coregulated or not.
</div>
<img src="images/exercise.png" style="width: 50px; float: left;">
QUESTION:  (2min)
<p></p>
<div class="alert-danger">
<b>
How can you determine whether two genes are coregulated from transcript data?
<br></br><br></br>
What is the distinction between coregulation and <i>correlated expression</i>?
</b>
</div>
<a id="dataset"></a>
2. Dataset
<p></p>
<div class="alert-success">
<b>The `Code` cell below contains Python code that will load your dataset.</b>
</div>
You will have been assigned a letter: A, B, C, or D as part of the workshop. Please enter this letter in the first line of Python code, so that you are working with the appropriate dataset:
```python
Define your group, for this exercise
mygroup = "A"  # <- change the letter in quotes
```
and then execute the cell with Ctrl-Enter or Shift-Enter. This will load the exercise data into a variable called data.
End of explanation
# Show summary statistics of the dataframe
Explanation: After executing the code cell, you should see a table of values. The table has columns named gene1 and gene2, and rows that are indexed starting at zero (it is typical in many programming languages to start counting at zero).
<a id="summary"></a>
3. Summary statistics
<p></p>
<div class="alert-success">
<b>It can be very useful to get a quantitative overview of a new dataset by looking at some *bulk statistics*: the dataset's *mean*, *median*, *variance*, *standard deviation*, and minimum and maximum values.</b>
</div>
The data you loaded is in a dataframe (this behaves very much like dataframes in the R language), and you can obtain summary statistics quite readily using the .describe() method.
```python
Show summary statistics of the dataframe
data.describe()
```
<p></p>
<div class="alert-danger">
<b>Use the `.describe()` method to obtain summary statistics for your data in the cell below</b>
</div>
End of explanation
# Show the Pearson correlation coefficients between columns in the dataset
Explanation: <a id="correlations"></a>
4. Correlations
<p></p>
<div class="alert-success">
<b>We have decided that, as a way of identifying potentially coregulated genes, we will look for *correlated expression* between `gene1` and `gene2`</b>
</div>
The dataframe provides another method that reports the (Pearson) correlation coefficient between the columns of the dataset:
```python
Show the Pearson correlation coefficients between columns in the dataset
data.corr()
```
<p></p>
<div class="alert-danger">
<b>Use the `.corr()` method to obtain summary statistics for your data in the cell below</b>
</div>
End of explanation
# The line below allows plots to be rendered in the notebook
# This is very useful for literate programming, and for producing reports
%matplotlib inline
# Show a scatter plot of transcript levels for gene1 and gene2
Explanation: You can now make a quantitative estimate of whether these two genes are likely to be coregulated.
<img src="images/exercise.png" style="width: 50px; float: left;">
QUESTION:  (2min)
<p></p>
<div class="alert-danger">
<b>How strong do you think the evidence is that these two genes are coregulated?</b>
</div>
<a id="visualising"></a>
5. Visualising Data
<p></p>
<div class="alert-success">
<b>In addition to summary statistics, it is always useful to *visualise* your data, to inspect it for patterns and potential outliers, and to see whether it makes intuitive sense.</b>
</div>
The dataframe provides a group of methods that allow us to plot the data for gene1 and gene2 in various ways. You will use the .plot.scatter() method in the cell below to visualise the way in which their transcript levels vary together.
```python
Show a scatter plot of transcript levels for gene1 and gene2
data.plot.scatter('gene1', 'gene2');
```
<p></p>
<div class="alert-danger">
<b>Use the `.plot.scatter()` method to visualise your data in the cell below</b>
</div>
End of explanation
<END_TASK>