Uneven Datasets Deseq2 how to fix factor(rep(c("A","B"),each=3))?
1
0
Entering edit mode
6.0 years ago

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

library("tximport")
library("readr")
library("tximportData")
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
samples[,c("pop","center","run","condition")]

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.

rna-seq R Assembly next-gen • 1.5k views
ADD COMMENT
3
Entering edit mode
6.0 years ago
h.mon 35k
samples$condition <- factor( c( "A","A","A","A","B","B" ) )
ADD COMMENT
0
Entering edit mode

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

ADD REPLY
1
Entering edit mode

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.
Upvote|Bookmark|Accept

ADD REPLY

Login before adding your answer.

Traffic: 3298 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6