Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • groupBy to find max value

    Does anyone know how i can use groupBy to find the max value, but print not the max value, but the position within the feature that the max value is associated with. To wit, if the value for a given position within a feature is in column 8, the position is in column 7 and the name of the feature is column 4. I first sort and group by c4. Then I ask for the max value at c8. But instead of printing c8 I need the program to print c7. Seems easy, but I can't figure it out. Thanks.

  • #2
    Hi,

    it sounds like you are trying to do this in R??

    I will leave an R solution to someone with a bit more groupBy knowledge than me.

    How about awk?

    awk '{if($8>max8) max8=$8;max7=$7}END{ print max7}' data_file.tab

    Bob

    Comment


    • #3
      Hmm, I posted too quickly without having my first sip of coffee. It seems as though I need another check in there for feature. Which I now see is the reason you wanted to use groupBy.

      Can you post a small portion of your file?

      Comment

      Latest Articles

      Collapse

      • 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
      • seqadmin
        Techniques and Challenges in Conservation Genomics
        by seqadmin



        The field of conservation genomics centers on applying genomics technologies in support of conservation efforts and the preservation of biodiversity. This article features interviews with two researchers who showcase their innovative work and highlight the current state and future of conservation genomics.

        Avian Conservation
        Matthew DeSaix, a recent doctoral graduate from Kristen Ruegg’s lab at The University of Colorado, shared that most of his research...
        03-08-2024, 10:41 AM

      ad_right_rmr

      Collapse

      News

      Collapse

      Topics Statistics Last Post
      Started by seqadmin, Yesterday, 06:37 PM
      0 responses
      10 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, Yesterday, 06:07 PM
      0 responses
      9 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 03-22-2024, 10:03 AM
      0 responses
      49 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 03-21-2024, 07:32 AM
      0 responses
      67 views
      0 likes
      Last Post seqadmin  
      Working...
      X