Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • Splitting a bed file in multiple bed files by track

    Hi

    I have a large combined bed files with several tracks (peaks called for several experiments) of the form

    track name="track name 1" description="description1" visibility=2
    chr1 1580180 1580696 3 12
    chr1 1645419 1645941 4 19
    chr1 1700177 1700614 5 10
    ...
    track name="track name 2" description="description1" visibility=2
    chr1...
    chr2...
    chrX


    etc

    is there a quick way to split this file into multiple beds (one for eack track)?

    Thanks a lot for your help

  • #2
    See if this works.

    Code:
    awk '/^track/{x="[COLOR="Red"]Track[/COLOR]"++i".bed";}{print > x;}' your_bed_file
    This should produce multiple files (one for each track) with names like "Track1.bed Track2.bed" etc. Modify the word highlighted in red to get corresponding file names.
    Last edited by GenoMax; 05-20-2013, 06:55 AM.

    Comment


    • #3
      works like a charm thanks a lot!!

      Comment


      • #4
        awk '{print $0 >> $1".bed"}' in_bed

        Comment

        Latest Articles

        Collapse

        • seqadmin
          Recent Innovations in Spatial Biology
          by seqadmin


          Spatial biology is an exciting field that encompasses a wide range of techniques and technologies aimed at mapping the organization and interactions of various biomolecules in their native environments. As this area of research progresses, new tools and methodologies are being introduced, accompanied by efforts to establish benchmarking standards and drive technological innovation.

          3D Genomics
          While spatial biology often involves studying proteins and RNAs in their...
          Yesterday, 07:30 PM
        • seqadmin
          Advancing Precision Medicine for Rare Diseases in Children
          by seqadmin




          Many organizations study rare diseases, but few have a mission as impactful as Rady Children’s Institute for Genomic Medicine (RCIGM). “We are all about changing outcomes for children,” explained Dr. Stephen Kingsmore, President and CEO of the group. The institute’s initial goal was to provide rapid diagnoses for critically ill children and shorten their diagnostic odyssey, a term used to describe the long and arduous process it takes patients to obtain an accurate...
          12-16-2024, 07:57 AM

        ad_right_rmr

        Collapse

        News

        Collapse

        Topics Statistics Last Post
        Started by seqadmin, 12-30-2024, 01:35 PM
        0 responses
        21 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 12-17-2024, 10:28 AM
        0 responses
        41 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 12-13-2024, 08:24 AM
        0 responses
        55 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 12-12-2024, 07:41 AM
        0 responses
        40 views
        0 likes
        Last Post seqadmin  
        Working...
        X