Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • egorleg
    Junior Member
    • Oct 2010
    • 2

    GOseq errors

    Hi

    Below is the code I used and the errors returned for the GOseq R package. I would appreciate any suggestions as to how to resolve them.

    Regards

    Bill

    ________________________________________________________

    > library(goseq)
    > de.genes <- scan("DE_genes.txt", what=character() )
    Read 2744 items
    > all.genes <- scan("all_genes.txt", what=character() )
    Read 35180 items
    > genes = as.integer(all.genes %in% de.genes)
    > names(genes) = all.genes
    > pwf = nullp(genes, "mm9", "ensGene")
    Loading mm9 length data...
    > mapping=read.table("innatedb.in",header=TRUE,sep="\t")
    > innatedb=split(mapping$Pathway,mapping$ID)
    > pathways=goseq(genes,pwf,gene2cat=innatedb)
    Using manually entered categories.
    Error in summary(map)[, 1] : incorrect number of dimensions

    > head(pathways, n = 50)
    Error in head(pathways, n = 50) : object 'pathways' not found
    > enriched.pathways = pathways$category[pathways$upval < 0.01]
    Error: object 'pathways' not found
    > enriched.pathways
    Error: object 'enriched.pathways' not found
  • colinm
    Junior Member
    • May 2011
    • 1

    #2
    I ran into the same problem using manual annotations. If you look in the code, the goseq function restricts the list gene2cat to names that are present in the rownames of the data.frame kicked out by nullp. If you don't add the names of the data used to generate the list to the rownames of the data.frame, it chokes in the 'reversemapping' function because it is dealing with a null list. This fixed the problem for me:

    N = nullp(DEgenes = DETECTED_VECTOR,bias.data=LENGTHS_VECTOR)
    rownames(N) <- names(LENGTHS_VECTOR) ##this is what fixes it
    go = goseq(N,gene2cat=GENES_TO_CAT_LIST,method='Wallenius')

    Obviously you'll have to tailor it a bit to your situation, but I hope that helps.

    -Colin

    Comment

    • crh
      Member
      • Dec 2009
      • 46

      #3
      Hi,

      I'm running into the same problem I think.

      > sessionInfo()
      R version 2.12.2 (2011-02-25)
      Platform: i386-apple-darwin9.8.0/i386 (32-bit)

      other attached packages:
      [1] goseq_1.2.0 geneLenDataBase_0.99.5 BiasedUrn_1.03


      Here's a snippet of my code:

      > all <- read.delim("qd_de_gene_size_down_only.txt",header=T,stringsAsFactors=FALSE)
      > head(all)
      gene CDS DE
      1 au5.g1.t1 927 0
      2 au5.g10.t1 795 0

      >
      > #list of assayed genes
      > assayed.genes<-all$gene
      > head(assayed.genes)
      [1] "au5.g1.t1" "au5.g10.t1" "au5.g100.t1" "au5.g1000.t1"
      [5] "au5.g10000.t1" "au5.g10001.t1"
      > is.vector(assayed.genes)
      [1] TRUE
      >
      > #read gene lengths (CDS)
      > gene.length<-all$CDS
      > head(gene.length)
      [1] 927 795 1941 2317 207 4239
      > is.vector(gene.length)
      [1] TRUE
      >
      > #list of DE genes (0|1) caution: use UP_ONLY file for goseq, or DOWN_only
      > de.genes<-all$DE
      > head(de.genes)
      [1] 0 0 0 0 0 0
      > is.vector(de.genes)
      [1] TRUE
      >
      >
      > #gene vector
      > gene.vector<-as.integer(de.genes)
      > names(gene.vector)<-assayed.genes
      >
      > #KEGG annotations data frame
      > #au5.g10000_t1 520259 Ribosome
      > go<-read.delim("../ids_kegg_map_associations.txt",header=FALSE,stringsAsFactors=FALSE)
      > head(go)
      V1 V2 V3
      1 au5.g10000_t1 520259 map03010
      2 au5.g10001_t1 520260 map00480

      > go.terms=data.frame(go$V1,go$V3)
      > head(go.terms)
      go.V1 go.V3
      1 au5.g10000_t1 map03010
      2 au5.g10001_t1 map00480
      3 au5.g10002_t1 <NA>
      4 au5.g10003_t1 <NA>
      5 au5.g10004_t1 <NA>
      6 au5.g10005_t1 <NA>
      > is.data.frame(go.terms)
      [1] TRUE

      > pwf=nullp(gene.vector,bias.data=gene.length)
      >
      > stats=goseq(pwf,gene2cat=go.terms,method='Wallenius')#good for R 2.12
      Using manually entered categories.
      Error in summary(map)[, 1] : incorrect number of dimensions
      In addition: Warning message:
      In goseq(pwf, gene2cat = go.terms, method = "Wallenius") :
      Gene column could not be identified in gene2cat conclusively, using the one headed go.V1
      >


      If I construct

      rownames(pwf) <- names(gene.length) ##this is what fixes it

      I get the same error:

      > pwf=nullp(gene.vector,bias.data=gene.length)
      > rownames(pwf) <- names(gene.length) ##this is what fixes it
      > stats=goseq(pwf,gene2cat=go.terms,method='Wallenius')#good for R 2.12
      Using manually entered categories.
      Error in summary(map)[, 1] : incorrect number of dimensions
      Calls: goseq -> reversemapping
      In addition: Warning message:
      In goseq(pwf, gene2cat = go.terms, method = "Wallenius") :
      Gene column could not be identified in gene2cat conclusively, using the one headed go.V1
      Execution halted


      Any suggestions welcomed - I'm missing something simple I suspect.

      Charles

      Comment

      • crh
        Member
        • Dec 2009
        • 46

        #4
        I found the problem - different formatting of IDs imported:

        all: au5.g1.t1

        go.terms:au5.g1_t1


        dope!

        Charles

        Comment

        • tedtoal
          Junior Member
          • Dec 2011
          • 3

          #5
          Error in summary(map)[, 1] : incorrect number of dimensions

          Examples in the goseq pdf file dated 1 April 2010 show goseq() being called with the first argument "genes" and second argument "pwf". This is wrong. The "genes" argument is not used with goseq(). Its first argument is "pwf".
          See ?goseq

          Comment

          • melis
            Junior Member
            • Nov 2011
            • 6

            #6
            Hi all,
            I am also having the same problem. My ID format is the same but still I get the same error when I run this.

            > stats=goseq(pwf,gene2cat=go.terms,method='Wallenius')
            Using manually entered categories.
            Error in summary(map)[, 1] : incorrect number of dimensions
            In addition: Warning message:
            In goseq(pwf, gene2cat = go.terms, method = "Wallenius") :
            Gene column could not be identified in gene2cat conclusively, using the one headed go.ID

            Does anyone know the source of the error? What is "dimensions" mentioned in the message?

            Thanks!
            Melis

            Comment

            • upendra_35
              Senior Member
              • Apr 2010
              • 102

              #7
              Originally posted by tedtoal View Post
              Examples in the goseq pdf file dated 1 April 2010 show goseq() being called with the first argument "genes" and second argument "pwf". This is wrong. The "genes" argument is not used with goseq(). Its first argument is "pwf".
              See ?goseq
              Thanks for the hint. I got into the same problem as everyone above and your hint helped me to fix it. Thanks

              Comment

              Latest Articles

              Collapse

              • SEQadmin2
                Advanced Sequencing Platforms Tackle Neuroscience’s Toughest Genomics Problems
                by SEQadmin2



                Genomics studies in neuroscience face a special challenge due to the brain’s complexity and scarcity of samples. Mapping changes in cell type and state using conventional next-generation sequencing methods remains challenging. Advances in technologies like single-cell sequencing, spatial transcriptomics, and long-read sequencing have opened the door to deeper studies of the brain and diseases like Alzheimer’s, amyotrophic lateral sclerosis (ALS), and schizophrenia.
                ...
                07-09-2026, 11:10 AM
              • SEQadmin2
                Cancer Drug Resistance: The Lingering Barrier to Rising Survival
                by SEQadmin2



                Cancer survival rates have significantly increased in the last few decades in the United States, reaching a combined 70% 5-year survival rate by 2021. Behind this number, there are years of research to find new therapies, drug targets, and early detection methods. But there is one core challenge that keeps slowing down these advances, and it’s about drug resistance.

                There is no single reason why many patients don’t respond to treatment as expected. Cancer is...
                07-08-2026, 05:17 AM
              • GATTACAT
                Reply to Nine Things a Sample Prep Scientist Thinks About Before Sequencing
                by GATTACAT
                Love this - good data definitely starts from good input, and poor input can only give relatively poor data. I particularly like the mention of Nanodrop/absorbance based methods for quantification. It's such a toss up if you'll get an accurate reading or what amounts to a randomly generated number, and a lot of library/sequencing related issues can be traced back to poor quant.
                07-01-2026, 11:43 AM

              ad_right_rmr

              Collapse

              News

              Collapse

              Topics Statistics Last Post
              Started by SEQadmin2, 07-13-2026, 10:26 AM
              0 responses
              24 views
              0 reactions
              Last Post SEQadmin2  
              Started by SEQadmin2, 07-09-2026, 10:04 AM
              0 responses
              34 views
              0 reactions
              Last Post SEQadmin2  
              Started by SEQadmin2, 07-08-2026, 10:08 AM
              0 responses
              21 views
              0 reactions
              Last Post SEQadmin2  
              Started by SEQadmin2, 07-07-2026, 11:05 AM
              0 responses
              34 views
              0 reactions
              Last Post SEQadmin2  
              Working...