Question: Uneven Datasets Deseq2 how to fix factor(rep(c("A","B"),each=3))?
gravatar for williamsbrian5064
12 weeks ago by
williamsbrian506490 wrote:

I have a set of data that consists of 4 controls samples and 2 affected samples. I am trying to use Deseq2 for some DE but I am running into an issue. I have been successful working with Deseq2 in the past, but I have always had equal data sets. I have pretty much have been following along through the Deseq2 tutorial here. I figured out where my issue is. There is a line that says

dir <- system.file("extdata", package="tximportData")
samples <- read.table(file.path(dir,"samples.txt"), header=TRUE)
samples$condition <- factor(rep(c("A","B"),each=3))
rownames(samples) <- samples$run

The line that is giving me all the issues is

samples$condition <- factor(rep(c("A","B"),each=3))

It is assume that I have two group and each group contains 3 samples. Even when I take away the "each=3", it still just assumes there are two group with 3 samples in each group. What I really have is two groups, group A containing 4 samples and group B containing 2 samples.

Is there a way to fix this? I know people work with uneven datasets all the time so I hope this is an easy fix.

assembly rna-seq next-gen R • 135 views
ADD COMMENTlink modified 12 weeks ago • written 12 weeks ago by williamsbrian506490
gravatar for h.mon
12 weeks ago by
h.mon16k wrote:
samples$condition <- factor( c( "A","A","A","A","B","B" ) )
ADD COMMENTlink modified 12 weeks ago • written 12 weeks ago by h.mon16k

BOOM! Worked like a charm. Thank you very very much for your help.

ADD REPLYlink written 12 weeks ago by williamsbrian506490

If an answer was helpful, you should upvote it; if the answer resolved your question, you should mark it as accepted. You can accept more than one if they work.

ADD REPLYlink modified 12 weeks ago • written 12 weeks ago by genomax51k
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.3.0
Traffic: 1577 users visited in the last hour