Hi,

I used data set from Encode consortium for my package development, due to size of actual peak files are rather big, I can't use these data set for my package use. Because actual size of package resulted from R CMD build must be less than 4Mb on disk, I have to use rather small peak file as an example data for my package . In Encode sample's data set, each peak files contains around 100,000 peaks each. How can I edit rather big bed files in order to keep particular chromosome ? Is there any handy tools to edit peak files ? Thanks in advance :)

Best regards :

Jurat
If you have GNU Parallel installed, you can use this with [BEDOPS `bedextract`][1] to very quickly split a BED file by chromosome:

    $ bedextract --list-chr input.bed | parallel "bedextract {} input.bed > input.{}.bed"

You can then use my [`sample` utility][2] or GNU `shuf` to uniformly sample without replacement:

    $ sample -k ${SAMPLE_SIZE} input.chrN.bed > input.chrN.sample.bed

Or:

    $ shuf --head-count=${SAMPLE_SIZE} input.chrN.bed > input.chrN.sample.bed


  [1]: http://bedops.readthedocs.io/en/latest/content/reference/set-operations/bedextract.html
  [2]: https://github.com/alexpreynolds/sample