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
        Essential Discoveries and Tools in Epitranscriptomics
        by seqadmin




        The field of epigenetics has traditionally concentrated more on DNA and how changes like methylation and phosphorylation of histones impact gene expression and regulation. However, our increased understanding of RNA modifications and their importance in cellular processes has led to a rise in epitranscriptomics research. “Epitranscriptomics brings together the concepts of epigenetics and gene expression,” explained Adrien Leger, PhD, Principal Research Scientist...
        04-22-2024, 07:01 AM
      • 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

      ad_right_rmr

      Collapse

      News

      Collapse

      Topics Statistics Last Post
      Started by seqadmin, Yesterday, 08:47 AM
      0 responses
      15 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 04-11-2024, 12:08 PM
      0 responses
      60 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 04-10-2024, 10:19 PM
      0 responses
      60 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 04-10-2024, 09:21 AM
      0 responses
      54 views
      0 likes
      Last Post seqadmin  
      Working...
      X