【问题标题】:open babel: how to create multiple output files (split the input)?open babel:如何创建多个输出文件(拆分输入)?
【发布时间】:2015-06-22 22:31:39
【问题描述】:

我有一个 .pdb 文件,其中包含同一分子的多个构象异构体。现在我想将这些conformers 中的每一个转换为一个单独的.xyz 文件。根据 open babel 的帮助,这可以通过 -m 选项来完成。

-m Produces multiple output files, to allow:
   Splitting: e.g.        babel infile.mol new.smi -m
    puts each molecule into new1.smi new2.smi etc
   Batch conversion: e.g. babel *.mol -osmi -m
    converts each input file to a .smi file

但这只会转换第一个几何图形然后停止:

babel -ipdb confs.pdb -oxyz test.xyz -m
  1 molecule converted
  14 audit log messages

(在 Ubuntu 和 OSX 上测试了 open babel 2.3.2)

有什么建议可以解决这个问题或改用哪个程序?

【问题讨论】:

  • 好的,它似乎适用于 .sdf,但目前不适用于 .pdb。

标签: openbabel


【解决方案1】:

使用这个 linux 命令分割你的 pdb 文件:

grep -n 'MODEL\|ENDMDL' models.pdb | cut -d: -f 1 | \
 awk '{if(NR%2) printf "sed -n %d,",$1+1; else printf "%dp models.pdb > model_%03d.pdb\n", $1-1,NR/2;}' |  bash -sf

输入文件为models.pdb,分割文件命名为model_0001.pdb、model_0002.pdb...等

更多详情:https://strucbio.biologie.uni-konstanz.de/ccp4wiki/index.php/Split_NMR-style_multiple_model_pdb_files_into_individual_models

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-09-08
    • 2020-06-20
    • 1970-01-01
    • 1970-01-01
    • 2014-08-13
    • 2018-11-18
    相关资源
    最近更新 更多