金曜は、大阪に出張して某workshopに参加しました。
発表の場をいただきまして、大変感謝しています。
後の発表が全て素敵だったので前座として(?)どうだったんだかは気になったりします。
発表後のディスカッションでいい意見もらったんで次ぎに繋げてきたいです。
懇親会でもいろんな方とお話しできて大変有意義でした。
発表すると色々とレスポンスいただけるんでそれっていいなーって思います。
いちいち話さなくても聞けばいいじゃないって意見ありますし、今回も申請でかなりもめましたけど粘った甲斐ありました。
これからもこのつながり大切にしたいです。
MMP/LEは結構どう使ったらいいかモヤモヤしてるのでその辺色々話し聞けてモチベーションアップです。懇親会でRDKitのMMPAってどんなオプションあるのかって話題になったんでちょっとソースコードを見てみました。
切断ルールは,,,
[#6+0;!$(*=,#[!#6])]!@!=!#[*]
[#6+0;!$(*=,#[!#6])] 炭素であり、二重結合、三重結合を形成していないと [*] 何かの元素が
!@!=!# ダブル/トリプルボンド/リングボンド以外で 単結合でつながっている部分。
だと思います。(多分、、、)
なので210行目当たり
smarts = Chem.MolFromSmarts("[#6+0;!$(*=,#[!#6])]!@!=!#[*]") #finds the relevant bonds to break #find the atoms maches matching_atoms = mol.GetSubstructMatches(smarts)
の結果、指定した結合を持つ原子ペアのインデックスのタプルが得られます。
従ってこのタプルの長さ=カットできる結合の数となります。ということでカットするリストを作成します。
さて、カットする部分ですが内部を見るとトリプルカットまでやっていました。
#SMARTS for "acyclic and not in a functional group" smarts = Chem.MolFromSmarts("[#6+0;!$(*=,#[!#6])]!@!=!#[*]") #finds the relevant bonds to break #find the atoms maches matching_atoms = mol.GetSubstructMatches(smarts) total = len(matching_atoms) #catch case where there are no bonds to fragment if(total == 0): output = '%s,%s,,' % (smi,id) if( (output in outlines) == False ): print output outlines[output]=None bonds_selected = [] #loop to generate every single, double and triple cut in the molecule for x in xrange( total ): #print matches[x] bonds_selected.append(matching_atoms[x]) delete_bonds(bonds_selected) bonds_selected = [] for y in xrange(x+1,total): #print matching_atoms[x],matching_atoms[y] bonds_selected.append(matching_atoms[x]) bonds_selected.append(matching_atoms[y]) delete_bonds(bonds_selected) bonds_selected = [] for z in xrange(y+1, total): #print matching_atoms[x],matching_atoms[y],matching_atoms[z] bonds_selected.append(matching_atoms[x]) bonds_selected.append(matching_atoms[y]) bonds_selected.append(matching_atoms[z]) delete_bonds(bonds_selected) bonds_selected = []
matching_atomsが最初のsmartsで指定したボンドを形成するアトムペアのリストです。
これをループ処理してやりながら
ボンドをカットしていきます。切断ルールはトリプルまでループしていました。
懇親会でシングルとかいってしまった。猛省。
たとえば
C=C-C-C=C-N
なら
できるペアは[ (1,2), (2,3), (5,6), ]なので
シングルカットですと
C=C.C-C=C-N
C=C-C.C=C-N
C=C-C-C=C.N
です。
ダブルカットでは
C=C.C.C=C-N
C=C.C-C=C.N
トリプルカットでは
C=C.C.C=C.N
となります。
切断部分は全部インデックスが張られているのでもう一個のスクリプトでペアを作ります。
網羅的にできるのでパブリック、インハウスのデータに活用をもう一回考えるぞ。