Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SDPA_Pet
    Senior Member
    • Apr 2013
    • 222

    #1

    Which R package can do this

    Hi, I have dataset of list name of genes and the gene hits. I would like to calculate over representation genes in R.

    I was wondering which R package can do this.

    Can anyone recommend some good R packages for analyzing and plotting metagenomics data (best for microbes).

    Thanks.
  • JackieBadger
    Senior Member
    • Mar 2009
    • 385

    #2
    Bioconductor should do the trick http://www.bioconductor.org

    Comment

    • dariober
      Senior Member
      • May 2010
      • 311

      #3
      Originally posted by SDPA_Pet View Post
      Hi, I have dataset of list name of genes and the gene hits. I would like to calculate over representation genes in R.

      I was wondering which R package can do this.
      I think what you want is to apply the hypergeometric test which in R is implememted in the function phyper

      Code:
      phyper(q, m, n, k, ...)
      
      x, q 	vector of quantiles representing the number of white balls drawn without replacement from an urn which contains both black and white balls.
      m 	the number of white balls in the urn.
      n 	the number of black balls in the urn.
      k 	the number of balls drawn from the urn.
      ...

      Comment

      • SDPA_Pet
        Senior Member
        • Apr 2013
        • 222

        #4
        Originally posted by JackieBadger View Post
        Bioconductor should do the trick http://www.bioconductor.org
        Hi, I checked bioconductor which includes lots of package. Can you tell me which one can help me find over representation genes.

        Also, which package can help me draw a heat map.

        Thank you.

        Comment

        • mikep
          Member
          • Feb 2011
          • 45

          #5
          Originally posted by SDPA_Pet View Post
          Hi, I checked bioconductor which includes lots of package. Can you tell me which one can help me find over representation genes.

          Also, which package can help me draw a heat map.

          Thank you.
          For all those people who find it more convenient to bother you with their question rather than to Google it for themselves.


          However, you're probably better off with MEV

          Comment

          • Simon Anders
            Senior Member
            • Feb 2010
            • 995

            #6
            Maybe, if you explained more about what kind of data you have, you might get more helpful responses. "Metagnomics data" could be anything from a buch of FASTQ files to a list of species.

            Comment

            • SDPA_Pet
              Senior Member
              • Apr 2013
              • 222

              #7
              Hi Simon,

              Sorry about the confused. I have a table generated from metagenomic data. For each sample, I have two columns. One column the name of gene and the other the number of hits. Total, I have 10 samples. I would like to find out which genes are over representative.

              That is it.

              Comment

              • Blahah404
                Member
                • Dec 2011
                • 48

                #8
                In that case, dariober's suggestion of the hypergeometric test is appropriate.

                Comment

                • SDPA_Pet
                  Senior Member
                  • Apr 2013
                  • 222

                  #9
                  Hi Blahah, I am newbie. If I want to do hypergeometric test, which package I should use. Can you give me the R package name. That's all I want to know.

                  Someone just tells me use bio-conduct, but it includes hundreds of packages.

                  Comment

                  • Blahah404
                    Member
                    • Dec 2011
                    • 48

                    #10
                    @SDPA_Pet read @dariober's post above... he tells you the R function is phyper. You don't need a package - it's in the R base installation.

                    Comment

                    • SDPA_Pet
                      Senior Member
                      • Apr 2013
                      • 222

                      #11
                      OK, Thanks.

                      Comment

                      • SDPA_Pet
                        Senior Member
                        • Apr 2013
                        • 222

                        #12
                        BTW, what is the functional level I should do the analysis. I can do COG function level (the lowest) or I can do COG categories (the highest).

                        If I do lowest, there will be thousands of functional genes.

                        Comment

                        • SDPA_Pet
                          Senior Member
                          • Apr 2013
                          • 222

                          #13
                          Hi, I still don't know how to use the find over representative genes via phyper (someone recommends this command) or other R package. I attached a csv file as an example. Can anyone write a R scripts for me with my dataset.

                          In my dataset, the first row are my sample name. The first column is COG category ID. The numbers are gene counts.

                          Thank you.
                          Attached Files

                          Comment

                          • Simon Anders
                            Senior Member
                            • Feb 2010
                            • 995

                            #14
                            Most people here seemed to have jumped to the conclusion that you want to do an enrichment test, and there, in fact, the hypergeometric test (also known as Fisher's exact test) is the customary thing to do, usually with the R function 'fisher.test', which internally calls 'phyper'.

                            I really don't see how this applies here. Please explain your setting again: By number of "hits" in your table, you mean the number of sequencing reads that mapped to this gene, right?

                            Now, what do you mean by "overrepresented"? Are you looking for genes which appear more often in one kind of samples than in the other? (E.g.: You have 5 samples from shallow water, 5 from deep water: Which genes differ in their abundance between these two types?)

                            What kind of samples are we talking about?

                            Comment

                            • SDPA_Pet
                              Senior Member
                              • Apr 2013
                              • 222

                              #15
                              Hi Simon,

                              I am sorry I didn't explain it clearly.

                              The number of "hits" in your table, I mean the number of sequencing reads that mapped to this gene. ( you are right)
                              In the file that I attached, I am interested in the 2nd column (OSP_8 100 Spring Plain). I want to compare the 2nd column to the 3rd and 4th column.

                              "Over-representative": I want to find that which genes in the sample OSP_8 100 Spring Plain are more abundant (or different) than other 2 samples.

                              Do you know how to write the code?

                              Comment

                              Latest Articles

                              Collapse

                              • SEQadmin2
                                Beyond CRISPR/Cas9: Understand, Choose, and Use the Right Genome Editing Tool
                                by SEQadmin2



                                CRISPR/Cas9 sparked the gene editing revolution for both research and therapeutics.1 But this system still showed severe issues that limited its applications. The most prominent were the heavy reliance on PAM sequences, delivery limitations, double-stranded breaks that prompt unintended edits and cell death, and editing inefficiency (both in targeting and in knock-in reliability).

                                Despite this, “CRISPR helped turn genome editing from a specialized technique into
                                ...
                                07-31-2026, 11:01 AM
                              • SEQadmin2
                                Proteomic Platforms: How to Choose the Right Analytical Strategy to Improve Detection and Clinical Applications
                                by SEQadmin2


                                Proteomics platforms are evolving rapidly, with advances in mass spectrometry and affinity-based approaches expanding what researchers can detect and at what scale. As the field moves toward deeper proteome coverage and clinical applications, scientists face an increasingly complex landscape of tools. This article will explore how researchers are navigating these choices to find the right platform for their work.

                                The systematic characterization of the human proteome has
                                ...
                                07-20-2026, 11:48 AM
                              • 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

                              ad_right_rmr

                              Collapse

                              News

                              Collapse

                              Topics Statistics Last Post
                              Started by SEQadmin2, 07-31-2026, 02:55 AM
                              0 responses
                              19 views
                              0 reactions
                              Last Post SEQadmin2  
                              Started by SEQadmin2, 07-24-2026, 12:17 PM
                              0 responses
                              16 views
                              0 reactions
                              Last Post SEQadmin2  
                              Started by SEQadmin2, 07-23-2026, 11:41 AM
                              0 responses
                              16 views
                              0 reactions
                              Last Post SEQadmin2  
                              Started by SEQadmin2, 07-20-2026, 11:10 AM
                              0 responses
                              26 views
                              0 reactions
                              Last Post SEQadmin2  
                              Working...