Drkcore

10 08 2007 chemoinformatics perl Tweet

pngのメタデータにmol形式の文字列を埋め込む

OSRAがええよとか言ってたわけだが、そもそも画像のメタデータに構造情報埋め込めばいいやん的発想なのがこのエントリ。

use Image::ExifTool qw(:Public);
use XXX;

$info = ImageInfo('rosiglitazone.png');

XXX $info;

で実行

$ wget http://depth-first.com/demo/20070801/rosiglitazone.png
$ perl etest.pl rosiglitazone.png 
---
BitDepth: 8
ColorType: RGB with Alpha
Compression: Deflate/Inflate
Directory: .
ExifToolVersion: 6.90
FileModifyDate: 2007:08:01 21:18:16
FileName: rosiglitazone.png
FileSize: 8 kB
FileType: PNG
Filter: Adaptive
ImageHeight: 109
ImageSize: 327x109
ImageWidth: 327
Interlace: Noninterlaced
MIMEType: image/png
PixelUnits: Unknown
PixelsPerUnitX: 1
PixelsPerUnitY: 1
molfile: |-
  name
  params
  comments
   25 27  0  0  0  0  0  0  0  0  0 V2000
      1.6910   -6.1636    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
      2.5571   -6.6636    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
      3.4231   -6.1636    0.0000 N   0  0  0  0  0  0  0  0  0  0  0  0
      3.4231   -5.1636    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
      2.5571   -4.6636    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
      1.6910   -5.1636    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
      4.2891   -4.6636    0.0000 N   0  0  0  0  0  0  0  0  0  0  0  0
    ...
   23 19  1  0  0  0  0
   22 24  2  0  0  0  0
   20 25  2  0  0  0  0
  M  END
...
  at etest.pl line 6

論文のpdfとかもこういう感じで画像を埋め込んでくれればちょっとはデータが取り出しやすくていいかも。

About

  • もう5年目(wishlistありマス♡)
  • 最近はPythonとDeepLearning
  • 日本酒自粛中
  • ドラムンベースからミニマルまで
  • ポケモンGOゆるめ

Tag

Python Deep Learning javascript chemoinformatics Emacs sake and more...

Ad

© kzfm 2003-2021