PatrickBuerger/RNAseq_Pipeline

Plotting gene of choice and exon of choice.

Closed this issue · 1 comments

Hey S,
lets take the example gene from the host "aten_0.1.m1.10016.m1". If you compare the two graphs, looking at the first one: gene aten_0.1.m1.10016.m1 is higher expressed in SS8 compared to WT. Looking at the exons, they seem to be all the same across the samples, not difference between SS8 and WT. Even when all the counts are averaged out through adding all values together, it does not look like the summed exon expression of SS8 "aten_0.1.m1.10016.m1 exon x, y, z" would lead to such a DGE difference displayed for "aten_0.1.m1.10016.m1".
How do you see this?

Thanks
Pat

Plotting, plot by gene and by exon.

## Plot by gene
plot_host_gene <- function(gene) {
  expn <- gene_host_v$E[gene_host_v$genes$gene == gene, ]
  gene_host_v$targets %>% 
    mutate(expn = expn) %>% 
    ggplot(aes(x=Strain, y = expn, colour = CellType)) + 
    geom_point(position = position_jitter(width = 0.2)) +
    stat_summary(colour = "black") +
    ggtitle(gene) +
    theme(legend.position = "none")
}
# gene of choice
plot_host_gene("aten_0.1.m1.10016.m1")


## Plot by exon
plot_host_gene_by_exon <- function(gene) {
  host_v$E[str_detect(host_v$genes$EntrezGeneID, "aten_0.1.m1.1.m1."), ] %>% 
    as.data.frame() %>% 
    mutate(exon = host_v$genes$EntrezGeneID[str_detect(host_v$genes$EntrezGeneID, "aten_0.1.m1.1.m1.")]) %>% 
    gather(sample, expn, -exon) %>% 
    left_join(host_v$targets %>% as.data.frame() %>% rownames_to_column("sample")) %>% 
    ggplot(aes(x=Strain, y = expn, colour = CellType)) + 
    geom_point(position = position_jitter(width = 0.2)) +
    stat_summary(colour = "black") +
    ggtitle(gene) +
    facet_wrap(~exon) +
    theme(legend.position = "none")
}
# exons of gene of choice
plot_host_gene_by_exon("aten_0.1.m1.10016.m1")

```e example gene of the host "aten_0.1.m1.10016.m1".

Hardcoding the "aten_0.1.m1.1.m1." in the by exon plot probably the cause here. Found another issue if there was only a single exon for a gene though, so I'll put in a fix for both.