Question: Allele-specific expression with different gene lenghts
gravatar for gtechbio
2 days ago by
gtechbio0 wrote:

I want to use DESeq2 for assessing allele-specific expression. I will compare gene-level allelic counts of a yeast hybrid (basically comparing counts of orthologous genes of parentals of this hybrid).
I'm aware of this tutorial

My question is that parentals might have orthologous genes with different lengths, so for example ortholog in parent A is 1000bp and in parent B is 1020 bp. Is it possible at some step of DESeq2 to account for this length difference?


ADD COMMENTlink modified 1 day ago by Michael Love17k • written 2 days ago by gtechbio0
gravatar for Michael Love
1 day ago by
Michael Love17k
United States
Michael Love17k wrote:

If you provide a matrix at the beginning of the analysis called “avgTxLength”, the analysis will control for gene length changes across sample. This should happen before running DESeq().

assays(dds)[["avgTxLength"]] <- lengths
ADD COMMENTlink written 1 day ago by Michael Love17k

Hi Michael,

Thanks for reply.

Just to make sure I do everything in order:

My `count_table` looks like

                        SC1    SC2    SC3    SU1    SU2    SU3
YBR177C_Sbay_4.429      2711   3397   3765   1246   2156   3287
YIL140W_Sbay_9.48         178    111    204    109    271    250
YLR268W_Sbay_10.366    1208   1170   1704    631    825    865

The code is

groups<-factor(x=c(rep("SC",3), rep("SU",3)), levels=c("SC","SU"))

colData <- DataFrame(condition=groups)

dds <- DESeqDataSetFromMatrix(count_table, colData, formula(~condition))
assays(dds)[["avgTxLength"]] <- as.matrix(length_data)   ### correcting for gene length

`length_data` looks like

                       SC1   SC2   SC3   SU1   SU2   SU3
YBR177C_Sbay_4.429     1353  1353  1353  1359  1359  1359
YIL140W_Sbay_9.48      2469  2469  2469  2457  2457  2457
YLR268W_Sbay_10.366     642   642   642   642   642   642
sizeFactors(dds) <- c(as.numeric(rep("1",6)))   ### this is allelic expression, so everything comes from the same library
dds <- DESeq(dds)
res <- results(dds)

Is everything correct?
Cheers and sorry if formatting is a bit messed

EDIT: When I omit sizeFactors(dds) <- c(as.numeric(rep("1",6))), I get the message `using 'avgTxLength' from assays(dds), correcting for library size`, but if I do both preset library size to 1 and feed the code with gene length, I do not receive the message above. Does it mean that with predefined size factors its not possible to account for gene length?

ADD REPLYlink modified 12 minutes ago • written 36 minutes ago by gtechbio0
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.2.0
Traffic: 318 users visited in the last hour