Skip to content

Instantly share code, notes, and snippets.

@lindenb
Last active February 22, 2019 14:49
Show Gist options
  • Select an option

  • Save lindenb/5d7773a93d8c2b0edbd4c01bf8834919 to your computer and use it in GitHub Desktop.

Select an option

Save lindenb/5d7773a93d8c2b0edbd4c01bf8834919 to your computer and use it in GitHub Desktop.
https://www.biostars.org/p/365479/ Question: Bioinformatics word cloud to use in classes bioinformatics xml pubmed ncbi cloud word xslt jvarkit

Example

Mesh words in 'Oxford Bioinformatics' 2018.

 java -jar dist/pubmeddump.jar 'Bioinformatics[journal] AND 2018[PDAT]'| \
 java -jar dist/xsltstream.jar --tag PubmedArticle -t biostars365479.xsl > out.txt
<?xml version='1.0' encoding="UTF-8" ?>
<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0' >
<xsl:output method="text" encoding="UTF-8"/>
<xsl:template match="/">
<xsl:apply-templates select="*"/>
</xsl:template>
<xsl:template match="*">
<xsl:apply-templates select="PubmedArticle"/>
</xsl:template>
<xsl:template match="PubmedArticle">
<xsl:variable name="year" select="MedlineCitation/Article/Journal/JournalIssue/PubDate/Year/text()"/>
<xsl:for-each select="MedlineCitation/MeshHeadingList/MeshHeading/DescriptorName">
<xsl:value-of select="$year"/>
<xsl:text> </xsl:text>
<xsl:value-of select="./text()"/>
<xsl:text>
</xsl:text>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment