|
From: Craig A. J. <cj...@em...> - 2011-06-03 18:27:14
|
On 6/3/11 12:56 AM, JP wrote:
> Hi there,
>
> Using OpenBabel 2.3.0, is there a way how to split a molecule file
> (e.g. sdf) into chunks?
>
> I can imagine two different modes of action:
>
> 0) split molecule file in n chunks
> 1) split molecule file in chunks of (at most) n molecules
>
> The use case for this is that sometimes you want to work with smaller
> files (e.g. when submitting multiple jobs on a cluster), or for
> testing of products.
Attached is a Perl program that we developed for this. We find it pretty useful.
Usage: split_sdf.pl [N] [-skip N] [-do N] [file.sdf]
N is number of SD records per file
-skip N Skip N records before starting output
-do N Do N records and then quit
-zap_extra_lf Zap extra linefeed between records
Files will be named with numeric suffix, e.g. "split_sdf.pl foo.sdf"
will generate files like these:
foo_1.sdf
foo_2.sdf
... etc.
Craig
|