Introduction
Biostatistics is the application of statistical methods to biological data. In bioinformatics, it helps researchers analyze DNA sequences, gene expression measurements, clinical data, and other biological information. It allows researchers to identify patterns, compare experimental results, measure differences, and determine whether the observed findings are statistically significant. By using biostatistics, researchers can interpret complex biological data, reduce the risk of misleading conclusions, and make more reliable decisions in biological research and medical studies.
Biostatistics helps answer important questions, such as:
- Is the observed difference statistically significant?
- How many reported discoveries might be false positives?
- Are the samples comparable?
- How large is the change in gene expression?
- Which samples or genes show similar patterns?
In this article, we will learn seven important concepts used in bioinformatics: p-values, t-tests, multiple testing correction, normalization, log fold change, Principal Component Analysis (PCA), and clustering. We will also use practical Python examples to understand how these methods work.
1. The p-value in Bioinformatics
A p-value helps researchers understand how surprising an observed result would be if the null hypothesis were true.
Before understanding the p-value, let us learn two important terms.
- Null hypothesis (H₀): It assumes that there is no effect or difference under investigation. For example, a gene has the same average expression in control and treated cells.
- Alternative hypothesis (H₁): It suggests that an effect or difference exists. For example, the average expression of a gene differs between the two groups.
The p-value is the probability of obtaining a result at least as extreme as the observed result, assuming the null hypothesis and the statistical model are correct.
A Simple Coin Example
Suppose you flip a fair coin 10 times and get 9 heads. You may wonder whether the coin is unfair.
If the coin is fair, the probability of obtaining 9 or more heads is:
[
P(X \geq 9)=\frac{\binom{10}{9}+\binom{10}{10}}{2^{10}}
=\frac{11}{1024}\approx 0.0107
]
This probability is approximately 0.011. Such a result is relatively unusual for a fair coin, so it provides evidence against the assumption that the coin is fair. The same idea applies to biological experiments. A small p-value indicates that the observed data would be unusual under the null hypothesis.
How to Interpret a p-value
Researchers often use 0.05 as a significance threshold. If the p-value is below 0.05, the result is commonly called statistically significant.
However, this threshold is a convention rather than a universal rule.
| A p-value is | A p-value is not |
|---|---|
| A measure of how surprising the data is under the null hypothesis | The probability that the null hypothesis is true |
| Evidence that can help evaluate a statistical hypothesis | Proof that a scientific result is correct |
| Influenced by the effect size, sample size, and data variability | A direct measure of biological importance |
A small p-value does not necessarily mean that a biological effect is large or important. Similarly, a large p-value does not prove that no effect exists. Researchers should consider the p-value alongside the effect size, sample quality, and biological context.
2. The t-test in Bioinformatics
A t-test is a statistical method used to compare means. In bioinformatics, it can help researchers determine whether the average expression of a gene differs between two groups. For example, researchers may compare gene expression in control cells and cells treated with a particular drug. The t-statistic measures the difference between group means relative to the uncertainty in that difference.
For Welch's two-sample t-test, the formula is:
[
t=\frac{\bar{x}_1-\bar{x}_2}
{\sqrt{\frac{s_1^2}{n_1}+\frac{s_2^2}{n_2}}}
]
Here:
- (\bar{x}_1) and (\bar{x}_2) are the group means.
- (s_1) and (s_2) are the sample standard deviations.
- (n_1) and (n_2) are the sample sizes.
A larger absolute t-statistic generally indicates a larger difference relative to the variability and sample sizes.
Types of t-tests
| Type | When to use it | Example |
|---|---|---|
| One-sample t-test | Comparing one group's mean with a known value | Testing whether the mean GC content differs from 50% |
| Independent two-sample t-test | Comparing two separate groups | Control cells versus treated cells |
| Paired t-test | Comparing measurements from the same subjects at two time points | Gene expression before and after treatment |
Welch's t-test is often a suitable starting point for comparing two independent groups because it does not require equal population variances.
Python Example: Comparing Gene Expression
Let us take an example to demonstrate the use of Welch's t-test for comparing gene expression values between control and treated samples.
from scipy import stats
control = [5.1, 4.8, 5.3, 5.0, 4.9]
treated = [6.2, 5.9, 6.4, 6.0, 6.3]result = stats.ttest_ind(
treated,
control,
equal_var=False
)print("T-statistic:", result.statistic)
print("P-value:", result.pvalue)
Output (approximately):
T-statistic: 9.01 P-value: 1.9e-05
Explanation:
In this example, we use the SciPy library to compare gene expression values between control and treated samples. First, we define the control and treated lists to store the gene expression measurements for both groups. After that, we use the stats.ttest_ind() function with equal_var=False to perform Welch's t-test, which compares the means of two independent groups without assuming equal variances. Finally, we print the t-statistic and p-value. The treated group has a mean of 6.16, while the control group has a mean of 5.02. The small p-value indicates that the observed difference is statistically significant under the test's assumptions.