npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

apostrophe-pubmed-import

v1.0.9

Published

Import PubMed docs from a Google Spreadsheet via an additional Manager interface on a piece subclass

Downloads

23

Readme

apostrophe-pubmed-import

This module adds an optional import from PubMed feature to all apostrophe-pieces in an Apostrophe project.

In it's current state it blindly writes new pieces on each import, it does not check for duplicate PubMed docs. This would be a cool feature to throw in the config modal though

in app.js

modules: {
  'apostrophe-pubmed-import': {},
  // other modules...
  'my-module-that-extends-pieces': {
    pubmedImport: {
      googleSpreadsheetId: 'o4nfowuenf', // optional, include a spreadsheet ID in the help text
      // Import field map
      mapFields: {
        // Include a key/value pair for each field importing. This will likely
        // match the `pubmed.map` object in your piece module, with the id added.
        // `key` is the piece fieldname, `value` is pubmed document key.
        // Full list of keys further down.
        'pubmedId' : 'pmid',
      }
    }
  }
}

In the views/ folder of your module that extends pieces

{%- extends "managerModalBase.html" -%}
{%- import "piecesMacros.html" as pieces with context -%}
{%- import 'apostrophe-ui:components/buttons.html' as buttons with context -%}

{%- block controls -%}
  {{ buttons.minor('Import from PubMed', { action: 'pubmed-import-' + data.options.name }) }}
  {{ pieces.manageControls() }}
{%- endblock -%}

The Google Spreadsheet

The import configuration modal requires you to enter the ID of a PUBLIC Google Spreadsheet. The spreadsheet must be public itself, but also published to the web using the user interface: File > Publish to the web. The ID of the "published to the web" version may be different from the ID of the spreadsheet itself. Use the ID from the spreadsheet.

For example, if your spreadsheet URL is https://docs.google.com/spreadsheets/d/2ZVD4_gysdJ0CJ0w5Dq-x9bZmL28OT0Ox_TY8Kn5K41w/edit#gid=0, your ID is 2ZVD4_gysdJ0CJ0w5Dq-x9bZmL28OT0Ox_TY8Kn5K41w.

Right now the spreadsheet format just cares about a column titled id with a list of PMID's. An example spreadsheet can be seen at https://docs.google.com/spreadsheets/d/1HuAxHijAFAzz-XFa5FGRTF6AdJ-HLJuHSCDBSDqr4Xc/pubhtml

Example PubMed object

{ uid: '28277220',
  pubdate: '2017 Mar 2',
  epubdate: '',
  source: 'Euro Surveill',
  authors: 'Peters T, Bertrand S, Björkman JT, Brandal LT, Brown DJ, Erdõsi T, Heck M, Ibrahem S, Johansson K, Kornschober C, Kotila SM, Le Hello S, Lienemann T, Mattheus W, Nielsen EM, Ragimbeau C, Rumore J, Sabol A, Torpdahl M, Trees E, Tuohy A, de Pinna E',
  lastauthor: 'de Pinna E',
  title: 'Multi-laboratory validation study of multilocus variable-number tandem repeat analysis (MLVA) for Salmonella enterica serovar Enteritidis, 2015.',
  sorttitle: 'multi laboratory validation study of multilocus variable number tandem repeat analysis mlva for salmonella enterica serovar enteritidis 2015',
  volume: '22',
  issue: '9',
  pages: '',
  lang: [ 'eng' ],
  nlmuniqueid: '100887452',
  issn: '1025-496X',
  essn: '1560-7917',
  pubtype: [ 'Journal Article' ],
  recordstatus: 'PubMed - in process',
  pubstatus: '4',
  articleids:
   [ { idtype: 'pubmed', idtypen: 1, value: '28277220' },
     { idtype: 'doi',
       idtypen: 3,
       value: '10.2807/1560-7917.ES.2017.22.9.30477' },
     { idtype: 'pii', idtypen: 4, value: '30477' },
     { idtype: 'rid', idtypen: 8, value: '28277220' },
     { idtype: 'eid', idtypen: 8, value: '28277220' } ],
  history:
   [ { pubstatus: 'received', date: '2016/01/14 00:00' },
     { pubstatus: 'accepted', date: '2016/05/10 00:00' },
     { pubstatus: 'entrez', date: '2017/03/10 06:00' },
     { pubstatus: 'pubmed', date: '2017/03/10 06:00' },
     { pubstatus: 'medline', date: '2017/03/10 06:00' } ],
  references: [],
  attributes: [ 'Has Abstract' ],
  pmcrefcount: '',
  fulljournalname: 'Euro surveillance : bulletin Europeen sur les maladies transmissibles = European communicable disease bulletin',
  elocationid: 'pii: 30477. doi: 10.2807/1560-7917.ES.2017.22.9.30477',
  doctype: 'citation',
  srccontriblist: [],
  booktitle: '',
  medium: '',
  edition: '',
  publisherlocation: '',
  publishername: '',
  srcdate: '',
  reportnumber: '',
  availablefromurl: '',
  locationlabel: '',
  doccontriblist: [],
  docdate: '',
  bookname: '',
  chapter: '',
  sortpubdate: '2017/03/02 00:00',
  sortfirstauthor: 'Peters T',
  vernaculartitle: '',
  abstract: 'Multilocus variable-number tandem repeat analysis (MLVA) is a rapid and reproducible typing method that is an important tool for investigation, as well as detection, of national and multinational outbreaks of a range of food-borne pathogens. Salmonella enterica serovar Enteritidis is the most common Salmonella serovar associated with human salmonellosis in the European Union/European Economic Area and North America. Fourteen laboratories from 13 countries in Europe and North America participated in a validation study for MLVA of S. Enteritidis targeting five loci. Following normalisation of fragment sizes using a set of reference strains, a blinded set of 24 strains with known allele sizes was analysed by each participant. The S. Enteritidis 5-loci MLVA protocol was shown to produce internationally comparable results as more than 90% of the participants reported less than 5% discrepant MLVA profiles. All 14 participating laboratories performed well, even those where experience with this typing method was limited. The raw fragment length data were consistent throughout, and the inter-laboratory validation helped to standardise the conversion of raw data to repeat numbers with at least two countries updating their internal procedures. However, differences in assigned MLVA profiles remain between well-established protocols and should be taken into account when exchanging data.',
  doi: '10.2807/1560-7917.ES.2017.22.9.30477',
  pmid: 28277220,
  pubDate: '2017/03/02 00:00',
  pubmedLink: 'https://www.ncbi.nlm.nih.gov/pubmed/28277220',
  year: '2017',
  published: 'March 2, 2017' }

Changelog

1.0.9 (2020-09-23)

  • Removes the package-lock file. Updates package metadata.

1.0.8 (2020-09-09)

  • Updates dependencies to resolve vulnerability warnings. The major version change for google-spreadsheet-to-json lists the only breaking change as "removed user/password auth method," which does not apply to this package.