Skip to content

Instantly share code, notes, and snippets.

@blahah
Last active May 9, 2017 14:39
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save blahah/51730eb7a36f34e48964c933750aba6d to your computer and use it in GitHub Desktop.
Save blahah/51730eb7a36f34e48964c933750aba6d to your computer and use it in GitHub Desktop.
easily find retracted papers in PubMed, using only bionode-ncbi and jq
# you'll need:
# - bionode-ncbi (https://github.com/bionode/bionode-ncbi)
# - jq (https://github.com/stedolan/jq)
# count the number of retracted papers
bionode-ncbi search pubmed "\"Retracted Publication\"" \
| jq -c 'select(.pubtype[] | inside("Retracted Publication"))'
| wc -l
# get DOIs for all the retracted papers
# note that not all retracted papers have DOIs - those without DOIs will be left out of this list
bionode-ncbi search pubmed "\"Retracted Publication\"" \
| jq -c 'select(.pubtype[] | inside("Retracted Publication")) | .articleids | .[] | select(.idtype == "doi")| .value' \
> pubmed_retracted_DOIs.txt
# get all notifications of retraction
bionode-ncbi search pubmed "\"Retraction of Publication\"" \
| jq -c 'select(.pubtype[] | inside("Retraction of Publication"))' > pubmed_notifications.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment