SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics



Similar Threads
Thread Thread Starter Forum Replies Last Post
loading custom annotation on topgo tinguzman Bioinformatics 2 04-29-2015 04:45 AM
K-means clustering and heatmap crazyhottommy Bioinformatics 3 02-04-2014 10:12 PM
first read in a pair means F3 or R3? yhong General 1 08-24-2011 10:10 AM
what does it means Moodi Genomic Resequencing 2 01-24-2011 05:55 PM
What does NS:i:1 means in the .sam format files? Gangcai Bioinformatics 2 04-20-2010 11:51 AM

Reply
 
Thread Tools
Old 09-10-2014, 09:10 PM   #1
tinguzman
Member
 
Location: Philippines

Join Date: Aug 2014
Posts: 13
Default TopGo, factor of 1 means

Hi,

I'm trying to do GO enrichment analysis using topgo, but i've encountered a problem, read below. what does factor w/ level 1 mean? it says that i should have 2 level factors. how can I fix this?


> myInterestingGenes <- as.vector(AvsB$genes)
> geneList <- factor(as.integer(geneNames %in% myInterestingGenes))
> names(geneList) <- geneNames
> names
function (x) .Primitive("names")
> str(geneList)
Factor w/ 1 level "0": 1 1 1 1 1 1 1 1 1 1 ...
- attr(*, "names")= chr [1:18756] "Genes" "c10020_g1" "c10035_g1" "c10052_g1" ...


Error in .local(.Object, ...) : allGenes must be a factor with 2 levels
tinguzman is offline   Reply With Quote
Old 09-15-2014, 02:54 AM   #2
Jeremy
Senior Member
 
Location: Pathum Thani, Thailand

Join Date: Nov 2009
Posts: 190
Default

Your problem is probably from this line

geneList <- factor(as.integer(geneNames %in% myInterestingGenes))

geneNames %in% myInterestingGenes will return a vector of TRUE / FALSE of length length(geneNames)
converting that to an interger will make it 1's and 0's. In this case it seems that every element of geneNames overlaps with an element in myInterestingGenes resulting a vector of 1's which you then change to a factor. If you are supposed to have a vector of only 1's then you can set the levels in the factor call to make sure that the factor has 2 levels, but then you still only one type which is probably not what you intend.
Jeremy is offline   Reply With Quote
Reply

Tags
enrichment, rnaseq data

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off




All times are GMT -8. The time now is 03:04 AM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Single Sign On provided by vBSSO