日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

强大的NCBI接口

發布時間:2025/3/15 编程问答 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 强大的NCBI接口 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

剛才小玩了下,不錯,。net確實很方便,很強大

Using Entrez Utilities Web Service with C# and MS Visual Studio 2005

Updated: May 20, 2008

  • Creating a Web Service Client Project
  • NCBI Entrez Utilities Web Service API
  • Examples
    • Search, Link & Fetch example
    • Using WebEnv & QueryKey example

?

Entrez Utilities Web Service has been tested with:

  • Microsoft Windows XP Professional (Service Pack2)
  • Microsoft .NET Framework Version 2.0.50727
  • Microsoft Visual Studio 2005 Version 8.0.50727.42

?

NCBI Entrez Utilities Web Service using MS Visual Studio 2005.

To create Windows application:

  • Press Ctrl+Shift+N or Select File menu, then New, and then click Project to open the New Project dialog.
  • Select Visual C# in Project types list.
  • Select Windows Application in Templates list.
  • Click OK to create a new project.
  • Select View menu and then Toolbox to open a Toolbox window.
  • From the Toolbox, drag a Textbox and a Button to the design surface of Form1.
  • On the Project menu, click Add Web Reference.
  • In the URL field of the Add Web Reference dialog, type the URL http://eutils.ncbi.nlm.nih.gov/entrez/eutils/soap/v2.0/eutils.wsdl
  • Click the Go button to retrieve information about the XML Web service.
  • In the Web reference name field, rename the Web reference to eUtils.
  • Click Add Reference to add a Web reference for the target XML Web service.
  • Double-click the button on Form1 to create an event-handling method for this button.
  • In the button1_Click method enter the following code:

    ?

    // eInfo utility returns a list of available databases

    try

    {

    ? eUtils.eUtilsService serv = new eUtils.eUtilsService();

    ? // call NCBI EInfo utility

    ? eUtils.eInfoResult res = serv.run_eInfo(new eUtils.eInfoRequest());

    ? // results output

    ? textBox1.Text = "";?

    ? for(int i=0; i<res.DbList.Items.Length; i++) textBox1.Text += res.DbList.Items[i]+"\r\n";

    }

    catch (Exception eee)

    {

    ? textBox1.Text = eee.ToString();

    }

  • Build and run application.
  • ?

    eutils_MS.wsdl file.

    Click on parameter to get its description.

    Click on method name to see the example of use.

    public Result run_eGquery(eGqueryRequest params)eGqueryRequest class properties:? - String term? - String tool? - String emailpublic eInfoResult run_eInfo(eInfoRequest params)eInfoRequest class properties:? - String db? - String tool? - String emailpublic eLinkResult run_eLink(eLinkRequest params)eLinkRequest class properties: - String db- String[] id- String reldate- String mindate- String maxdate- String datetype- String term- String dbfrom- String WebEnv- String query_key- String cmd- String tool- String emailpublic ePostResult run_ePost(ePostRequest params) ePostRequest class properties: ?- String db ?- String id ?- String tool ?- String emailpublic eSearchResult run_eSearch(eSearchRequest params)eSearchRequest class properties: ?- String db ?- String term ?- String WebEnv ?- String query_key ?- String usehistory ?- String tool ?- String email ?- String field ?- String reldate ?- String mindate ?- String maxdate ?- String datetype ?- String retstart ?- String retmax ?- String rettype ?- String sort public eSpellResult run_eSpell(eSpellRequest params) eSpellRequest class properties: - String db ?- String term ?- String tool ?- String emailpublic eSummaryResult run_eSummary(eSummaryRequest params)eSummaryRequest class properties: ?- String db ?- String id ?- String WebEnv ?- String query_key ?- String retstart ?- String retmax ?- String tool ?- String emailpublic eFetchResult run_eFetch(eFetchRequest params)eFetchRequest class properties: - String db - String id - String WebEnv - String query_key - String tool - String email - String retstart - String retmax - String rettype燩roperties available for Sequence databases: - String rettype - String strand - String seq_start - String seq_stop - String complexity - String report

    EGQuery

    ?

    ?

    try

    {

    ? eUtils.eUtilsService serv = new eUtils.eUtilsService();

    ? // call NCBI EGQuery utility

    ? eUtils.eGqueryRequest req = new eUtils.eGqueryRequest();

    ? req.term = "mouse";

    ? eUtils.Result res = serv.run_eGquery(req);

    ? // results output

    ? textBox1.Text = "Search term: " + res.Term + "\r\n";

    ? textBox1.Text += "Results: \r\n";

    ? for(int i=0; i<res.eGQueryResult.ResultItem.Length; i++)

    ? {

    ? textBox1.Text += "? " + res.eGQueryResult.ResultItem[i].DbName +

    ": " + res.eGQueryResult.ResultItem[i].Count + "\r\n";

    ? }

    }

    catch (Exception eee)

    {

    ? textBox1.Text = eee.ToString();

    }

    ?

    EInfo

    ?

    ?

    // eInfo utility returns an PMC db info

    try

    {

    ? eUtils.eUtilsService serv = new eUtils.eUtilsService();

    ? // call NCBI EInfo utility

    ? eUtils.eInfoRequest req = new eUtils.eInfoRequest();

    ? req.db = "pmc";

    ? eUtils.eInfoResult res = serv.run_eInfo(req);

    ? // results output

    ? textBox1.Text = "DbName: " + res.DbInfo.DbName + "\r\n" +

    ? "Description: " + res.DbInfo.Description + "\r\n" +

    ? "MenuName: " + res.DbInfo.MenuName + "\r\n";

    }

    catch (Exception eee)

    {

    ? textBox1.Text = eee.ToString();

    }?

    ?

    ELink

    ?

    ?

    // example retrieves links from Nuccore for to Protein GI 48819,7140345

    try

    {

    ? eUtils.eUtilsService serv = new eUtils.eUtilsService();

    ? string[] id = {"48819,7140345"};

    ? // call NCBI ELink utility

    ? eUtils.eLinkRequest req = new eUtils.eLinkRequest();

    ? req.db = "protein";

    ? req.id = id;

    ? req.dbfrom = "nuccore";

    ? eUtils.eLinkResult res = serv.run_eLink(req);

    ? // results output

    ? textBox1.Text = "";

    ? for(int i=0; i<res.LinkSet.Length; i++)

    ? {

    ? textBox1.Text += "Links from " + res.LinkSet[i].DbFrom +

    " to " + res.LinkSet[i].LinkSetDb[0].DbTo + "\r\n";

    ? textBox1.Text += "? " + res.LinkSet[i].DbFrom + " id(s): ";

    ? for(int k=0; k<res.LinkSet[i].IdList.Length; k++)

    ? {

    ? textBox1.Text +=? res.LinkSet[i].IdList[k].Value + " ";

    ? }

    ? textBox1.Text += "\r\n";

    ? textBox1.Text += "? " + res.LinkSet[i].LinkSetDb[0].DbTo + " id(s): ";

    ? for(int k=0; k<res.LinkSet[i].LinkSetDb[0].Link.Length; k++)

    ? {

    ? textBox1.Text += res.LinkSet[i].LinkSetDb[0].Link[k].Id.Value + " ";

    ? }

    ? textBox1.Text += "\r\n----------------------\r\n";

    ? }

    }

    catch (Exception eee)

    {

    ? textBox1.Text = eee.ToString();

    }?

    ?

    EPost

    ?

    ?

    // Put ID list to history for later use

    try

    {

    ? eUtils.eUtilsService serv = new eUtils.eUtilsService();

    ? // call NCBI ESpell utility

    ? eUtils.ePostRequest req = new eUtils.ePostRequest();

    ? req.db = "pubmed";

    ? req.id = "11237011";

    ? eUtils.ePostResult res = serv.run_ePost(req);

    ? // results output

    ? textBox1.Text = "WebEnv: "+res.WebEnv? + "\r\n";

    ? textBox1.Text += "QueryKey: "+res.QueryKey;

    }

    catch (Exception eee)

    {

    ? textBox1.Text = eee.ToString();

    }?

    ?

    ESearch

    ?

    ?

    // search in PubMed Central for stem cells in free fulltext articles

    try

    {

    ? eUtils.eUtilsService serv = new eUtils.eUtilsService();

    ? // call NCBI ESearch utility

    ? // NOTE: search term should be URL encoded

    ? eUtils.eSearchRequest req = new eUtils.eSearchRequest();

    ? req.db = "pmc";

    ? req.sort = "SortDate";

    ? req.term = "stem+cells+AND+free+fulltext[filter]";

    ? req.RetStart = "0";

    ? req.RetMax = "15";

    ? eUtils.eSearchResult res = serv.run_eSearch(req);

    ? // results output

    ? textBox1.Text = "Original query: stem cells AND free fulltext[filter]\r\n";

    ? textBox1.Text += "Found ids: " + res.Count+"\r\n";

    ? textBox1.Text += "First " + res.RetMax +" ids: ";

    ?

    ? for(int i=0; i<res.IdList.Length; i++)

    ? {

    ? textBox1.Text += res.IdList[i] + " ";

    ? }

    }

    catch (Exception eee)

    {

    ? textBox1.Text = eee.ToString();

    }

    ?

    ESpell

    ?

    ?

    // retrieves spelling suggestions

    try

    {

    ? eUtils.eUtilsService serv = new eUtils.eUtilsService();

    ? // call NCBI ESpell utility

    ? eUtils.eSpellRequest req = new eUtils.eSpellRequest();

    ? req.db = "pubmed";

    ? req.term = "mouss";

    ? eUtils.eSpellResult res = serv.run_eSpell(req);

    ? // results output

    ? textBox1.Text = "Misspelled word: "+res.Query + "\r\n";

    ? textBox1.Text += "Corrected word: "+res.CorrectedQuery;

    }

    catch (Exception eee)

    {

    ? textBox1.Text = eee.ToString();

    }

    ?

    ESummary

    ?

    ?

    // retreives document Summaries by list of primary IDs

    try

    {

    ? eUtils.eUtilsService serv = new eUtils.eUtilsService();

    ? // call NCBI ESummary utility

    ? eUtils.eSummaryRequest req = new eUtils.eSummaryRequest();

    ? req.db = "nlmcatalog";

    ? req.id = "905";

    ? eUtils.eSummaryResult res = serv.run_eSummary(req);

    ? // results output

    ? textBox1.Text = "";

    ? for(int i=0; i<res.DocSum.Length; i++)

    ? {

    ? textBox1.Text += "ID: "+res.DocSum[i].Id+"\r\n";

    ? for(int k=0; k<res.DocSum[i].Items.Length; k++)

    ? {

    ? textBox1.Text += "? "+res.DocSum[i].Items[k].Name +": "+res.DocSum[i].Items[k].ItemContent + "\r\n";

    ? }

    ? textBox1.Text += "-----------------------\r\n\r\n";

    ? }

    }

    catch (Exception eee)

    {

    ? textBox1.Text = eee.ToString();

    }

    ?

    EFetch

    To fetch data from one of the supported databases add the corresponding Web Reference to project. For example, for taxonomy database in Add Web Reference dialog type http://eutils.ncbi.nlm.nih.gov/entrez/eutils/soap/v2.0/efetch_taxon.wsdl in URL field and eFetchTaxon in Web Reference Name.

    Taxonomy database example:

    ?

    // fetch a record from Taxonomy database

    try

    {

    ? eFetchTaxon.eFetchTaxonService serv = new eFetchTaxon.eFetchTaxonService();

    ? // call NCBI EFetch utility

    ? eFetchTaxon.eFetchRequest req = new eFetchTaxon.eFetchRequest();

    ? req.id = "9685";

    ? eFetchTaxon.eFetchResult res = serv.run_eFetch(req);

    ? // results output

    ? textBox1.Text = res.TaxaSet[0].ScientificName + ": " +

    ? res.TaxaSet[0].Division + " (" +

    ? res.TaxaSet[0].Rank + ")\r\n";

    }

    catch (Exception eee)

    {

    ? textBox1.Text = eee.ToString();

    }

    ?

    ?

    Search, Link & Fetch example

    Add two Web References to project for http://eutils.ncbi.nlm.nih.gov/entrez/eutils/soap/v2.0/eutils.wsdl and http://eutils.ncbi.nlm.nih.gov/entrez/eutils/soap/v2.0/efetch_seq.wsdl files. Name them eUtils and eFetchSeq correspondingly.

    ?

    ?

    ? String[] ids = { "" };

    ? String fetchIds = "";

    ?

    ? // STEP #1: search in PubMed for "cat"

    ? //

    ? try

    ? {

    ? eUtils.eUtilsService serv = new eUtils.eUtilsService();

    ? // call NCBI ESearch utility

    ? // NOTE: search term should be URL encoded

    ? eUtils.eSearchRequest req = new eUtils.eSearchRequest();

    ? req.db = "pubmed";

    ? req.sort = "PublicationDate";

    ? req.term = "cat+AND+pubmed_nuccore[sb]";

    ? req.RetMax = "5";

    ? eUtils.eSearchResult res = serv.run_eSearch(req);

    ?

    ? // store UIDs for use in ELink

    ? int N = res.IdList.Length;

    ? for (int i = 0; i < N; i++)

    ? {

    ? if (i > 0) ids[0] += ",";

    ? ids[0] += res.IdList[i];

    ? }

    ? textBox1.Text = "Search in PubMed for \"cat\" returned " + res.Count + " hits\r\n";

    ? textBox1.Text += "Search links in nuccore for the first 5 UIDs: " + ids[0]+"\r\n\r\n";

    ?

    ? }

    ? catch (Exception eee)

    ? {

    ? textBox1.Text += eee.ToString();

    ? }

    ?

    ? // STEP #2: get links in nucleotide database (nuccore)

    ? try

    ? {

    ? eUtils.eUtilsService serv = new eUtils.eUtilsService();

    ? // call NCBI ELink utility

    ? eUtils.eLinkRequest req = new eUtils.eLinkRequest();

    ? req.db = "nuccore";

    ? req.id = ids;

    ? req.dbfrom = "pubmed";

    ? eUtils.eLinkResult res = serv.run_eLink(req);

    ? // read result and create a list of UIDs to fetch

    ? for (int i = 0; i < res.LinkSet[0].LinkSetDb[0].Link.Length; i++)

    ? {

    ? if (i > 0) fetchIds += ",";

    ? fetchIds += res.LinkSet[0].LinkSetDb[0].Link[i].Id.Value;

    ? textBox1.Text += "ELink returned the following UIDs from nuccore: " + fetchIds + "\r\n\r\n";

    ? }

    ? catch (Exception eee)

    ? {

    ? textBox1.Text += eee.ToString();

    ? }

    ?

    ? // STEP #3: fetch records from nuccore

    ? //

    ? try

    ? {

    ? eFetchSeq.eFetchSequenceService serv = new eFetchSeq.eFetchSequenceService();

    ? // call NCBI ESpell utility

    ? eFetchSeq.eFetchRequest req = new eFetchSeq.eFetchRequest();

    ? req.db = "nuccore";

    ? req.id = fetchIds;

    ? eFetchSeq.eFetchResult res = serv.run_eFetch(req);

    ? // results output

    ? for (int i = 0; i < res.GBSet.GBSeq.Length; i++)

    ? {

    ? textBox1.Text += "Organism: " + res.GBSet.GBSeq[i].GBSeq_organism + "\r\n";

    ? textBox1.Text += "Locus: " + res.GBSet.GBSeq[i].GBSeq_locus + "\r\n";

    ? textBox1.Text += "Definition: " + res.GBSet.GBSeq[i].GBSeq_definition + "\r\n";

    ? textBox1.Text += "----------------------\r\n\r\n";

    ? }

    ? }

    ? catch (Exception eee)

    ? {

    ? textBox1.Text += eee.ToString();

    ? }

    ?

    ?Using WebEnv & QueryKey example

    Add two Web References to project for http://eutils.ncbi.nlm.nih.gov/entrez/eutils/soap/v2.0/eutils.wsdl and http://eutils.ncbi.nlm.nih.gov/entrez/eutils/soap/v2.0/efetch_pubmed.wsdl files. Name them eUtils and eFetchPubmed correspondingly.

    ?

    ? String WebEnv = "";

    ? String query_key = "";

    ?

    ? // STEP #1: search in PubMed for "cat"

    ?//

    ? try

    ? {

    ? eUtils.eUtilsService serv = new eUtils.eUtilsService();

    ? // call NCBI ESearch utility

    ? // NOTE: search term should be URL encoded

    ? eUtils.eSearchRequest req = new eUtils.eSearchRequest();

    ? req.db = "pubmed";

    ? req.term = "cat";

    ? req.usehistory = "y";

    ? eUtils.eSearchResult res = serv.run_eSearch(req);

    ? // store WebEnv & QueryKey for use in eFetch

    ? WebEnv = res.WebEnv;

    ? query_key = res.QueryKey;

    ?

    ? textBox1.Text = "Search in PubMed for \"cat\" returned " + res.Count + " hits\r\n";

    ? textBox1.Text += "WebEnv: " + WebEnv + "\r\n";

    ? textBox1.Text += "QueryKey: " + query_key + "\r\n\r\n";

    ?

    ? }

    ? catch (Exception eee)

    ? {

    ? textBox1.Text += eee.ToString();

    ? }

    ?

    ? // STEP #2: fetch 5 records from pubmed starting from record #10

    ? //

    ? try

    ? {

    ? eFetchPubmed.eFetchPubmedService serv = new eFetchPubmed.eFetchPubmedService();

    ? // call NCBI EFetch utility

    ? eFetchPubmed.eFetchRequest req = new eFetchPubmed.eFetchRequest();

    ? req.WebEnv = WebEnv;

    ? req.query_key = query_key;

    ? req.retstart = "10";

    ? req.retmax = "5";

    ? eFetchPubmed.eFetchResult res = serv.run_eFetch(req);

    ? // results output

    ? for (int i = 0; i < res.PubmedArticleSet.Length; i++)

    ? {

    ? textBox1.Text += "Title: " + res.PubmedArticleSet[i].MedlineCitation.Article.ArticleTitle + "\r\n";

    ? textBox1.Text += "Abstract: " + res.PubmedArticleSet[i].MedlineCitation.Article.Abstract.AbstractText + "\r\n";

    ? textBox1.Text += "--------------------------\r\n\r\n";

    ? }

    ? }

    ? catch (Exception eee)

    ? {

    ? textBox1.Text += eee.ToString();

    ? }

    創作挑戰賽新人創作獎勵來咯,堅持創作打卡瓜分現金大獎

    總結

    以上是生活随笔為你收集整理的强大的NCBI接口的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。

    主站蜘蛛池模板: 欧美一级二级三级视频 | 宇都宫紫苑在线播放 | 懂色av成人一区二区三区 | 日本肉体xxxx裸体xxx免费 | 欧美日韩一二三 | 亚洲小说图片区 | 欧美群交射精内射颜射潮喷 | 欧美极品视频在线观看 | 国产精品区一区二 | 爱草在线| 69成人免费视频 | 爱爱视频网站 | www.成人 | 日韩av一区在线 | 国精品一区 | 少妇扒开粉嫩小泬视频 | 国产黑丝在线视频 | 国产少女免费观看高清 | 欧美成人免费在线观看视频 | 伊人久久免费 | 日日噜 | 青青草一区二区 | 国产一级伦理片 | 在线视频 亚洲 | 黄色av网页 | 日韩免费观看视频 | 成人精品一区二区三区在线 | 国产网红女主播精品视频 | av在线男人天堂 | 在线中文字幕网站 | 欧美a√ | 欧美日韩三级在线观看 | 电影91久久久 | 99国产揄拍国产精品 | 中文字幕在线国产 | 国产成人在线观看免费网站 | 伊人三区 | 国产精品久久777777换脸 | 在线视频日韩 | 在线免费看91 | 国产黄色大片视频 | 国产三级国产精品国产国在线观看 | 人成免费在线视频 | 欧美激情精品久久久久久变态 | www爱爱 | 中国老熟女重囗味hdxx | 美女十八毛片 | 日韩色黄大片 | 狠狠一区 | 亚洲综合大片69999 | 少妇献身老头系列 | 色婷婷av国产精品 | 中文字幕在线二区 | 超碰caopor| www.色人阁| 国产中文在线播放 | 黄色三级带 | 久色成人 | 青草伊人网 | 夜夜天天| 雪花飘电影在线观看免费高清 | 九九热最新视频 | 美女免费毛片 | 青青国产在线观看 | 人人人超碰 | 我们的2018在线观看免费高清 | 精品视频一区二区在线观看 | 欧美大片在线看免费观看 | 草碰在线视频 | 成人在线观看免费网站 | 五月天色视频 | 开心激情网五月天 | 国产成人自拍偷拍 | 国产高清色| 草草影院在线观看视频 | 免费黄网站在线观看 | 精品人妻午夜一区二区三区四区 | 一区二区视频在线观看免费 | 最近日韩中文字幕中文 | 人妻夜夜爽天天爽三区麻豆av网站 | www.haoav| 亚洲成熟丰满熟妇高潮xxxxx | 成年人爱爱视频 | 中文字幕国产在线 | 亚洲视频一区二区三区在线观看 | 午夜影院视频 | 成年人视频网站 | 东北少妇av | 免费av一区二区 | 国产精品99一区 | 国产中文字幕一区二区三区 | 96国产精品| 国产精品亚洲AV色欲三区不卡 | 伊人365影院 | 91正在播放 | 亚洲天堂爱爱 | 伊人青青久| 色香av | 欧美精品一区二区三区四区 |