Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • annavilborg
    Junior Member
    • Feb 2013
    • 8

    #1

    Extracting features above a certain coverage

    Hi,

    I have a bam file of all my accepted hits (output from tophat run on data from strand specific libraries/HiSeq) and an gtf file with my genes of interest for which I am trying to find potential antisense transcripts. I would like to create a list - preferably one that can be visualized in a genome browser - that shows all genes for which there are antisense reads in the accepted hits.bam file provided that there are more than a certain number of reads mapping to that gene. I can easily use bedtools intersect to get all genes that have antisense reads mapping to them, but this gives me way too many hits. I have also exported my resulting hits to excel to try to sort the file there (bioinformatics newbie that I am) but I can't get it back to a format that works for visualizing in a genome browser.

    Thank you.
  • annavilborg
    Junior Member
    • Feb 2013
    • 8

    #2
    Hi again,

    I have come up with a possible solution, but if anyone had some input to give I would very much appreciate it. If I did bedtools coverage to get the antisense coverage for each of my genes, and then sorted the resulting file on the coverage value? And then extracted everything in the first x lines? Could that work?

    I am unsure how to do the sorting and extracting. "sort" and "grep"? Any suggestions on the exact "phrasing"?

    Thank you!

    Comment

    • jparsons
      Member
      • Feb 2012
      • 62

      #3
      Once you have a coverage file, you can sort based on the result with "sort". the -n flag will sort numbers numerically (eg: 10<20<100 instead of 10<100<11<20) and the -kX flag will allow you to choose which key/column you wish to do the actual sort on. -k 4 would choose the 4th. -r would allow you to reverse the output to get the largest numbers first instead of last.

      I would suggest "head -X <filename>" to extract the first X lines, although i imagine grep could also do it relatively easily.

      Comment

      • annavilborg
        Junior Member
        • Feb 2013
        • 8

        #4
        This worked very well! Thank you!

        Comment

        • hanshart
          Member
          • Nov 2011
          • 27

          #5
          Originally posted by annavilborg View Post
          Hi,
          ... provided that there are more than a certain number of reads mapping to that gene...
          Thank you.
          Hi annavilborg,
          you can additionally pipe your sorted output to awk to get only those lines (genes) with read count above your threshold. Figure out which column (field) stores the read counts and then e.g. for field 4 and Threshold 100 apply something like:
          Code:
          bedtools coverage ... | awk '{if ($4>100) print $0}' | sort -nr -k 4
          $4 is the 4th field
          100 the read count threshold
          print $0 prints the content of the whole line
          sort -nr -k 4 will then numerically, reverse sort all these gene lines with readcount above threshold based on the corresponding column (4).

          Comment

          • annavilborg
            Junior Member
            • Feb 2013
            • 8

            #6
            Neat! Thank you!

            Comment

            Latest Articles

            Collapse

            • SEQadmin2
              Multiomic Liquid Biopsy: What DNA/RNA Panels Reveal That DNA Alone Can’t
              by SEQadmin2



              Tumors contain complex mixtures of cell populations that evolve in response to treatment and host-specific factors. Tissue biopsies provide only static snapshots of a tumor’s state. But what if we could follow that evolution over time using a minimally invasive technique?

              Liquid biopsies can detect tumor-derived material circulating in the bloodstream, providing a way to study treatment response, detect emerging resistance, and discover new biomarkers. Circulating
              ...
              10-14-2026, 09:55 AM
            • SEQadmin2
              New Genomics Technologies Take Aim at Long-Standing Limits
              by SEQadmin2


              Researchers using sequencing and genomics tools often have to make trade-offs. They can choose between speed or scale, short reads or long-range information, or targeted panels or a view of the whole transcriptome. New technologies that have been released this year are built to address those tough choices.

              We asked six companies the same four questions to learn about their latest products. The new technologies bring a lot to the table, including rethinking sequencing
              ...
              09-28-2026, 10:25 AM

            ad_right_rmr

            Collapse

            News

            Collapse

            Topics Statistics Last Post
            Started by SEQadmin2, Yesterday, 11:13 AM
            0 responses
            16 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, Yesterday, 10:48 AM
            0 responses
            16 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 10-15-2026, 10:52 AM
            0 responses
            35 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 10-14-2026, 05:39 AM
            0 responses
            42 views
            0 reactions
            Last Post SEQadmin2  
            Working...