![]() |
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 |
See if this works.
Code:
awk '/^track/{x="Track"++i".bed";}{print > x;}' your_bed_file |
works like a charm thanks a lot!!
|
awk '{print $0 >> $1".bed"}' in_bed
|
All times are GMT -8. The time now is 07:15 AM. |
Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2021, vBulletin Solutions, Inc.