Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified _cite/.cache/cache.db
Binary file not shown.
80 changes: 59 additions & 21 deletions _cite/plugins/orcid.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import json
from urllib.request import Request, urlopen
from util import *
from manubot.cite.handlers import prefix_to_handler as manubot_prefixes
from manubot.cite.handlers import prefix_to_handler as manubot_citable


def main(entry):
Expand Down Expand Up @@ -33,36 +33,66 @@ def query(_id):
# list of sources to return
sources = []

# go through response structure and pull out ids e.g. doi:1234/56789
# filter id by some criteria. return true to accept, false to reject.
def filter_id(_id):
# is id of certain "relationship" type
relationships = ["self", "version-of", "part-of"]
if not get_safe(_id, "external-id-relationship", "") in relationships:
return False

id_type = get_safe(_id, "external-id-type", "")

# is id of certain type
# types = ["doi"]
# if id_type not in types:
# return False

# is id citable by manubot
if id_type not in manubot_citable:
return False

return True

# prefer some ids over others by some criteria. return lower number to prefer more.
def sort_id(_id):
types = [
"doi",
# "arxiv",
# "url",
]
return index_of(types, get_safe(_id, "external-id-type", ""))

# go through each source
for work in response:
# get list of ids
# list of ids in work
ids = []

# use "work-summary" field instead of top-level "external-ids" to reflect author-selected preferred sources
for summary in get_safe(work, "work-summary", []):
ids = ids + get_safe(summary, "external-ids.external-id", [])

# find first id of particular "relationship" type
_id = next(
(
id
for id in ids
if get_safe(id, "external-id-relationship", "")
in ["self", "version-of", "part-of"]
),
ids[0] if len(ids) > 0 else None,
)

if _id == None:
continue

# get id and id-type from response
# filter ids by criteria
ids = list(filter(filter_id, ids))
# sort ids by criteria
ids.sort(key=sort_id)

# pick first id
_id = ids[0] if len(ids) > 0 else None

# id parts
id_type = get_safe(_id, "external-id-type", "")
id_value = get_safe(_id, "external-id-value", "")

# create source
source = {"id": f"{id_type}:{id_value}"}
source = {}

# if not an id type that Manubot can cite, keep citation details
if id_type not in manubot_prefixes:
# if id citable by manubot
if id_type and id_value and id_type in manubot_citable:
# id to cite with manubot
source = {"id": f"{id_type}:{id_value}"}

# if not citable by manubot, keep citation details from orcid
else:
# get summaries
summaries = get_safe(work, "work-summary", [])

Expand Down Expand Up @@ -107,3 +137,11 @@ def first(get_func):
sources.append(source)

return sources


# index of, with fallback
def index_of(_list, value):
try:
return _list.index(value)
except ValueError:
return float("inf")
122 changes: 113 additions & 9 deletions _data/citations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1948,6 +1948,26 @@
buttons:
- type: preprint
link: https://arxiv.org/abs/2104.11364
- id: doi:10.48550/arxiv.2109.08633
title: An Open-Publishing Response to the COVID-19 Infodemic
authors:
- Halie M. Rando
- Simina M. Boca
- Lucy D'Agostino McGowan
- Daniel S. Himmelstein
- Michael P. Robson
- Vincent Rubinetti
- Ryan Velazquez
- COVID-19 Review Consortium
- Casey S. Greene
- Anthony Gitter
publisher: arXiv
date: '2021-01-01'
link: https://doi.org/gt6s6s
orcid: 0000-0001-8713-9213
member: casey-greene
plugin: orcid.py
file: orcid.yaml
- id: doi:10.1016/j.cels.2021.07.007
title: Analysis of scientific society honors reveals disparities
authors:
Expand Down Expand Up @@ -4473,6 +4493,29 @@
- open science
- collaboration
repo: greenelab/meta-review
- id: issn:23356936 23356928
title: ''
authors: []
publisher: ''
date: ''
link: https://portal.issn.org/resource/ISSN/23356936 23356928
orcid: 0000-0001-8713-9213
member: casey-greene
plugin: orcid.py
file: orcid.yaml
- id: doi:10.1101/385534
title: Parameter tuning is a key part of dimensionality reduction via deep variational
autoencoders for single cell RNA transcriptomics
authors:
- Qiwen Hu
- Casey S. Greene
publisher: Cold Spring Harbor Laboratory
date: '2018-08-05'
link: https://doi.org/gdxxjf
orcid: 0000-0001-8713-9213
member: casey-greene
plugin: orcid.py
file: orcid.yaml
- id: doi:10.1101/573782
title: Sequential compression of gene expression across dimensionalities and methods
reveals no single best method or dimensionality
Expand Down Expand Up @@ -8215,6 +8258,16 @@
member: casey-greene
plugin: sources.py
file: sources.yaml
- id: wosuid:WOS:000386326200051
title: Web of Science
authors: []
publisher: ''
date: ''
link: https://www.webofscience.com/wos/woscc/full-record/WOS:WOS:000386326200051
orcid: 0000-0001-8713-9213
member: casey-greene
plugin: orcid.py
file: orcid.yaml
- id: doi:10.7717/peerj.1621
title: Cross-platform normalization of microarray and RNA-seq data for machine learning
applications
Expand Down Expand Up @@ -8356,6 +8409,17 @@
buttons:
- type: source
link: https://github.com/greenelab/adni-netwas
- id: doi:10.1126/scitranslmed.aaf9196
title: Nothing but a hound dog
authors:
- Casey S. Greene
publisher: Science Translational Medicine
date: '2016-05-25'
link: https://doi.org/gg7qr2
orcid: 0000-0001-8713-9213
member: casey-greene
plugin: sources.py
file: sources.yaml
- id: doi:10.1093/bib/bbv087
title: Recent Advances and Emerging Applications in Text and Data Mining for Biomedical
Discovery
Expand Down Expand Up @@ -9016,6 +9080,15 @@
text: Raw networks
- type: app
link: http://giant.princeton.edu/
- title: Unsupervised feature construction and knowledge extraction from genome-wide
assays of breast cancer with denoising autoencoders
publisher: 20th Pacific Symposium on Biocomputing, PSB 2015
date: '2024-08-07'
link: http://www.scopus.com/inward/record.url?eid=2-s2.0-84971231452&partnerID=MN8TOARS
orcid: 0000-0001-8713-9213
member: casey-greene
plugin: orcid.py
file: orcid.yaml
- id: wosuid:MEDLINE:25592575
title: Web of Science
authors: []
Expand All @@ -9026,6 +9099,15 @@
member: casey-greene
plugin: orcid.py
file: orcid.yaml
- title: Applications of bioinformatics to non-coding RNAs in the era of next-generation
sequencing
publisher: 19th Pacific Symposium on Biocomputing, PSB 2014
date: '2024-08-07'
link: http://www.scopus.com/inward/record.url?eid=2-s2.0-84905885881&partnerID=MN8TOARS
orcid: 0000-0001-8713-9213
member: casey-greene
plugin: orcid.py
file: orcid.yaml
- id: wosuid:MEDLINE:24297566
title: Web of Science
authors: []
Expand Down Expand Up @@ -9155,6 +9237,17 @@
member: casey-greene
plugin: orcid.py
file: orcid.yaml
- id: issn:23356936
title: ISSN 2335-6936 (Online) | Pacific symposium on biocomputing ... | The ISSN
Portal
authors: []
publisher: ''
date: ''
link: https://portal.issn.org/resource/ISSN/23356936
orcid: 0000-0001-8713-9213
member: casey-greene
plugin: orcid.py
file: orcid.yaml
- id: doi:10.1007/978-3-642-37189-9_2
title: Time-Point Specific Weighting Improves Coexpression Networks from Time-Course
Experiments
Expand Down Expand Up @@ -9298,6 +9391,16 @@
member: casey-greene
plugin: orcid.py
file: orcid.yaml
- id: wosuid:WOS:000411479100034
title: Web of Science
authors: []
publisher: ''
date: ''
link: https://www.webofscience.com/wos/woscc/full-record/WOS:WOS:000411479100034
orcid: 0000-0001-8713-9213
member: casey-greene
plugin: orcid.py
file: orcid.yaml
- id: wosuid:MEDLINE:19908385
title: Web of Science
authors: []
Expand Down Expand Up @@ -9574,6 +9677,16 @@
member: casey-greene
plugin: orcid.py
file: orcid.yaml
- title: Using expert knowledge in initialization for genome-wide analysis of epistasis
using genetic programming
publisher: 'GECCO''08: Proceedings of the 10th Annual Conference on Genetic and
Evolutionary Computation 2008'
date: '2024-08-07'
link: http://www.scopus.com/inward/record.url?eid=2-s2.0-57349142365&partnerID=MN8TOARS
orcid: 0000-0001-8713-9213
member: casey-greene
plugin: orcid.py
file: orcid.yaml
- id: doi:10.1007/978-3-540-75286-8_4
title: An Expert Knowledge-Guided Mutation Operator for Genome-Wide Genetic Analysis
Using Genetic Programming
Expand Down Expand Up @@ -11382,15 +11495,6 @@
link: http://dx.doi.org/10.1101/062695
plugin: sources.py
file: sources.yaml
- id: doi:10.1126/scitranslmed.aaf9196
title: Nothing but a hound dog
authors:
- Casey S. Greene
publisher: Science Translational Medicine
date: '2016-05-25'
link: https://doi.org/gg7qr2
plugin: sources.py
file: sources.yaml
- id: doi:10.1534/g3.116.033514
title: Comprehensive Cross-Population Analysis of High-Grade Serous Ovarian Cancer
Supports No More Than Three Subtypes
Expand Down