SlideShare a Scribd company logo
X X ∩Y                 Y


                                    p(x, y)
I(X; Y ) =             p(x, y) log
                                   p(x)p(y)
             y∈Y x∈X




      |X ∩ Y |
    min(|X|, |Y |)
$ curl quot;http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?
db=pubmed&term=CDK2quot;

<?xml version=quot;1.0quot;?>
<!DOCTYPE eSearchResult PUBLIC quot;-//NLM//DTD eSearchResult, 11 May
2002//ENquot; quot;http://www.ncbi.nlm.nih.gov/entrez/query/DTD/
eSearch_020511.dtdquot;>
<eSearchResult>
        <Count>3778</Count>
        <RetMax>20</RetMax>
        <RetStart>0</RetStart>
        <IdList>
                 <Id>17904841</Id>
                 <Id>17904366</Id>
                 <Id>17893107</Id>
()
</eSearchResult>
$ curl quot;http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?
db=pubmed&term=CDK6quot;

()
<eSearchResult>
        <Count>740</Count>
        <RetMax>20</RetMax>
        <RetStart>0</RetStart>
()
</eSearchResult>




$ curl quot;http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?
db=pubmed&term=CDK2+CDK6quot;

()
<eSearchResult>
        <Count>321</Count>
        <RetMax>20</RetMax>
        <RetStart>0</RetStart>
()
</eSearchResult>
321
  |X ∩ Y |
                 =
min(|X|, |Y |)       min(3778, 740)
                     321
                 =       = 0.438
                     740
$ ruby simpson.rb CDK2 CDK6

CDK2   CDK6    3778    742    321   0.432614555256065
#!/usr/bin/env ruby

require 'rexml/document'
require 'open-uri'

def count(gene)
  fp = open(quot;http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?
db=pubmed&term=quot;+gene)
  source = fp.read
  fp.close
  doc = REXML::Document.new source
  return doc.elements['/eSearchResult/Count'].text.to_i
end

def simpson(gene1_count, gene2_count, gene12_count)
  if gene1_count <= 0 || gene2_count <= 0
    return nil
  elsif gene1_count < gene2_count
    return gene12_count.to_f / gene1_count.to_f
  end
  return gene12_count.to_f / gene2_count.to_f
end
def main(gene1,gene2)
  gene1_count = count(gene1)
  gene2_count = count(gene2)
  gene12_count = count(gene1 + quot;+quot; + gene2)
  s = simpson(gene1_count, gene2_count, gene12_count)
  puts [gene1, gene2, gene1_count, gene2_count, gene12_count, s].join
(quot; quot;)
end

main(ARGV[0],ARGV[1])
bioinfolec7th20071005
bioinfolec7th20071005

More Related Content

What's hot

ONLINE STUDENT MANAGEMENT SYSTEM
ONLINE STUDENT MANAGEMENT SYSTEMONLINE STUDENT MANAGEMENT SYSTEM
ONLINE STUDENT MANAGEMENT SYSTEM
Rohit malav
 
MongoDBで作るソーシャルデータ新解析基盤
MongoDBで作るソーシャルデータ新解析基盤MongoDBで作るソーシャルデータ新解析基盤
MongoDBで作るソーシャルデータ新解析基盤
Takahiro Inoue
 
jQuery Datatables With MongDb
jQuery Datatables With MongDbjQuery Datatables With MongDb
jQuery Datatables With MongDb
sliimohara
 
Phpfunction
PhpfunctionPhpfunction
Fantastic caches and where to find them
Fantastic caches and where to find themFantastic caches and where to find them
Fantastic caches and where to find them
Alexey Tokar
 
自己的JVM自己救: 解救 OOM 實務經驗談 (JCConf 2015)
自己的JVM自己救: 解救 OOM 實務經驗談  (JCConf 2015)自己的JVM自己救: 解救 OOM 實務經驗談  (JCConf 2015)
自己的JVM自己救: 解救 OOM 實務經驗談 (JCConf 2015)
Leon Chen
 
Save JVM by Yourself: Real War Experiences of OOM
Save JVM by Yourself: Real War Experiences of OOMSave JVM by Yourself: Real War Experiences of OOM
Save JVM by Yourself: Real War Experiences of OOM
Leon Chen
 
Power Shell Commands
Power Shell CommandsPower Shell Commands
Power Shell Commands
Sushree Nanda
 
Hadoop, HDFS, MapReduce and Pig
Hadoop, HDFS, MapReduce and PigHadoop, HDFS, MapReduce and Pig
Hadoop, HDFS, MapReduce and Pig
Tomasz Bednarz
 

What's hot (9)

ONLINE STUDENT MANAGEMENT SYSTEM
ONLINE STUDENT MANAGEMENT SYSTEMONLINE STUDENT MANAGEMENT SYSTEM
ONLINE STUDENT MANAGEMENT SYSTEM
 
MongoDBで作るソーシャルデータ新解析基盤
MongoDBで作るソーシャルデータ新解析基盤MongoDBで作るソーシャルデータ新解析基盤
MongoDBで作るソーシャルデータ新解析基盤
 
jQuery Datatables With MongDb
jQuery Datatables With MongDbjQuery Datatables With MongDb
jQuery Datatables With MongDb
 
Phpfunction
PhpfunctionPhpfunction
Phpfunction
 
Fantastic caches and where to find them
Fantastic caches and where to find themFantastic caches and where to find them
Fantastic caches and where to find them
 
自己的JVM自己救: 解救 OOM 實務經驗談 (JCConf 2015)
自己的JVM自己救: 解救 OOM 實務經驗談  (JCConf 2015)自己的JVM自己救: 解救 OOM 實務經驗談  (JCConf 2015)
自己的JVM自己救: 解救 OOM 實務經驗談 (JCConf 2015)
 
Save JVM by Yourself: Real War Experiences of OOM
Save JVM by Yourself: Real War Experiences of OOMSave JVM by Yourself: Real War Experiences of OOM
Save JVM by Yourself: Real War Experiences of OOM
 
Power Shell Commands
Power Shell CommandsPower Shell Commands
Power Shell Commands
 
Hadoop, HDFS, MapReduce and Pig
Hadoop, HDFS, MapReduce and PigHadoop, HDFS, MapReduce and Pig
Hadoop, HDFS, MapReduce and Pig
 

Viewers also liked

Mc dermottdaniel vis1
Mc dermottdaniel vis1Mc dermottdaniel vis1
Mc dermottdaniel vis1
dmcderm3
 
Trabajo COMPUTACION
Trabajo COMPUTACIONTrabajo COMPUTACION
Trabajo COMPUTACION
ylastra
 
Fichas sanantonio
Fichas sanantonioFichas sanantonio
Fichas sanantonio
William González
 
Helgeland Sparebank, regnskapspresentasjon 3. kvartal 2012
Helgeland Sparebank, regnskapspresentasjon 3. kvartal 2012Helgeland Sparebank, regnskapspresentasjon 3. kvartal 2012
Helgeland Sparebank, regnskapspresentasjon 3. kvartal 2012
Helgeland Sparebank
 
Business communication
Business communicationBusiness communication
Business communication
Phan Dung
 
Medidas de tendencia central
Medidas de tendencia centralMedidas de tendencia central
Medidas de tendencia central
Leandro Pantoja
 
BiologyExchange.co.uk Shared Resource
BiologyExchange.co.uk Shared ResourceBiologyExchange.co.uk Shared Resource
BiologyExchange.co.uk Shared Resource
biologyexchange
 

Viewers also liked (7)

Mc dermottdaniel vis1
Mc dermottdaniel vis1Mc dermottdaniel vis1
Mc dermottdaniel vis1
 
Trabajo COMPUTACION
Trabajo COMPUTACIONTrabajo COMPUTACION
Trabajo COMPUTACION
 
Fichas sanantonio
Fichas sanantonioFichas sanantonio
Fichas sanantonio
 
Helgeland Sparebank, regnskapspresentasjon 3. kvartal 2012
Helgeland Sparebank, regnskapspresentasjon 3. kvartal 2012Helgeland Sparebank, regnskapspresentasjon 3. kvartal 2012
Helgeland Sparebank, regnskapspresentasjon 3. kvartal 2012
 
Business communication
Business communicationBusiness communication
Business communication
 
Medidas de tendencia central
Medidas de tendencia centralMedidas de tendencia central
Medidas de tendencia central
 
BiologyExchange.co.uk Shared Resource
BiologyExchange.co.uk Shared ResourceBiologyExchange.co.uk Shared Resource
BiologyExchange.co.uk Shared Resource
 

Similar to bioinfolec7th20071005

bioinfolec_5th_20070713
bioinfolec_5th_20070713bioinfolec_5th_20070713
bioinfolec_5th_20070713
sesejun
 
bioinfolec_20070706 4th
bioinfolec_20070706 4thbioinfolec_20070706 4th
bioinfolec_20070706 4th
sesejun
 
Redis 101
Redis 101Redis 101
Redis 101
Doğan Can
 
20070407 Rit2007 Xmltype Samokhvalov
20070407 Rit2007 Xmltype Samokhvalov20070407 Rit2007 Xmltype Samokhvalov
20070407 Rit2007 Xmltype Samokhvalov
Nikolay Samokhvalov
 
ACM Bay Area Data Mining Workshop: Pattern, PMML, Hadoop
ACM Bay Area Data Mining Workshop: Pattern, PMML, HadoopACM Bay Area Data Mining Workshop: Pattern, PMML, Hadoop
ACM Bay Area Data Mining Workshop: Pattern, PMML, Hadoop
Paco Nathan
 
Latest java
Latest javaLatest java
Latest java
Andriy Rymar
 
RCEC Email 3.5.03
RCEC Email 3.5.03RCEC Email 3.5.03
RCEC Email 3.5.03
Obama White House
 
Noah Zoschke at Waza 2013: Heroku Secrets
Noah Zoschke at Waza 2013: Heroku SecretsNoah Zoschke at Waza 2013: Heroku Secrets
Noah Zoschke at Waza 2013: Heroku Secrets
Heroku
 
CAR Email 6.5.02 (d)
CAR Email 6.5.02 (d)CAR Email 6.5.02 (d)
CAR Email 6.5.02 (d)
Obama White House
 
Php
PhpPhp
Ajax и будущее Java Script
Ajax и будущее Java ScriptAjax и будущее Java Script
Ajax и будущее Java Script
Constantin Kichinsky
 
D3.js workshop
D3.js workshopD3.js workshop
D3.js workshop
Anton Katunin
 
Let's build a parser!
Let's build a parser!Let's build a parser!
Let's build a parser!
Boy Baukema
 
Os Pruett
Os PruettOs Pruett
Os Pruett
oscon2007
 
Send.php
Send.phpSend.php
Send.php
abdoahmd44
 
User Defined Aggregation in Apache Spark: A Love Story
User Defined Aggregation in Apache Spark: A Love StoryUser Defined Aggregation in Apache Spark: A Love Story
User Defined Aggregation in Apache Spark: A Love Story
Databricks
 
User Defined Aggregation in Apache Spark: A Love Story
User Defined Aggregation in Apache Spark: A Love StoryUser Defined Aggregation in Apache Spark: A Love Story
User Defined Aggregation in Apache Spark: A Love Story
Databricks
 
Hidden treasures of Ruby
Hidden treasures of RubyHidden treasures of Ruby
Hidden treasures of Ruby
Tom Crinson
 
Itsecteam shell
Itsecteam shellItsecteam shell
Itsecteam shell
ady36
 
20190907 Julia the language for future
20190907 Julia the language for future20190907 Julia the language for future
20190907 Julia the language for future
岳華 杜
 

Similar to bioinfolec7th20071005 (20)

bioinfolec_5th_20070713
bioinfolec_5th_20070713bioinfolec_5th_20070713
bioinfolec_5th_20070713
 
bioinfolec_20070706 4th
bioinfolec_20070706 4thbioinfolec_20070706 4th
bioinfolec_20070706 4th
 
Redis 101
Redis 101Redis 101
Redis 101
 
20070407 Rit2007 Xmltype Samokhvalov
20070407 Rit2007 Xmltype Samokhvalov20070407 Rit2007 Xmltype Samokhvalov
20070407 Rit2007 Xmltype Samokhvalov
 
ACM Bay Area Data Mining Workshop: Pattern, PMML, Hadoop
ACM Bay Area Data Mining Workshop: Pattern, PMML, HadoopACM Bay Area Data Mining Workshop: Pattern, PMML, Hadoop
ACM Bay Area Data Mining Workshop: Pattern, PMML, Hadoop
 
Latest java
Latest javaLatest java
Latest java
 
RCEC Email 3.5.03
RCEC Email 3.5.03RCEC Email 3.5.03
RCEC Email 3.5.03
 
Noah Zoschke at Waza 2013: Heroku Secrets
Noah Zoschke at Waza 2013: Heroku SecretsNoah Zoschke at Waza 2013: Heroku Secrets
Noah Zoschke at Waza 2013: Heroku Secrets
 
CAR Email 6.5.02 (d)
CAR Email 6.5.02 (d)CAR Email 6.5.02 (d)
CAR Email 6.5.02 (d)
 
Php
PhpPhp
Php
 
Ajax и будущее Java Script
Ajax и будущее Java ScriptAjax и будущее Java Script
Ajax и будущее Java Script
 
D3.js workshop
D3.js workshopD3.js workshop
D3.js workshop
 
Let's build a parser!
Let's build a parser!Let's build a parser!
Let's build a parser!
 
Os Pruett
Os PruettOs Pruett
Os Pruett
 
Send.php
Send.phpSend.php
Send.php
 
User Defined Aggregation in Apache Spark: A Love Story
User Defined Aggregation in Apache Spark: A Love StoryUser Defined Aggregation in Apache Spark: A Love Story
User Defined Aggregation in Apache Spark: A Love Story
 
User Defined Aggregation in Apache Spark: A Love Story
User Defined Aggregation in Apache Spark: A Love StoryUser Defined Aggregation in Apache Spark: A Love Story
User Defined Aggregation in Apache Spark: A Love Story
 
Hidden treasures of Ruby
Hidden treasures of RubyHidden treasures of Ruby
Hidden treasures of Ruby
 
Itsecteam shell
Itsecteam shellItsecteam shell
Itsecteam shell
 
20190907 Julia the language for future
20190907 Julia the language for future20190907 Julia the language for future
20190907 Julia the language for future
 

Recently uploaded

GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
fredae14
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
Mariano Tinti
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
Postman
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
Webinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data WarehouseWebinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data Warehouse
Federico Razzoli
 

Recently uploaded (20)

GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
Webinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data WarehouseWebinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data Warehouse
 

bioinfolec7th20071005

  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7. X X ∩Y Y p(x, y) I(X; Y ) = p(x, y) log p(x)p(y) y∈Y x∈X |X ∩ Y | min(|X|, |Y |)
  • 8. $ curl quot;http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi? db=pubmed&term=CDK2quot; <?xml version=quot;1.0quot;?> <!DOCTYPE eSearchResult PUBLIC quot;-//NLM//DTD eSearchResult, 11 May 2002//ENquot; quot;http://www.ncbi.nlm.nih.gov/entrez/query/DTD/ eSearch_020511.dtdquot;> <eSearchResult> <Count>3778</Count> <RetMax>20</RetMax> <RetStart>0</RetStart> <IdList> <Id>17904841</Id> <Id>17904366</Id> <Id>17893107</Id> () </eSearchResult>
  • 9. $ curl quot;http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi? db=pubmed&term=CDK6quot; () <eSearchResult> <Count>740</Count> <RetMax>20</RetMax> <RetStart>0</RetStart> () </eSearchResult> $ curl quot;http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi? db=pubmed&term=CDK2+CDK6quot; () <eSearchResult> <Count>321</Count> <RetMax>20</RetMax> <RetStart>0</RetStart> () </eSearchResult>
  • 10. 321 |X ∩ Y | = min(|X|, |Y |) min(3778, 740) 321 = = 0.438 740
  • 11.
  • 12.
  • 13. $ ruby simpson.rb CDK2 CDK6 CDK2 CDK6 3778 742 321 0.432614555256065
  • 14. #!/usr/bin/env ruby require 'rexml/document' require 'open-uri' def count(gene) fp = open(quot;http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi? db=pubmed&term=quot;+gene) source = fp.read fp.close doc = REXML::Document.new source return doc.elements['/eSearchResult/Count'].text.to_i end def simpson(gene1_count, gene2_count, gene12_count) if gene1_count <= 0 || gene2_count <= 0 return nil elsif gene1_count < gene2_count return gene12_count.to_f / gene1_count.to_f end return gene12_count.to_f / gene2_count.to_f end
  • 15. def main(gene1,gene2) gene1_count = count(gene1) gene2_count = count(gene2) gene12_count = count(gene1 + quot;+quot; + gene2) s = simpson(gene1_count, gene2_count, gene12_count) puts [gene1, gene2, gene1_count, gene2_count, gene12_count, s].join (quot; quot;) end main(ARGV[0],ARGV[1])