katerinakazantseva / strainy

Graph-based assembly phasing
Other
43 stars 4 forks source link

samtools merge fails with `too many open files` #33

Closed mikolmogorov closed 1 year ago

mikolmogorov commented 1 year ago

Sometimes there may be too many small bam files from single cluster to merge, and the command will fail because of OS limits on the number of input files (color_bam function in phase.py).

A proposed workaround: concatenate all bam files manually, by converting them into sam with samtools view. Then convert the resulting concatenate back to bam and sort it. Not too elegant, but should work for any number of files.

atabeerk commented 1 year ago

Implemented using the suggested method. We can revisit this and figure out a more efficient method if this ends up being a bottleneck.