Добавил:
Sekretar
kiopkiopkiop18@yandex.ru
t.me/Prokururor I Вовсе не секретарь, но почту проверяю
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:Ординатура / Хирургия / Библиотека им академика М.И. Перельмана / Книга_5529_Библиотеки_им_академика_М_И_Перельмана
.pdf
174 Bioinformatics of Autoimmune Diseases
workow required to process raw RNA-Seq data through to biological interpretation. This pipeline
was created with the purpose of exploring the transcriptional landscape of autoimmune conditions
like RA using Python-based orchestration and commonly used command-line bioinformatics tools.
Each function within the pipeline handles a specic component of the analysis, from preprocessing to nal interpretation, and the ow between these components reects standard RNA-Seq data
processing best practices.
5.5.1 RAW DATA QUALITY
The pipeline begins with a preprocessing function named trim _ reads, which is responsible for
cleaning raw paired-end FASTQ les. It uses the tool fastp to trim adapter sequences, remove
low-quality bases, and generate clean reads that are more suitable for downstream processing. For
each sample, two les representing the forward and reverse reads are passed into the function. The
output consists of cleaned forward and reverse FASTQ les, along with a quality control report in
both HTML and JSON formats. These reports provide visual summaries of quality scores, duplication rates, and adapter content, which can be interpreted to assess the effectiveness of trimming and
the overall integrity of the sequencing data. The removal of adapters and low-quality bases helps
prevent erroneous read mapping and quantication in later stages.
# 1. FASTQ Read Quality Fixing (trimming adapters, filtering)
def trim_reads(fq1, fq2, out1, out2, sample_id):
os.makedirs("data/processed", exist_ok=True)
os.makedirs("results/fastp", exist_ok=True)
cmd = [
"fastp",
"-i", fq1,
"-I", fq2,
"-o", out1,
"-O", out2,
"-h", f"results/fastp/{sample_id}.html",
"-j", f"results/fastp/{sample_id}.json"
]
subprocess.run(cmd, check=True)
5.5.2 DOWNLOADING AND INDEXING REFERENCE GENOME
The next function, prepare _ reference, manages the setup of the reference genome neces-
sary for accurate read alignment. It checks for the presence of the human reference genome FASTA
le and the corresponding GTF annotation le. If these les are missing, it downloads them from
the Ensembl FTP server. Once these les are in place, the function invokes the STAR aligner to
generate a genome index. This index is required for rapid and memory-efcient mapping of RNASeq reads. STAR uses both the reference sequence and gene annotations to build the index, which
includes splice junction information that enables accurate alignment across exon–exon boundaries. The output of this function is a directory containing the STAR genome index les, including
genomeParameters.txt, which indicates a successful build. The presence of this le is critical; its absence causes alignment failures, which the pipeline explicitly checks to avoid.
def prepare_reference():
os.makedirs("data/ref", exist_ok=True)
if not os.path.exists(REFERENCE_FA):
command = (
"wget -O - "
f"{REFERENCE_URL} "

"--no-check-certificate "
"| gunzip -c "
f"> {REFERENCE_FA}"
)
subprocess.run(
command,
shell=True,
check=True
)
if not os.path.exists(GTF_FILE):
gtf_url = (
"https://ftp.ensembl.org/pub/release-110/gtf/homo_sapiens/"
"Homo_sapiens.GRCh38.110.gtf.gz"
)
command = (
"wget -O data/ref/genes.gtf.gz "
f"{gtf_url} "
"--no-check-certificate"
)
subprocess.run(
command,
shell=True,
check=True
)
subprocess.run("gunzip -f data/ref/genes.gtf.gz",
shell=True, check=True)
if not os.path.exists(os.path.join(STAR_INDEX, "genomeParameters.
txt")):
os.makedirs(STAR_INDEX, exist_ok=True)
cmd = [
"STAR", "--runThreadN", str(THREADS),
"--runMode", "genomeGenerate",
"--genomeDir", STAR_INDEX,
"--genomeFastaFiles", REFERENCE_FA,
"--sjdbGTFfile", GTF_FILE,
"--sjdbOverhang", "100"
]
subprocess.run(cmd, check=True)
175 RNA Sequencing
5.5.3 READ MAPPING AND BAM INDEXING
After preparing the reference, the map _ reads function is called to perform alignment of the
cleaned paired-end FASTQ les to the indexed reference genome. This function uses STAR in
mapping mode, providing the forward and reverse reads for each sample. The output is a sorted
BAM le for each sample, containing the aligned reads with genomic coordinates. These les serve
as the backbone for downstream quantication and analysis. The alignment process incorporates
annotation guidance to improve the accuracy of mapping, especially at exon junctions. In addition
to the BAM le, STAR generates log les summarizing the number of reads mapped, uniquely
aligned reads, multi-mapped reads, and splice junction annotations detected. These statistics provide insights into the quality and efciency of the alignment, and high proportions of uniquely
mapped reads generally indicate a successful mapping step.
def map_reads(fq1, fq2, sample_id):
output_prefix = f"data/processed/{sample_id}_"

176 Bioinformatics of Autoimmune Diseases
cmd = [
"STAR", "--runThreadN", str(THREADS),
"--genomeDir", STAR_INDEX,
"--readFilesIn", fq1, fq2,
"--readFilesCommand", "zcat",
"--outFileNamePrefix", output_prefix,
"--outSAMtype", "BAM", "SortedByCoordinate"
]
subprocess.run(cmd, check=True)
Following alignment, the index _ bam function indexes each BAM le using samtools.
BAM indexing creates an auxiliary .bai le, which is essential for rapid querying of alignment
data, especially in visualization tools or during read counting. This step ensures that downstream
tools like featureCounts can efciently access reads aligned to specic genomic features.
def index_bam(bam_file):
subprocess.run(["samtools", "index", bam_file])
5.5.4 READ COUNTING
The count _ reads function is responsible for generating gene-level expression data using the
tool featureCounts, part of the Subread package. It takes all sorted BAM les as input and a
GTF annotation le and outputs a tab-delimited count matrix. Each row of the output corresponds
to a gene, and each column corresponds to a sample. The values represent the number of reads
aligned to each gene, thereby quantifying gene expression levels. This count data is the raw material for differential expression analysis. The le may also include columns with annotation details
like gene ID, chromosome, and strand information. A critical part of interpreting this output is to
observe total counts per sample, which can reveal biases or inconsistencies in sequencing depth
across samples.
def count_reads(bam_files, output_file):
os.makedirs(os.path.dirname(output_file), exist_ok=True)
cmd = [
"featureCounts", "-T", str(THREADS), "-p",
"-a", GTF_FILE, "-o", output_file
] + bam_files
subprocess.run(cmd, check=True)
5.5.5 GENE FILTERING
Filtering genes before conducting downstream RNA-Seq analysis is a critical step to ensure the
reliability and interpretability of results. Raw RNA-Seq data typically includes thousands of genes,
many of which may not be expressed or are expressed at extremely low levels across the samples.
These low-expression genes often represent transcriptional noise or technical artifacts rather than
biologically meaningful signals. Including such genes in the analysis can lead to inated false discovery rates and reduced statistical power due to an unnecessarily large multiple testing burden. By
removing genes that are unlikely to contribute meaningful information, we enhance the sensitivity
of the analysis and focus computational resources on the genes most likely to show biologically
relevant differences between conditions.
There are several strategies for ltering genes based on expression. One common approach is
to use a raw count threshold, where genes with a total count across all samples below a certain
number (e.g., 10 or 20) are discarded. While simple, this method can be insensitive to differences in
library sizes and may remove genes that are consistently expressed in small groups. A more rened

177 RNA Sequencing
° ˙
˛
ˆ
approach is to use counts per million (CPM), which normalizes raw counts by the total number of
reads per sample, making expression levels comparable across libraries. A gene is typically retained
if it has a CPM value greater than a given threshold (commonly 1) in at least a minimum number of
samples, often corresponding to the smallest group size in the study design. This ensures that only
genes with sufcient and consistent expression across biological replicates are considered, reducing
the impact of random low-level noise.
def filter_low_expression_genes(counts, min_cpm=1, min_samples=3):
lib_sizes = counts.sum(axis=0)
cpm = counts.divide(lib_sizes, axis=1) * 1e6
keep = (cpm > min_cpm).sum(axis=1) >= min_samples
filtered = counts[keep]
return filtered
The function filter _ low _ expression _ genes is implemented in the example pipe-
line to automate this ltering process. It takes a raw count matrix as input, along with optional
parameters for the CPM threshold and the minimum number of samples in which a gene must
exceed that threshold. The function rst computes the library sizes by summing the counts across
samples, then calculates the CPM for each gene in each sample. It then determines which genes
have CPM values above the threshold in at least the specied number of samples. Only these genes
are retained in the ltered dataset. This approach balances sensitivity and specicity, ensuring that
genes included in further analysis are reliably expressed while excluding those likely to introduce
noise. The function also logs the number of genes retained versus those ltered out, helping users
monitor the impact of their chosen thresholds.
5.5.6 COUNT NORMALIZATION
Normalization is then handled by the normalize _ counts function, which processes the raw
count matrix alongside the study design metadata. The count matrix is cleaned by removing annotation columns and standardizing the sample column names to match the identiers in the metadata.
Library size normalization is applied by converting raw counts to counts per million (CPM), allowing for fair comparisons between samples that may have different sequencing depths. The CPM is
a normalization method used in RNA-Seq data analysis to account for differences in library sizes
(i.e., total read counts per sample). The formula for CPM is the following:
M =
˝
Totalcount in thesample
Rawcount
In words, the CPM is dividing the raw count of a gene by the total number of reads (counts) in
that sample and then the result by 1,000,000 (106) to scale it to per million reads.
This step produces a normalized count matrix, and interpretation of this matrix involves evaluating whether genes of interest are consistently expressed across groups. The study design metadata
contains critical information such as age, sex, CRP levels, pathotype, and anti-CCP status, which
are used to group samples for comparative analysis.
def normalize_counts(count_matrix_path, design_file):
counts = pd.read_csv(count_matrix_path, sep='\t', comment='#',
index_col=0)
counts = counts.iloc[:, 5:]
new_columns = []
for col in counts.columns:
filename = col.split('/')[-1]
ˇ
× 10
6

178 Bioinformatics of Autoimmune Diseases
cleaned_name = filename.replace('_Aligned.sortedByCoord.out.bam',
'')
new_columns.append(cleaned_name)
counts.columns = new_columns
study_design = pd.read_csv(design_file)
available_samples = [
s
for s in study_design['runID']
if s in counts.columns
]
counts = counts[available_samples]
study_design = study_design[study_design['runID'].
isin(available_samples)]
#norm_counts = counts.div(counts.sum(axis=0), axis=1) * 1e6
#return norm_counts, study_design
counts = filter_low_expression_genes(counts)
norm_counts = counts.div(counts.sum(axis=0), axis=1) * 1e6
return norm_counts, study_design
5.5.7 DIFFERENTIAL EXPRESSION
In this section, we will explore several RNA-Seq analysis pipelines that align with commonly used
experimental designs. The goal is to demonstrate how statistical methods can be effectively integrated into RNA-Seq workows depending on the structure of the study. Each design presents
unique considerations for how gene expression data should be analyzed and interpreted.
One of the most straightforward designs is the comparison between two groups, such as treated
versus untreated samples. In this case, a t-test is often appropriate for identifying genes that show
statistically signicant differences in expression between the two conditions. This test assumes
that the samples are independent and normally distributed, and it provides a foundation for more
complex analyses.
When the study involves a single experimental factor with more than two categorical levels, such
as different doses of a treatment or multiple time points, a one-way ANOVA becomes suitable. This
approach allows for the detection of genes whose expression varies across the different levels of a
single factor. One-way ANOVA is particularly useful when researchers aim to identify patterns or
trends across multiple conditions rather than simple pairwise differences.
For more complex experimental designs involving two independent factors, such as genotype
and treatment, or sex and disease status, a two-way ANOVA is employed. This method not only tests
for the individual effects of each factor but also for potential interaction effects between them. Twoway ANOVA is powerful in dissecting the combined inuence of multiple biological variables on
gene expression, making it ideal for more comprehensive RNA-Seq studies.
5.5.7. 1 T- Te s t
def differential_expression(norm_counts, design, group_col='antiCCP'):
group1_ids = design[design[group_col].str.lower() == 'positive']
['runID']
group2_ids = design[design[group_col].str.lower() == 'negative']
['runID']
group1 = [s for s in group1_ids if s in norm_counts.columns]
group2 = [s for s in group2_ids if s in norm_counts.columns]
if not group1 or not group2:
raise ValueError("One group has no samples in the expression
matrix.")
results = []

179 RNA Sequencing
for gene in norm_counts.index:
expr1 = norm_counts.loc[gene, group1]
expr2 = norm_counts.loc[gene, group2]
if expr1.var() == 0 and expr2.var() == 0:
# Both groups have no variation → skip
results.append((gene, np.nan, np.nan))
continue
stat, pval = ttest_ind(expr1, expr2,
equal_var=False, nan_policy='omit')
log2fc = np.log2((expr1.mean() + 1e-6) / (expr2.mean() + 1e-6))
results.append((gene, log2fc, pval))
df = pd.DataFrame(results, columns=['Gene', 'log2FC', 'p-value'])
# Drop rows where p-value is missing (e.g. due to t-test failure)
missing = df['p-value'].isna().sum()
if missing > 0:
print(f"Genes had NaN p-values were excluded from adjustment.")
df = df.dropna(subset=['p-value'])
# Adjust p-values
df['adj-p'] = multipletests(df['p-value'], method='fdr_bh')[1]
return df.sort_values('adj-p')
In rna _ pipeline _ ttest.py program, the differential _ expression function is
designed to perform a two-group comparison of gene expression levels using a statistical approach
rooted in the t-test. It takes a normalized gene expression matrix where rows represent genes and
columns represent individual samples, along with a design matrix that contains metadata including
sample identiers and a grouping variable such as “antiCCP”. The function identies two groups of
samples based on the values in this grouping column, typically labeled “positive” and “negative”,
and ensures that only those samples which are present in both the metadata and the expression
matrix are included in the analysis.
For each gene, the Python function extracts expression values for the two groups and checks for
variance. If both groups lack variation for a particular gene, the gene is skipped, as a t-test cannot be meaningfully applied in such cases. When variation is present, a Welch’s t-test (which does
not assume equal variance) is performed to compare the mean expression levels between the two
groups. Additionally, the log2 fold change in expression is calculated to quantify the direction and
magnitude of the difference between groups, with a small constant added to avoid division by zero.
The results for each gene, including the gene name, log2 fold change, and p-value from the t-test,
are collected into a DataFrame. Genes with undened p-values, often due to lack of variation or
statistical errors, are excluded from the multiple testing correction step. The remaining p-values
are adjusted using the Benjamini-Hochberg procedure to control the false discovery rate, and the
results are sorted by adjusted p-value for easy identication of the most signicantly differentially
expressed genes. This function thus provides a concise and interpretable summary of gene-level
changes between two biological conditions, using the t-test as its core statistical method. It returns
a table sorted by adjusted p-values, including the gene name, log2 fold change, raw p-value, and
adjusted p-value, allowing for the identication of the most signicantly differentially expressed
genes between the two groups. This output reveals candidate genes potentially involved in disease
pathogenesis or progression. Genes with adjusted p-values below a predened threshold (e.g., 0.05)
are considered signicantly differentially expressed. The results can then be used to generate gene
signatures, identify biomarkers, or initiate pathway enrichment studies.
The fold change, specically the log2 fold change, is a measure of how much a gene’s expression
level changes between the two groups. It is calculated by taking the mean expression of the gene
in one group and dividing it by the mean expression in the other group, and then applying a base-2
logarithm to the result. This transformation makes the values symmetric and interpretable: a log2
fold change of 1 means the gene is expressed twice as much in one group compared to the other,

180 Bioinformatics of Autoimmune Diseases
° ˙
1
˛
ˆ
2
TABLE 5.2
The Top Ten Differentially Expressed Genes in RA RNA-Seq Data
Gene Log2FC p-Value Adj-p
Gene_1 0.8
Gene_5 0.5
Gene_10 0.5
Gene_8 0.5
Gene_7 0.6
Gene_2 0.5
Gene_4 0.5
Gene_6 0.4
Gene_9 0.4
Gene_3 0.4
7E−08 7E−06
2E−06 1E−04
3E−05 1E−03
2E−04 5E−03
4E−04 8E−03
8E−04 1E−02
2E−03 2E−02
2E−03 2E−02
2E−03 2E−02
8E−03 8E−02
while a log2 fold change of −1 means it is expressed half as much. Mathematically, the formula used
is the following:
=
g2FClog 2
Mean group
˝
Mean group
ˇ
A small constant is often added to both means to prevent division by zero. The Log2FC value
helps in identifying the magnitude and direction of gene expression changes, which is essential for
biological interpretation in RNA-Seq analysis.
Table 5.2 lists the top ten genes with the most signicant differences in expression between
anti-CCP positive and negative groups. The real gene names have been replaced with gene1, gene2,
etc., as the results are not intended to be interpreted as scientic ndings. For each gene, the log2
fold change indicates the direction and magnitude of differential expression, where positive values
reect higher expression in the anti-CCP positive group and negative values indicate lower expression. The p-value represents the statistical signicance of the difference, and the adjusted p-value
accounts for multiple testing using the Benjamini-Hochberg correction method.
5.5.7.2 One-Way ANOVA
The differential _ expression analysis can be adjusted based on the number of levels in
the variable used in the design. If the variable has two categorical levels, a t-test can be used, as
shown above. However, if the variable has more than two levels, an ANOVA is more appropriate.
For example, if we use the variable ‘Ethnic’, which has three levels, the above code must be modi-
ed for one-way ANOVA.
5.5.7.2.1 One-Way ANOVA without Control
The differential _ expression function in “rna _ pipeline _ 1wayAnova.py” is
designed to perform statistical analysis of gene expression data across multiple groups using a oneway ANOVA approach. It takes normalized count data in the form of a gene-by-sample matrix
and a design matrix that includes sample identiers and a grouping variable. The function is exible, allowing the user to specify a control group for targeted comparisons or to rely on automatic
detection of the top two groups with the highest mean expression for calculating log2 fold change
(log2FC). This makes it particularly useful in exploratory analyses where the most biologically
relevant group differences may not be known in advance.

181 RNA Sequencing
To ensure meaningful comparisons, the function lters out groups with insufcient sample sizes,
controlled by a minimum sample threshold. For each gene, it compiles expression values from the
valid groups and performs an ANOVA to test for signicant differences in means. It then calculates
the log2FC either between the control and the top expressing group, or between the top two expressing groups overall, applying a small pseudocount to avoid division by zero. The p-values from the
ANOVA tests are adjusted for multiple hypothesis testing using the Benjamini-Hochberg procedure
to control the false discovery rate.
The output of the function is a tidy DataFrame where each row corresponds to a gene. For
each gene, the table reports the raw p-value from the ANOVA test, the adjusted p-value, and the
computed log2 fold change between the groups of interest. The table is sorted by adjusted p-values,
placing the most statistically signicant results at the top. This allows researchers to easily identify
genes that are differentially expressed across the specied groups and to assess the direction and
magnitude of those differences in expression.
5.5.7.2.2 One-Way ANOVA with Control
In the context of ANOVA, specifying a control or baseline group enhances interpretability by providing a consistent reference point against which all other groups are compared. While ANOVA
itself tests for differences across multiple groups without favoring any one group, the inclusion of a
designated control allows researchers to quantify the magnitude and direction of expression changes
in relation to a biologically meaningful standard. This is particularly important in studies of autoimmune diseases, where comparisons are often made between healthy individuals and patients with
varying disease subtypes or treatment responses. Using a control group, such as healthy donors or
untreated individuals, enables the detection of genes that are systematically upregulated or downregulated due to disease processes. It also facilitates clearer biological conclusions, as observed differences can be anchored to a dened physiological state. Thus, incorporating a control group into
ANOVA-based differential expression analysis not only maintains statistical rigor but also grounds
ndings in clinical relevance.
def differential_expression(norm_counts, design, group_col='Ethnic',
control_group="White", min_samples_per_group=2):
design['runID'] = design['runID'].astype(str).str.strip()
design[group_col] = design[group_col].astype(str).str.strip()
groups = design[group_col].dropna().unique()
if len(groups) < 2:
raise ValueError("Not enough groups for DE.")
results = []
for gene in norm_counts.index:
gene_data = []
group_means = {}
group_exprs = {}
for g in groups:
sample_ids = design[design[group_col] == g]['runID']
sample_ids = [s for s in sample_ids if s in norm_counts.columns]
if len(sample_ids) >= min_samples_per_group:
expr = norm_counts.loc[gene, sample_ids]
gene_data.append(expr)
group_exprs[g] = expr
group_means[g] = expr.mean()
if len(gene_data) >= 2:
stat, pval = f_oneway(*gene_data)
if control_group and control_group in group_exprs:
for g in group_exprs:

182 Bioinformatics of Autoimmune Diseases
if g == control_group:
continue
# Compute log2FC: group vs control
mean_control = group_means[control_group] + 1e-6
mean_group = group_means[g] + 1e-6
log2fc = np.log2(mean_group / mean_control)
results.append((gene, g, control_group, log2fc, pval))
else:
# Default: just compare top two
top2 = sorted(group_means.items(),
key=lambda x: x[1], reverse=True)[:2]
log2fc = np.log2((top2[0][1] + 1e-6) / (top2[1][1] + 1e-6))
results.append((gene, top2[0][0], top2[1][0], log2fc, pval))
if not results:
raise ValueError("No genes passed filtering criteria.")
df = pd.DataFrame(results,
columns=['Gene', 'Group', 'Baseline', 'log2FC', 'p-value'])
df['adj-p'] = multipletests(df['p-value'], method='fdr_bh')[1]
return df.sort_values(['Gene', 'adj-p'])
The differential _ expression function in “rna _ pipeline _ 1wAnova _ ctrl.
py” performs a one-way ANOVA to identify genes with statistically signicant differences in
expression across multiple groups dened by a categorical variable in the study design, such as ethnicity, treatment status, or pathotype. Unlike standard implementations that only highlight whether
variation exists among groups, this function extends the analysis by calculating log2 fold changes
for each non-control group relative to a specied control group. This enhancement makes the out-
put more biologically interpretable, especially when a clear baseline, such as a healthy or untreated
condition, is available for comparison.
To ensure robustness, the function lters out groups that do not meet a minimum number of
samples and only includes genes with sufcient representation across groups. For each gene, it
collects expression data across valid groups, computes ANOVA to assess the overall statistical
signicance, and then calculates the mean expression per group. If a control group is provided,
the function computes log2 fold changes by comparing each non-control group’s mean expression
against the control. If no control is specied, it defaults to comparing the two groups with the largest
difference in mean expression.
The output is a structured DataFrame (Table 5.3) where each row corresponds to a gene and a
specic group comparison. It includes the gene name, the target group, the baseline group (usually
the control), the computed log2 fold change, the ANOVA p-value, and an adjusted p-value using the
Benjamini-Hochberg method for controlling the false discovery rate. This format allows researchers to easily identify genes that not only differ across groups overall but also show specic directional changes relative to a biologically meaningful reference. Such detailed output is particularly
valuable in elds like autoimmune disease research, where understanding the relative expression
TABLE 5.3
Differential Gene Expression across Groups Relative to Control Group
Gene Group Baseline Log2FC p-Value Adj-p
Gene1 Asian White 0.45 0.01 0.02
Gene1 Black White
Gene2 Asian White 1.01 0.03 0.04
−0.12
0.01 0.02

183 RNA Sequencing
X1 − X
2
pooled
X
1
X
2
S
pooled
(
s
s
)
S
2
1
2
2
2
(
1
)
(
n −1)s
2
S
2
1 2
SS
Total
shifts between patient subgroups and healthy controls can offer insights into disease mechanisms
and potential therapeutic targets.
5.5.7.2.3 Pairwise Comparison
When ANOVA is applied in RNA-Seq differential expression analysis to examine a variable with
more than two levels, such as disease subtypes, ethnic groups, or treatment conditions, a signicant
result indicates that at least one group differs from the others in terms of gene expression. However,
ANOVA alone does not reveal which specic groups are different or how substantial those differences are. To gain more detailed insight, additional statistical measures are used to evaluate both the
direction and magnitude of expression changes between groups. These include pairwise comparisons between all possible combinations of group levels, which help identify the specic conditions
showing statistically signicant differences. Methods such as Tukey’s Honest Signicant Difference
(HSD) test are commonly employed for this purpose, as they allow for rigorous pairwise testing
while controlling for false discovery due to multiple comparisons. Alongside post hoc testing, effect
2
size metrics like Cohen’s d and eta-squared (η
) are used to quantify the strength and explanatory
power of group differences. Together, these statistics provide a richer interpretation of differential
expression by distinguishing between statistically signicant and biologically meaningful variation.
Cohen’s d is a standardized measure of effect size that quanties the magnitude of difference
between two group means in terms of their pooled standard deviation. It is computed by subtracting the mean of one group from the mean of another and dividing the result by the average of their
standard deviations.
=
S
where
and
are the means of the two groups being compared.
is the pooled standard deviation, calculated as:
2
2
−
2
1
=
pooled
and
are the variances of the two groups.
This version assumes equal sample sizes or that an unbiased pooled estimate is acceptable. For
unequal sample sizes, the pooled standard deviation can be weighted by sample sizes:
pooled
2
n −
s
+
1
1
=
nn+ − 2
2
In the context of gene expression analysis, Cohen’s d helps assess how strongly a gene is differentially expressed between two conditions, independent of sample size. A larger absolute value of
Cohen’s d indicates a more substantial effect, with values around 0.2 considered small, 0.5 medium,
and 0.8 or above considered large. This measure complements statistical signicance by providing
insight into the practical or biological relevance of observed differences, which is especially important when sample sizes are large enough to detect small but potentially trivial changes.
Eta-squared (η2) is a measure of the proportion of variance in a dependent variable that is attributable to a particular independent variable, in this case the grouping factor used in ANOVA. It is
calculated as the ratio of between-group variance to total variance and ranges from 0 to 1.
2
between
=
SS
Соседние файлы в папке Библиотека им академика М.И. Перельмана
