I’m trying to run GOSeq with human RNA Seq data that has been processed with Salmon, summarized to gene level with tximport, and DGE run using DeSeq2.
I was reading the vignette for GOSeq and got stuck/confused on the part where you need to know what human genome build you used... It says you need to know this to access the correct transcript length in their database.
This may be a stupid question/lack of understanding on my part...But with Salmon/tximport I do not have this information because I did not map to a specific genome, correct? So then could I just use the avgTX length from the tximport function to input to GOSeq to correct for length biases?
Thanks!
Thanks for the reply Steve!
So I spent literally all day trying to figure out how to go about doing that, now that I know its okay...and I think maybe I finally figured it out? Getting the data into the right format for GOseq is a bit of a beast for a novice R user!!
Any chance you're feeling super friendly and could take a look at my code?
Also, just in case someone in the future needs to do something like this, maybe the code will help them avoid a day of banging their head on the wall (assuming its correct code :D).
When I run GOseq the pwf plots are looking a bit odd which is the only thing that has me worried... This is link to the pwf plot https://ibb.co/h69iLH
There's a lot of code here, but I'm confused. If you need the gene or transcript lengths, it's simply:
Where 'x' is a vector of the row names in the order you want them (lined up with DEgenes)
Yea, I am still at the learning R stage where I tend to be very very inefficient with my code :D!
I have edited the above post with updated code and made it much more efficient. In my "banging my head" state yesterday I did a ton of rather useless steps I now realize.
The pwf plots are still looking a bit off I think, especially the second one? They are for two different DEG lists for contrasts between different biological groups.
https://imgur.com/a/1kyV8
https://ibb.co/iw8Bcx
Also, one more question: is it acceptable to use the built in goseq database's GO classification for hg19, even though I technically did not map to hg19 since I used Salmon? For some reason the data I downloaded from Ensembl Biomart for GO classifications seems to be different to what GOseq has and is maybe not as complete...
GO <- goseq(pwf = nullp.result, "hg19", "ensGene") gives me 22,205 GO classifications.
GO <- goseq(pwf = nullp.result, gene2cat = go.terms) gives me 17,705 GO classifications
p.s. Go Tar Heels!
The second plot is definitely not correct. I don't know what these are supposed to look like other than the power should increase with length. I'd make sure that you are providing the correct DEgenes, because it looks like you may have swapped DE and non-DE status.
For the second part, what matters is that the gene IDs that you used after quantifying and summarizing to gene-level match up with the gene IDs in GO. I'm not sure exactly about the internal mechanics of goseq().
I am pretty confident I included correctly the DE genes n the second plot as the number of "True"/"1" is equal to the number of differentially expressed genes in the list I imported... To get this list, I have been taking an overlap of genes significantly up-regulated in Tissue C when compared to either Tissue A or B.
The second plot was definitely odd though and I can't figure out why... It seems like a similar problem to what was posted here: Question: GoSeq: opposite pwf plot for up- and downregulated genes. But there wasn't really a clear resolution or reason for why the plots were coming out reversed when looking at subsets of genes that either up or down-regulated...
My first pwf plot which looks normal-ish is for the overlap of genes upregulated in Tissue A when compared to Tissue B and Tissue C. Similar thing holds true for the Tissue B upregulated genes. Tissue C is where it gets odd...
Tissue A upregulated (https://ibb.co/fD4wUc)
Tissue B upregulated (https://ibb.co/dKGh2x)
Tissue C upregulated (https://ibb.co/j7FLpc)
So something weird is happening with the list for Tissue C it seems?... Is it biologically possible that perhaps the genes DE in Tissue C are just shorter?