0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

MOL2 ファイルの分割

Last updated at Posted at 2016-03-31

巨大な化合物ファイルのままだと扱いにくくてバラしたいとき用メモ。

Open Babel を使う場合

--splitinto (Open Babel Wiki)

適当なファイル数に分割したいとき
babel (大きなファイル).mol2 -omol2 --splitinto (分割数)

(ぴったり割り切れないときの端数は適当にやってくれる模様)
、、だが実は未実装? 機能してないかも。
こちら のやり方がよろしいかも。

Options (Open Babel v2.3.1 documentation)

1化合物ずつバラバラにしたいとき
babel -m (大きなファイル).mol2 -omol2 (prefix_)

シェルでやる場合

なぜか上記のやり方で、特定のファイルで途中でコケてダメなときがわりとあるので、、

1化合物ずつバラバラにしたいとき
csplit (大きなファイル).mol2 '/@<TRIPOS>MOLECULE/' '{*}' --prefix (prefix_)

どうしても一律の連番 filename になってしまうので、化合物 ID とかをファイル名にしたい場合は
あとで付け替えるしかないですかね。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?