BH16.12/MachineLearning
提供:TogoWiki
(→UniProt) |
(→DeepWalk) |
||
216行: | 216行: | ||
# jst-mesh2016.ntとmesh2016.ntをマージしたグラフのデータを作った。ノード数 5,401,382 | # jst-mesh2016.ntとmesh2016.ntをマージしたグラフのデータを作った。ノード数 5,401,382 | ||
# DeepWalkを走らせてベクトルを作り始めた(2016/12/13 3PMごろ)。→まだ終わらない(17:52) →翌朝には終わっていた。 | # DeepWalkを走らせてベクトルを作り始めた(2016/12/13 3PMごろ)。→まだ終わらない(17:52) →翌朝には終わっていた。 | ||
+ | |||
+ | === Prediction === | ||
+ | あるタンパク質が、ある病気に関連するか否かを予測する(?) | ||
+ | * 必要なデータ | ||
+ | :- positive/negative sets | ||
+ | :- training/testing sets | ||
* TensorFlow | * TensorFlow |
2016年12月15日 (木) 02:08時点における版
JSTシソーラス - MeSH - 遺伝子 - 様々な特徴 を学習して、遺伝子と表現型(病気など)のアノテーション(関係)を見つける機械学習 (AI) をつくる
- 参加者:金城・片山
- サポート:渡辺・櫛田
目次 |
特徴ベクトル
- JSTシソーラスのRDFから特徴ベクトルを作成
- ランダムウォークでタームごとの URI 周辺のグラフパターンを学習
- ターム毎に特徴ベクトルを生成
- 遺伝子アノテーションの特徴ベクトルを生成
- UniProtやTogoGenomeのエントリからMeSHを含むリンクを抽出
- MeSHとJSTのタームの対応を学習
データセット
- JSTシソーラス
- https://stirdf.jglobal.jst.go.jp/page/lodchallenge_2016.html から利用申請
- 使いたいトリプル
- rdfs:seeAlso
- dct:subject
- skos:related
- skos:broader
- skos:narrower
- jst-csv2nt.rb で jst-mesh.nt を生成 (62MB; gzip 872KB)
- JSTシソーラスに skos:Concept のついているタームは 244832 個
- このうち、rdfs:seeAlso で MeSH への対応がついているものが 15945 個
- スキーマ図 を参照し、これの dct:subject, skos:related, broader, narrower のトリプルを取得
- これにMeSHのRDFを加える? https://id.nlm.nih.gov/mesh/
- MeSH RDF trivia
- 超最新版のURI https://id.nlm.nih.gov/mesh/D017538
- 最新版のURL http://id.nlm.nih.gov/mesh/D017538
- 2016年版のURL http://id.nlm.nih.gov/mesh/2016/D017538 <- "/2016" が余分に入る。
- JSTのデータは2016年版で「最新版」の形式のリンクが入っているが、本日(2016/12/12)時点での最新版は2017年版なので、整合性が取れない…要Hack
- MeSH RDF trivia
- 遺伝子アノテーション
- TogoGenome, DDBJ, PDBj, UniProt などの RDF から、遺伝子の特徴に関わるトリプルと MeSH へのリンクを収集
UniProt
UniProt から MeSH に辿るには、下記の predicate を辿れば OK そう。disease と mesh の対応は diseases.rdf に含まれている。
<uniprot/#> :annotation <SHA-384/#> :disease <diseases/#> rdfs:seeAlso <mesh/#>
例としては
prefix : <http://purl.uniprot.org/core/> select * where { <http://purl.uniprot.org/uniprot/Q9UDR5> :annotation ?a . ?a :disease ?d . ?d rdfs:seeAlso ?m . FILTER strstarts(str(?m), "https://id.nlm.nih.gov/mesh/") }
要注意なのは、現状の TogoGenome のエンドポイントのデータは少し古い(BH16.12/TogoGenome) ため
- 最新版の MeSH URI https://id.nlm.nih.gov/mesh/D020167
- 旧版の MeSH URI http://purl.uniprot.org/mesh/D020167
のうち、旧版の URI を使ったものになる(いずれにしても JST シソーラスのために URI を書き換える必要があるのと、2016 年前半時点のデータを使いたいのである意味ちょうどよかった?)。
prefix : <http://purl.uniprot.org/core/> construct { ?u :annotation ?a . ?a :disease ?d . ?d rdfs:seeAlso ?mesh2016 . } where { VALUES ?u { <http://purl.uniprot.org/uniprot/Q9UDR5> } ?u :annotation ?a . ?a :disease ?d . ?d rdfs:seeAlso ?m . FILTER strstarts(str(?m), "http://purl.uniprot.org/mesh/") BIND (iri(concat("https://id.nlm.nih.gov/mesh/", "2016/", strafter(str(?m), "mesh/"))) AS ?mesh2016) }
MeSH 以外にどのような情報をひろうかを検討 → タンパク個別の情報は拾いたいが意味的に関連しないものにやたらとつながりがちな provenance/evidence 系の情報は拾わないことにするため、
- :attribution
- :citation
は無視することにし、あまり意味のない
- :alternativeName
- :conflictingSequence
- :created
- :modified
- :replaces
- :reviewed
- :version
も捨てて、
<uniprot/Q9UDR5> (a :Protein) :organism <taxonomy/9606> :mnemonic "AASS_HUMAN" :recommendedName/:fullName "Alpha-aminoadipic semialdehyde synthase, mitochondrial" (a :Structured_Name) :annotation/:disease <diseases/1773> (a :Disease_Annotation) :annotation/rdfs:comment "The disease is caused by mutations affecting the gene represented in this entry." (a :Disease_Annotation) :annotation/rdfs:comment "N6-acetyllysine; alternate" (a :Modified_Residue_Annotation) :annotation/rdfs:comment "In the N-terminal section; belongs to the AlaDH/PNT family." (a :Similarity_Annotation) :annotation/rdfs:comment "Saccharopine dehydrogenase" (a :Region_Annotation) :annotation/rdfs:comment "Induced by starvation." (a :Induction_Annotation) :annotation/rdfs:comment "Expressed in all 16 tissues examined with highest expression in the liver." (a :Tissue_Specificity_Annotation) :annotation/rdfs:comment "Mitochondrion" (a :Transit_Peptide_Annotation) :annotation/rdfs:comment "N(6)-(L-1,3-dicarboxypropyl)-L-lysine + NADP(+) + H(2)O = L-lysine + 2-oxoglutarate + NADPH." (a :Catalytic_Activity_Annotation) :annotation/rdfs:comment "Lysine-ketoglutarate reductase" (a :Region_Annotation) :annotation/rdfs:comment "Homodimer." (a :Subunit_Annotation) :annotation/rdfs:comment "Bifunctional enzyme that catalyzes the first two steps in lysine degradation. The N-terminal and the C-terminal contain lysine-ketoglutarate reductase and saccharopine dehydrogenase activity, respectively." (a :Function_Annotation) :annotation/rdfs:comment "In the C-terminal section; belongs to the saccharopine dehydrogenase family." (a :Similarity_Annotation) :annotation/rdfs:comment "Alpha-aminoadipic semialdehyde synthase, mitochondrial" (a :Chain_Annotation) :annotation/:locatedIn/:cellularComponent <locations/173> (a :Subcellular_Location_Annotation) :annotation/rdfs:seeAlso <unipathway/427.868.419.835> (a :Pathway_Annotation) :classifiedWith <http://purl.obolibrary.org/obo/GO_0004753> :classifiedWith <keywords/1185> :domain/:enzyme <enzyme/1.5.1.8> (a :Part) :encodedBy/skos:prefLabel "AASS" (a :Gene) :existence :Evidence_at_Protein_Level_Existence :isolatedFrom <tissues/564> :proteome <proteomes/UP000005640#Chromosome%207> :sequence <isoforms/Q9UDR5-1> :sequence/:mass "102132" (a :Simple_Sequence) :sequence/rdf:value ""MLQVHRTGLGRLGV ...." rdfs:seeAlso <http://identifiers.org/ncbigene/10157> rdfs:seeAlso/:database <database/DisGeNET> (a :Resource) rdfs:seeAlso <http://identifiers.org/reactome/R-HSA-71064> rdfs:seeAlso/:database <database/Reactome> (a Resource) rdfs:seeAlso/rdfs:comment "Lysine catabolism" (a Resource) :
このあたりを <SHA-384/#> も含めて拾うことに。
ただ、http://www.uniprot.org/uniprot/Q9UDR5 からダウンロードした RDF/XML に含まれる SHA-384 の URI をブラウザで開くと DESCRIBEが実行されるが、
select * where { ?s ?p <http://purl.uniprot.org/SHA-384/ACB87331D17D2460F1FA8D686155044D4053D0FC575AEB433F5D74F2CFAF5A84B1449AE0068947CE4675EE8BB71B0A26> } limit 100
select * where { ?s ?p <http://purl.uniprot.org/SHA-384/E2AA67B236D056422CB4A02B42561C44A901BADA4F19813CF481F77D6DFB1E7B193931927AE9E39A972E74F293E44890> } limit 100
があり、ヒットしない URI は SPARQL で使っても当然出てこない。最新のエントリに含まれる SHA-384 の ID と UniProt の公開エンドポイントに入っている RDF データは同期されていない(古い)のだろうか?
PREFIX : <http://purl.uniprot.org/core/> CONSTRUCT { ?u :annotation ?a . ?a :disease ?d . ?d rdfs:seeAlso ?mesh2016 . ?u :organism ?organism . ?u :mnemonic ?mnemonic . ?u :recommendedName ?recommendedName . ?recommendedName :fullName ?fullName . ?a rdfs:comment ?comment . ?a :locatedIn ?locatedIn . ?locatedIn :cellularComponent ?cellularComponent . ?a rdfs:seeAlso ?pathway . } WHERE { VALUES ?u { <http://purl.uniprot.org/uniprot/Q9UDR5> } ?u :annotation ?a . ?a :disease ?d . ?d rdfs:seeAlso ?m . FILTER strstarts(str(?m), "http://purl.uniprot.org/mesh/") BIND (iri(concat("https://id.nlm.nih.gov/mesh/", "2016/", strafter(str(?m), "mesh/"))) AS ?mesh2016) ?u :organism ?organism . ?u :mnemonic ?mnemonic . ?u :recommendedName ?recommendedName . ?recommendedName :fullName ?fullName . ?a rdfs:comment ?comment . ?a :locatedIn ?locatedIn . ?locatedIn :cellularComponent ?cellularComponent . ?a rdfs:seeAlso ?pathway . }
機械学習
DeepWalk
- Robert's implementation: https://github.com/bio-ontology-research-group/walking-rdf-and-owl
- DeepWalk: paper and implementation.
- Robert の前処理プログラム RDFWrapper がうまく動かない。Java のライブラリの問題?→しょうがないので、自前で前処理プログラムを作り、originalのDeepWalkプログラムを使うことにする。
- OCaml RDF libraryの都合により、ntriples -> turtleに変換。(rapper を使ったが、文字コードの問題で一部トリプルが省かれるみたい。)
- jst-mesh2016.ntとmesh2016.ntをマージしたグラフのデータを作った。ノード数 5,401,382
- DeepWalkを走らせてベクトルを作り始めた(2016/12/13 3PMごろ)。→まだ終わらない(17:52) →翌朝には終わっていた。
Prediction
あるタンパク質が、ある病気に関連するか否かを予測する(?)
- 必要なデータ
- - positive/negative sets
- - training/testing sets
- TensorFlow
- Chainer
- SVM
- Deep Learning