变换 pmc-id ->下午

发布于 2025-01-04 08:26:22 字数 135 浏览 0 评论 0 原文

是否可以通过 ncbi api 将 pmc-ids(pubmed 中央 id)转换为 pmids(pubmed id)?您可以通过网络表单来完成,但我想使用一个程序 - 当然我总是可以编写一个屏幕scraper ...谢谢

Is it possible to transform pmc-ids (pubmed central ids) to pmids (pubmed ids) via a ncbi api? You can do it via the web form but I would like to use a program - of course I can always write a screen scraper ... thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

╰沐子 2025-01-11 08:26:22

您可以使用 NCBI Entrez 编程实用程序 (EFetch 将 pubmed 中心 ID 转换为 pubmed id rel="nofollow">电子实用程序)。可以通过任何可以从 HTTP 读取数据并解析 XML 的编程语言使用 EFetch。

例如,如果您列表中的一篇文章是:

Wang TT,。生物化学杂志。 2010年1月22日;285(4):2227-31。
PubMed PMID:19948723 PubMed 中心 PMCID:PMC2807280

您可以从以下 EFetch url 获取 XML 文档:

“http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=pmc&id=2807280&rettype=medline& ;retmode=xml"

XML 文档包含 PubMed ID:

<pmc-articleset>
   <article>
     <front>
        <article-meta>
            <article-id pub-id-type="pmc">2807280</article-id>
            <article-id pub-id-type="pmid">19948723</article-id>

在 perl 中将 pmcid 转换为 pmid 的一种方法是:

#!/usr/bin/perl
# pmcid2pmid.pl -- convert a pubmed central id to a pubmed id with EFetch 
# http://eutils.ncbi.nlm.nih.gov/corehtml/query/static/efetchlit_help.html

use strict;
use warnings;
use LWP::UserAgent;    # send request to eutils.ncbi.nlm.nih.gov
use XML::Smart;        # parse response

# check parameter
my ($id) = @ARGV;
if ( not(defined($id))  ) { 
    print STDERR "must provide a pmcid as 1st parameter...\n";  
    exit(-1);
}    

$id =~ s/PMC//;
sleep(3);  #  recommended delay between queries

# build & send efetch query
my $efetch= "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?";
my $efetch_query = "db=pmc&id=$id&rettype=medline&retmode=xml";
my $url = $efetch.$efetch_query;

my $xml  = XML::Smart->new($url);
##print $xml->dump_tree(),"\n";

# parse the response
$xml = $xml->{'pmc-articleset'}->{'article'}->{'front'}{'article-meta'};
my $pmid   = $xml->{'article-id'}('pub-id-type','eq','pmid')->content; 

print STDOUT "PMID = $pmid";

>perl pmcid2pmid.pl PMC2807280
PMID = 19948723

You can convert pubmed central ids to pubmed ids with EFetch, from the NCBI Entrez Programming Utilities (E-utilities). It is possible to use EFetch from any programming language that can read data from HTTP and parse XML.

For example, if one of the articles in your list is:

Wang TT, et al. J Biol Chem. 2010 Jan 22;285(4):2227-31.
PubMed PMID: 19948723 PubMed Central PMCID: PMC2807280

You can get an XML document from the following EFetch url:

"http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=pmc&id=2807280&rettype=medline&retmode=xml"

The XML document contains the PubMed ID:

<pmc-articleset>
   <article>
     <front>
        <article-meta>
            <article-id pub-id-type="pmc">2807280</article-id>
            <article-id pub-id-type="pmid">19948723</article-id>

One way to convert a pmcid to a pmid in perl is:

#!/usr/bin/perl
# pmcid2pmid.pl -- convert a pubmed central id to a pubmed id with EFetch 
# http://eutils.ncbi.nlm.nih.gov/corehtml/query/static/efetchlit_help.html

use strict;
use warnings;
use LWP::UserAgent;    # send request to eutils.ncbi.nlm.nih.gov
use XML::Smart;        # parse response

# check parameter
my ($id) = @ARGV;
if ( not(defined($id))  ) { 
    print STDERR "must provide a pmcid as 1st parameter...\n";  
    exit(-1);
}    

$id =~ s/PMC//;
sleep(3);  #  recommended delay between queries

# build & send efetch query
my $efetch= "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?";
my $efetch_query = "db=pmc&id=$id&rettype=medline&retmode=xml";
my $url = $efetch.$efetch_query;

my $xml  = XML::Smart->new($url);
##print $xml->dump_tree(),"\n";

# parse the response
$xml = $xml->{'pmc-articleset'}->{'article'}->{'front'}{'article-meta'};
my $pmid   = $xml->{'article-id'}('pub-id-type','eq','pmid')->content; 

print STDOUT "PMID = $pmid";

>perl pmcid2pmid.pl PMC2807280
PMID = 19948723

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文