How to randomly select lines from a bed file? More specifically, I want to create a smaller bed file of genomic regions (chip-seq peaks) from a larger one, while maintaining the relative proportion of lines from each chromosome. For example if my input file has 1000 lines and want to select 100 lines randomly but maintaining the chromosome proportions relatively same.
It seems that this question was asked earlier here but I did not find the right solution? (How To Randomly Sample A Subset Of Lines From A Bed File)
Can you suggest me some tools or using awk or based on shell script.
Thank you, Naresh D J