Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ncbi_entrez
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
courses
ncbi_entrez
Commits
3ee073fc
Commit
3ee073fc
authored
4 years ago
by
peguerin
Browse files
Options
Downloads
Patches
Plain Diff
nice example of esarch
parent
b93ffa89
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
usage_rentrez.R
+30
-0
30 additions, 0 deletions
usage_rentrez.R
with
30 additions
and
0 deletions
usage_rentrez.R
0 → 100644
+
30
−
0
View file @
3ee073fc
library
(
rentrez
)
## search Rana temporaria entreies in "Nucleotide" database from NCBI
## search returns a list of IDs
## retmax argument is to ask more than 20 (default value) results
query
<-
entrez_search
(
db
=
"nucleotide"
,
term
=
"rana temporaria[ORGN] AND mitochondrion AND complete genome"
,
retmax
=
99999
)
## see the IDs of the queries
query
$
ids
## item i can search in nucleotide database
entrez_db_searchable
(
'nucleotide'
)
## search the gene named "mhc" and species from "actinopterygii" class organism
query
<-
entrez_search
(
db
=
"nucleotide"
,
term
=
"(MHC[GENE] OR (major histocompatibility
complex[MeSH])) AND actinopterygii[ORGN] AND 1992:2021[PDAT]"
,
retmax
=
99999
)
search_year
<-
function
(
year
,
term
){
query
<-
paste
(
term
,
" AND ("
,
year
,
"[PDAT])"
)
entrez_search
(
db
=
"nucleotide"
,
term
=
query
,
retmax
=
0
)
$
count
}
year
<-
1992
:
2021
publications
<-
sapply
(
year
,
search_year
,
term
=
"(MHC[GENE] OR (major histocompatibility complex[MeSH])) AND actinopterygii[ORGN]"
,
USE.NAMES
=
FALSE
)
plot
(
year
,
publications
,
type
=
"l"
,
main
=
"MHC actinopterygii"
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment