This is a test version of Biostars. For the public version, visit https://www.biostars.org.
how to set Deseq factor

Hi , I am new to R and this tool. i am following this given script

https://gist.github.com/stephenturner/f60c1934405c127f09a6

I want to do differential gene expression in my six samples. I want compare the expression of six samples .i have no control and exp data sample. i have simply six sample to compare to each other named as sample1. sample2, sample3, sample4, sample5 sample6..I have completed steps to stringtie now i want to use the Deseq tool . I have read tutorial. but i am stuck in this step how to set it according to my data

Assign condition (first four are controls, second four contain the expansion)

(condition <- factor(c(rep("ctl", 4), rep("exp", 4))))

r rna-seq assembly software error next-gen

Actually i want this comparison `> combn(6,2)

 [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14] [,15]

[1,] 1 1 1 1 1 2 2 2 2 3 3 3 4 4 5

[2,] 2 3 4 5 6 3 4 5 6 4 5 6 5 6 6`

1 answer

If you check what the example code does, you will get your answer:

> factor(c(rep("ctl", 4), rep("exp", 4)))
[1] ctl ctl ctl ctl exp exp exp exp
Levels: ctl exp

There are two levels, ctl and exp, and the code above is linking these levels with samples. Basically the first 4 samples are controls and the remaining are exp. This should be in the same order as your count table.

Your particular case, however, is not quite clear, the way you wrote your question implies that you do not have replicates, which I believe is not a good idea. Moreover, you want to compare all 6 samples with each other, which would provide 15 comparisons.

> combn(6,2)
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14] [,15]
[1,]    1    1    1    1    1    2    2    2    2     3     3     3     4     4     5
[2,]    2    3    4    5    6    3    4    5    6     4     5     6     5     6     6

If this is nevertheless what you want, just do:

> factor(1:6)
[1] 1 2 3 4 5 6
Levels: 1 2 3 4 5 6

I also would like to point out that based on the tutorial you shared, you are using Deseq2 and not Deseq, please see https://support.bioconductor.org/p/80395/

I have six RNAseq sample. ...how can i set the replicates ? Mean I havee to take the RNA from sample and sequenced it .?

I suggest you double check your experimental design, which hopefully includes biological replicates. Just declare the levels according to the order of the levels in the count matrix. For example if first three are control do the following:

> factor(c(rep("ctl", 3), rep("exp", 3)))
[1] ctl ctl ctl exp exp exp
Levels: ctl exp

Or if every other sample is a control you can do this:

> factor(rep(c("ctl", "exp"), 3))
[1] ctl exp ctl exp ctl exp
Levels: ctl exp

See the lines starting with [1], they denote which sample is of what kind, control or treatment.

Can you please help me more... can you set the script according to my dataset .?

If you don't have any replicates and 6 levels, you should use this as can be seen in my initial answer:

> factor(1:6)
[1] 1 2 3 4 5 6
Levels: 1 2 3 4 5 6

I am trying to create the coldata frame for DESeqDataSetFromMatrix design to instantiate the DESeqDataSet,

by using the following command

(coldata <- data.frame(row.names=colnames(countdata), condition))`

but i got this error

coldata <- data.frame(row.names=colnames(countData), condition)

Error in data.frame(row.names = colnames(countData), condition) :

row names supplied are of the wrong length

here is some lines of countDAta

> head(countData)


                 `G1 G2 G3  G4 G5 G6`

`TraesCS3A02G388200 32 28 53 117 7 25

TraesCS1D02G394800 0 0 0 0 0 0

TraesCS6B02G054100 4 14 0 0 9 7

TraesCS6B02G127556 0 0 0 0 0 0

TraesCS6A02G372500 0 0 0 0 0 0

TraesCS2D02G097400 0 14 0 0 0 0`

enter code here

how can i resolve this error

Log in to answer this question.