Seqanswers Leaderboard Ad

Collapse

Announcement

Collapse
No announcement yet.
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Ok, my table is ready. Now, my problem is that I have non-numerical data in my columns. How can I avoid that? For example,
    plot(data$log2.FC.transcriptome., data$log2.FC.translatome.)

    In min(x) : no non-missing arguments to min; returning Inf

    Comment


    • #17
      As always, there are many ways, and many subtleties.
      If you've been using read.csv, I would recommend that you add the argument stringsAsFactors=FALSE.
      You don't need to bother with fread, which won't treat strings as factors.

      I'll just post two ways to do the filtering, supposing that you know the strings that you want to filter out.
      I'll have to get back to work on my own script then.
      There is an older, more conventional method, but dplyr has many advantages.

      Code:
      library(dplyr)
      data.filtered <- data %>% filter(log2.FC.transcriptome. != "Inf" & log2.FC.transcriptome. != "-Inf" & log2.FC.translatome. != "Inf" & log2.FC.translatome. != "-Inf")
      Older method
      Code:
      data.filtered <- data[data$log2.FC.transcriptome. != "Inf" & data$log2.FC.transcriptome. != "-Inf" & data$log2.FC.translatome. != "Inf" & data$log2.FC.translatome. != "-Inf", ]
      Sorry, I really have to go and finish my own script now.

      Comment


      • #18
        Ok, thanks so much for your time. You helped me so much. If you can read this, there's a problem with the %>%.
        Error: could not find function "%>%"

        The 2nd option you gave me deleted all data. The table is empty after that command.

        Comment


        • #19
          The "%>%" forward-pipe operator comes with dplyr.
          Either you haven't loaded the dplyr package, or you made a mistake writing the operator.
          It's just the greater sign in between two percentage sign, so the second mistake is less likely.
          Just make sure you've installed dplyr and loaded the package before using "%>%".

          Code:
          install.packages("dplyr")
          library(dplyr)

          For the problems you're experiencing with the more conventional filtering step, I'm not sure what the problem could be.
          I don't see any typos in my command, but there could always be a mistake on my part.
          The best troubleshooting step is always to simplify the command.
          Try just one filtering step at the time.

          Code:
          data.filtered <- data[data$log2.FC.transcriptome. != "Inf", ]
          I'm going to stop procrastinating now by spending time on seqanswers, and actually finish my own R script.

          Comment

          Latest Articles

          Collapse

          • seqadmin
            Current Approaches to Protein Sequencing
            by seqadmin


            Proteins are often described as the workhorses of the cell, and identifying their sequences is key to understanding their role in biological processes and disease. Currently, the most common technique used to determine protein sequences is mass spectrometry. While still a valuable tool, mass spectrometry faces several limitations and requires a highly experienced scientist familiar with the equipment to operate it. Additionally, other proteomic methods, like affinity assays, are constrained...
            04-04-2024, 04:25 PM
          • seqadmin
            Strategies for Sequencing Challenging Samples
            by seqadmin


            Despite advancements in sequencing platforms and related sample preparation technologies, certain sample types continue to present significant challenges that can compromise sequencing results. Pedro Echave, Senior Manager of the Global Business Segment at Revvity, explained that the success of a sequencing experiment ultimately depends on the amount and integrity of the nucleic acid template (RNA or DNA) obtained from a sample. “The better the quality of the nucleic acid isolated...
            03-22-2024, 06:39 AM

          ad_right_rmr

          Collapse

          News

          Collapse

          Topics Statistics Last Post
          Started by seqadmin, 04-11-2024, 12:08 PM
          0 responses
          31 views
          0 likes
          Last Post seqadmin  
          Started by seqadmin, 04-10-2024, 10:19 PM
          0 responses
          32 views
          0 likes
          Last Post seqadmin  
          Started by seqadmin, 04-10-2024, 09:21 AM
          0 responses
          28 views
          0 likes
          Last Post seqadmin  
          Started by seqadmin, 04-04-2024, 09:00 AM
          0 responses
          53 views
          0 likes
          Last Post seqadmin  
          Working...
          X