Skip to content

Commit 2bbb75d

Browse files
committed
fix order of DGE table columns
1 parent 024968b commit 2bbb75d

File tree

153 files changed

+1988
-11383
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

153 files changed

+1988
-11383
lines changed

RNAseq/Pipeline_GL-DPPD-7101_Versions/GL-DPPD-7101-G.md

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
---
66

7-
**Date:** January 21, 2025
7+
**Date:** January 24, 2025
88
**Revision:** G
99
**Document Number:** GL-DPPD-7101-G
1010

@@ -23,7 +23,7 @@ Lauren Sanders (GeneLab Project Scientist)
2323

2424
## Updates from previous version
2525

26-
Added separate pipeline document: [Microbes.md](Microbes.md) to document the pipeline steps for Bowtie2 alignment, used when the `--microbes` parameter is specified. In short, reads are aligned to a reference genome using Bowtie2 rather than STAR, gene counts are quantified using FeatureCounts rather than RSEM. Other steps remain unchanged.
26+
Added separate pipeline document: [GL-DPPD-7XXX.md](../Pipeline_GL-DPPD-7XXX_Versions/GL-DPPD-7XXX.md) to document the pipeline steps for Bowtie2 alignment, used when the `--microbes` parameter is specified. In short, reads are aligned to a reference genome using Bowtie2 rather than STAR, gene counts are quantified using FeatureCounts rather than RSEM. Other steps remain unchanged.
2727

2828
Added "_GLbulkRNAseq" suffix to output files to prevent naming conflicts with files relevant to other assays.
2929

@@ -1104,7 +1104,7 @@ echo "*: ${rRNA_count} rRNA entries removed." > *_rRNA_counts.txt
11041104

11051105
## 9. Normalize Read Counts and Perform Differential Gene Expression Analysis
11061106

1107-
> **Note:** Steps 9a-9c are performed once as they set up the analysis framework. Steps 9d-9f are performed twice with different input files:
1107+
> **Note:** DGE Analysis is performed twice with different sets of input files:
11081108
> 1. Using raw RSEM genes.results files
11091109
> 2. Using rRNA-removed raw RSEM genes.results files
11101110
@@ -1444,23 +1444,27 @@ output_table <- cbind(output_table, res_df)
14441444
### Add summary statistics ###
14451445
output_table$All.mean <- rowMeans(normCounts, na.rm = TRUE)
14461446
output_table$All.stdev <- rowSds(as.matrix(normCounts), na.rm = TRUE)
1447+
output_table$LRT.p.value <- res_1_lrt@listData$padj
14471448

14481449
### Add group-wise statistics ###
14491450
tcounts <- as.data.frame(t(normCounts))
14501451
tcounts$group <- names(group)
14511452

1452-
# Calculate group means
1453+
# Calculate group means and standard deviations
14531454
group_means <- as.data.frame(t(aggregate(. ~ group, data = tcounts, mean)))
1454-
colnames(group_means) <- paste0("Group.Mean_", group_means['group',])
1455-
1456-
# Calculate group standard deviations
14571455
group_stdev <- as.data.frame(t(aggregate(. ~ group, data = tcounts, sd)))
1458-
colnames(group_stdev) <- paste0("Group.Stdev_", group_stdev['group',])
14591456

1460-
# Remove group name rows and combine statistics
1457+
# Remove group name rows
14611458
group_means <- group_means[-1,]
14621459
group_stdev <- group_stdev[-1,]
1463-
output_table <- cbind(output_table, group_means, group_stdev)
1460+
1461+
# For each group, add mean and stdev columns
1462+
for (group_name in names(group)) {
1463+
mean_col <- paste0("Group.Mean_(", group_name, ")")
1464+
stdev_col <- paste0("Group.Stdev_(", group_name, ")")
1465+
output_table[[mean_col]] <- group_means[, paste0("Group.Mean_", group_means['group',])]
1466+
output_table[[stdev_col]] <- group_stdev[, paste0("Group.Stdev_", group_stdev['group',])]
1467+
}
14641468

14651469
### Read in GeneLab annotation table for the organism of interest ###
14661470
annot <- read.table(annotations_link,
@@ -1480,7 +1484,7 @@ output_table <- output_table %>%
14801484

14811485
```
14821486

1483-
### 9h. Export DGE Tables
1487+
### 9g. Export DGE Tables
14841488

14851489
```R
14861490
### Export unnormalized and normalized counts tables ###

0 commit comments

Comments
 (0)