Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tinguzman
    Member
    • Aug 2014
    • 13

    #1

    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
  • Jeremy
    Senior Member
    • Nov 2009
    • 190

    #2
    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.

    Comment

    Latest Articles

    Collapse

    • SEQadmin2
      16S/ITS Profiling vs. Shotgun Metagenomics: What Changes in Your Workflow?
      by SEQadmin2




      NGS has revolutionized clinical microbiology by offering new ways to identify and surveil pathogens without prior knowledge of the target. One popular approach is 16S rRNA and ITS amplicon sequencing, which targets specific microbial markers. But studies are increasingly incorporating shotgun metagenomics, a technique that sequences all DNA from a sample without targeting specific microbial markers. This approach allows more detailed taxonomic classification, detection...
      Today, 06:46 AM
    • SEQadmin2
      Multiomic Liquid Biopsy: What DNA/RNA Panels Reveal That DNA Alone Can’t
      by SEQadmin2



      Tumors contain complex mixtures of cell populations that evolve in response to treatment and host-specific factors. Tissue biopsies provide only static snapshots of a tumor’s state. But what if we could follow that evolution over time using a minimally invasive technique?

      Liquid biopsies can detect tumor-derived material circulating in the bloodstream, providing a way to study treatment response, detect emerging resistance, and discover new biomarkers. Circulating
      ...
      10-14-2026, 09:55 AM

    ad_right_rmr

    Collapse

    News

    Collapse

    Topics Statistics Last Post
    Started by SEQadmin2, 10-28-2026, 09:57 AM
    0 responses
    23 views
    0 reactions
    Last Post SEQadmin2  
    Started by SEQadmin2, 10-28-2026, 09:51 AM
    0 responses
    15 views
    0 reactions
    Last Post SEQadmin2  
    Started by SEQadmin2, 10-22-2026, 11:13 AM
    0 responses
    68 views
    0 reactions
    Last Post SEQadmin2  
    Started by SEQadmin2, 10-22-2026, 10:48 AM
    0 responses
    48 views
    0 reactions
    Last Post SEQadmin2  
    Working...