Dear pybedtools developers,
Could you suggest a good strategy to use Unix sort in a pybedtools pipeline?
I have the following command (what it does is not relevant I guess):
tab= pybedtools.BedTool(regions).intersect(b= scoreBedGraph, wa= True, wb= True, sorted= True) \
.each(prepareForSortGroup) \
.sort() \
.groupby(g= [1], c= [1, 8], o= ['count', 'sum'])
Instead of pybedtools sort() I'd like to use the OS gnu sort. What I'm thinking to do is to write the output of pybedtools to a temp file, sort it using python subprocess module and read the sorted file back for further manipulations with pybedtools. However, I guess in this way I would miss the advantage of working with a single stream as above.
(Is there any plan to integrate Unix sort in pybedtools so that one could do something like bedtools.intersect(...).unix_sort(...).merge(...)?)
Thanks for the great suite!
Dario