Commit 4e0f30ae authored by lindenb's avatar lindenb
Browse files

cont

parent adf43eb7
import gov.nih.nlm.ncbi.snp.docsum.*;
import javax.xml.bind.*;
import javax.xml.stream.*;
import javax.xml.stream.events.*;
class ParseDbSnp
{
public static void main(String[] args) throws Exception
{
JAXBContext jaxbCtxt=JAXBContext.newInstance("gov.nih.nlm.ncbi.snp.docsum");
Unmarshaller unmarshaller=jaxbCtxt.createUnmarshaller();
XMLInputFactory ifactory = XMLInputFactory.newInstance();
XMLEventReader r= ifactory.createXMLEventReader(System.in);
while(r.hasNext())
{
XMLEvent evt=r.peek();
if(!(evt.isStartElement() && evt.asStartElement().getName().getLocalPart().equals("Rs")))
{
evt=r.nextEvent();
continue;
}
Rs rs=unmarshaller.unmarshal(r, Rs.class).getValue();
if("genomic".equals(rs.getMolType())) continue;
System.out.println("rs"+rs.getRsId()+" "+rs.getMolType());
}
r.close();
}
}
<?xml version='1.0' encoding="UTF-8"?>
<!--
Author:
Pierre Lindenbaum
http://plindenbaum.blogspot.com
Motivation:
transforms the xmloutput of genbank-xml to SVG
Reference:
Params:
* width
Usage :
xsltproc db2svg.xsl sequence.gbc.xml > file.svg
-->
<xsl:stylesheet
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:str="http://exslt.org/strings"
extension-element-prefixes="str"
version='1.1'
>
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
<xsl:param name="variations"/><!-- space-separated list of positions to highlight -->
<xsl:param name="feature-height" select="number(20)"/>
<xsl:param name="title-height" select="2 * $feature-height"/>
<xsl:param name="width" select="number(900)"/>
<xsl:param name="height" select="(count(/INSDSet/INSDSeq/INSDSeq_feature-table/INSDFeature/INSDFeature_intervals/INSDInterval) * $feature-height)+number(1)+ count(/INSDSet/INSDSeq)*$title-height"/>
<xsl:param name="left-margin" select="number(10)"/>
<xsl:param name="right-margin" select="number(10)"/>
<xsl:template match="/">
<xsl:apply-templates select="INSDSet"/>
</xsl:template>
<xsl:template match="INSDSet">
<xsl:element name="svg:svg">
<xsl:attribute name="height"><xsl:value-of select="$height"/></xsl:attribute>
<xsl:attribute name="width"><xsl:value-of select="$width + $left-margin + $right-margin"/></xsl:attribute>
<xsl:attribute name="style">stroke-width:1px;</xsl:attribute>
<svg:title>
<xsl:choose>
<xsl:when test="count(INSDSeq)=1">
<xsl:value-of select="INSDSeq/INSDSeq_definition"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat(count(INSDSeq),' sequences')"/>
</xsl:otherwise>
</xsl:choose>
</svg:title>
<svg:defs>
<svg:linearGradient x1="0%" y1="0%" x2="0%" y2="100%" id="grad">
<svg:stop offset="5%" stop-color="black" />
<svg:stop offset="50%" stop-color="whitesmoke" />
<svg:stop offset="95%" stop-color="black" />
</svg:linearGradient>
<svg:linearGradient x1="0%" y1="0%" x2="0%" y2="100%" id="vertical_body_gradient">
<svg:stop offset="5%" stop-color="white" />
<svg:stop offset="95%" stop-color="lightgray" />
</svg:linearGradient>
</svg:defs>
<svg:style type="text/css">
</svg:style>
<svg:g>
<xsl:apply-templates select="INSDSeq"/>
</svg:g>
</xsl:element>
</xsl:template>
<!-- ===================================
INSDSeq
======================================= -->
<xsl:template match="INSDSeq">
<xsl:variable name="seqy" select="$feature-height * count(preceding-sibling::INSDSeq/INSDSeq_feature-table/INSDFeature/INSDFeature_intervals/INSDInterval) + $title-height*count(preceding-sibling::INSDSeq)"/>
<xsl:variable name="seqheight" select="$feature-height * count(INSDSeq_feature-table/INSDFeature/INSDFeature_intervals/INSDInterval) + $title-height"/>
<xsl:variable name="seqmin">
<xsl:for-each select="INSDSeq_feature-table/INSDFeature/INSDFeature_intervals/INSDInterval/INSDInterval_from">
<xsl:sort select="." data-type="number" order="ascending" />
<xsl:if test="position() = 1">
<xsl:value-of select="number(text())" />
</xsl:if>
</xsl:for-each>
</xsl:variable>
<xsl:variable name="seqmax">
<xsl:for-each select="INSDSeq_feature-table/INSDFeature/INSDFeature_intervals/INSDInterval/INSDInterval_to">
<xsl:sort select="." data-type="number" order="descending" />
<xsl:if test="position() = 1">
<xsl:value-of select="number(text())" />
</xsl:if>
</xsl:for-each>
</xsl:variable>
<xsl:element name="svg:g">
<xsl:attribute name="transform">
<xsl:value-of select="concat('translate(0,',$seqy,')')"/>
</xsl:attribute>
<xsl:element name="svg:rect">
<xsl:attribute name="x">0</xsl:attribute>
<xsl:attribute name="y">0</xsl:attribute>
<xsl:attribute name="width"><xsl:value-of select="$width + $left-margin + $right-margin"/></xsl:attribute>
<xsl:attribute name="height"><xsl:value-of select="$seqheight"/></xsl:attribute>
<xsl:attribute name="fill">url(#vertical_body_gradient)</xsl:attribute>
<xsl:attribute name="stroke">black</xsl:attribute>
</xsl:element>
<xsl:element name="svg:text">
<xsl:attribute name="style">color:red;font-size:<xsl:value-of select="$title-height -5"/>px;</xsl:attribute>
<xsl:attribute name="x"><xsl:value-of select="$left-margin"/></xsl:attribute>
<xsl:attribute name="y"><xsl:value-of select="$title-height -5"/></xsl:attribute>
<xsl:value-of select="INSDSeq_definition"/>
</xsl:element>
<xsl:for-each select="INSDSeq_feature-table/INSDFeature/INSDFeature_intervals/INSDInterval">
<xsl:element name="svg:g">
<xsl:variable name="fleft">
<xsl:choose>
<xsl:when test="INSDInterval_point">
<xsl:value-of select="$left-margin + (( number(INSDInterval_point) - $seqmin ) div ($seqmax - $seqmin) ) * $width "/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$left-margin + (( number(INSDInterval_from) - $seqmin ) div ($seqmax - $seqmin) ) * $width "/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="fright">
<xsl:choose>
<xsl:when test="INSDInterval_point">
<xsl:value-of select="$fleft + 1"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$left-margin + (( number(INSDInterval_to) - $seqmin ) div ($seqmax - $seqmin) ) * $width "/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="fy">
<xsl:value-of select="$title-height + ((position() - 1) * $feature-height)"/>
</xsl:variable>
<xsl:variable name="fmid">
<xsl:value-of select="$fy + ( $feature-height div 2.0 )"/>
</xsl:variable>
<xsl:element name="svg:rect">
<xsl:attribute name="x"><xsl:value-of select="$fleft"/></xsl:attribute>
<xsl:attribute name="y"><xsl:value-of select="$fy"/></xsl:attribute>
<xsl:attribute name="width"><xsl:value-of select="$fright - $fleft"/></xsl:attribute>
<xsl:attribute name="height"><xsl:value-of select="$feature-height - 2"/></xsl:attribute>
<xsl:attribute name="style">fill:url(#grad);stroke:black;</xsl:attribute>
<xsl:attribute name="title"><xsl:value-of select="../../INSDFeature_location"/></xsl:attribute>
</xsl:element>
<xsl:element name="svg:text">
<xsl:attribute name="y"><xsl:value-of select="$fmid + 4"/></xsl:attribute>
<xsl:choose>
<xsl:when test="$fleft &gt; ($width div 10.0)">
<xsl:attribute name="x">
<xsl:value-of select="$fleft - 2"/>
</xsl:attribute>
<xsl:attribute name="text-anchor">end</xsl:attribute>
</xsl:when>
<xsl:when test="$fright &lt; ($width * 0.9)">
<xsl:attribute name="x">
<xsl:value-of select="$fright + 2"/>
</xsl:attribute>
<xsl:attribute name="text-anchor">start</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="x">
<xsl:value-of select="($fright + $fleft) div 2.0"/>
</xsl:attribute>
<xsl:attribute name="text-anchor">middle</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
<svg:tspan style="font-weight:bold;">
<xsl:apply-templates select="../../INSDFeature_key"/>
</svg:tspan>
<xsl:apply-templates select="../../INSDFeature_quals"/>
</xsl:element>
</xsl:element><!-- g -->
</xsl:for-each>
<!-- BEGIN mutations -->
<xsl:for-each select="str:tokenize($variations,' ,/')">
<xsl:if test="number(text())&gt;=0">
<xsl:variable name="mutpos" select="number(./text())"/>
<xsl:variable name="varx">
<xsl:value-of select="$left-margin + (( $mutpos - $seqmin ) div ($seqmax - $seqmin) ) * $width "/>
</xsl:variable>
<svg:line style="stroke:red;" y1="0">
<xsl:attribute name="title">Mutation at <xsl:value-of select="."/></xsl:attribute>
<xsl:attribute name="y2"><xsl:value-of select="$seqheight"/></xsl:attribute>
<xsl:attribute name="x1"><xsl:value-of select="$varx"/></xsl:attribute>
<xsl:attribute name="x2"><xsl:value-of select="1 + $varx"/></xsl:attribute>
</svg:line>
</xsl:if>
</xsl:for-each>
<!-- END mutations -->
<xsl:element name="svg:rect">
<xsl:attribute name="x">0</xsl:attribute>
<xsl:attribute name="y">0</xsl:attribute>
<xsl:attribute name="width"><xsl:value-of select="$width + $left-margin + $right-margin"/></xsl:attribute>
<xsl:attribute name="height"><xsl:value-of select="$seqheight"/></xsl:attribute>
<xsl:attribute name="fill">none</xsl:attribute>
<xsl:attribute name="stroke">black</xsl:attribute>
</xsl:element>
</xsl:element><!-- svg:g -->
</xsl:template>
<xsl:template match="INSDFeature_quals">
<xsl:apply-templates select="INSDQualifier"/>
</xsl:template>
<xsl:template match="INSDQualifier">
<xsl:text> </xsl:text>
<svg:tspan font-weight="bold">
<xsl:value-of select="INSDQualifier_name"/>
</svg:tspan>
<xsl:text>:</xsl:text>
<xsl:value-of select="INSDQualifier_value"/>
</xsl:template>
<xsl:template match="INSDQualifier[INSDQualifier_name='note' or INSDQualifier_name='db_xref' or INSDQualifier_name='transl_table' or INSDQualifier_name='translation' or INSDQualifier_name='inference' or INSDQualifier_name='gene_synonym']">
</xsl:template>
</xsl:stylesheet>
......@@ -543,7 +543,7 @@ $ curl "http://eutils.ncbi.nlm.nih.gov/gquery?term=tyrannosaurus%20rex&retmode=
%%\begin{frame}[fragile]
\subsubsection{Transforming to HTML using XSLT}
The XSLT stylesheet.
The XSLT stylesheet : \url{https://gitlab.univ-nantes.fr/pierre.lindenbaum/tdncbi/blob/master/pubmed2rstats.xsl}
\begin{lstlisting}[language=xslt,basicstyle=\tiny,]
......@@ -605,14 +605,14 @@ The XSLT stylesheet.
</tr>
<tr>
<td>
<a href="http://www.ncbi.nlm.nih.gov/pubmed?cmd=search&amp;term=tyrannosaurus+rex">pmc</a>
<a href="http://www.ncbi.nlm.nih.gov/pmc?cmd=search&amp;term=tyrannosaurus+rex">pmc</a>
</td>
<td>160</td>
<td>Ok</td>
</tr>
<tr>
<td>
<a href="http://www.ncbi.nlm.nih.gov/pubmed?cmd=search&amp;term=tyrannosaurus+rex">mesh</a>
<a href="http://www.ncbi.nlm.nih.gov/mesh?cmd=search&amp;term=tyrannosaurus+rex">mesh</a>
</td>
<td>15</td>
\end{lstlisting}
......@@ -625,10 +625,9 @@ The XSLT stylesheet.
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\hugeslide{ESearch}
%%\begin{frame}[fragile]
\subsection{ESearch}
\begin{itemize}
\item Provides a list of UIDs matching a text query
\item Posts the results of a search on the History server
......@@ -796,7 +795,7 @@ xmllint --format -
\subsection{ESummary}
\subsubsection{Syntax}
\begin{itemize}
\item Returns document summaries (DocSums) for a list of input UIDs
\item Returns DocSums for a set of UIDs stored on the Entrez History server
......@@ -804,15 +803,15 @@ xmllint --format -
%%\end{frame}
%%\begin{frame}[fragile]
\subsection{ESummary}
\subsubsection{Syntax}
Base URL:
\url{http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=(DB)\&id=(TERM)}
%%\end{frame}
%%\begin{frame}[fragile]
\subsection{ESummary}
\subsubsection{Retrieve nucleotide gi=507866428}
\begin{lstlisting}[language=bash,basicstyle=\tiny,breaklines=true]
$ curl "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=nucleotide&id=507866428"
......@@ -840,7 +839,7 @@ $ curl "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=nucleotid
%%\end{frame}
%%\begin{frame}[fragile]
\subsection{ESummary}
\subsubsection{Retrieve snp rs25}
\begin{lstlisting}[language=bash,basicstyle=\tiny,breaklines=true]
$ curl "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=snp&id=25"
......@@ -896,7 +895,7 @@ $ curl "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=snp&id=25"
%%\begin{frame}[fragile]
\subsection{ESummary}
\subsubsection{Retrieve pubmed pmid=7939126}
\begin{lstlisting}[language=bash,basicstyle=\tiny,breaklines=true]
$ curl "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=pubmed&id=7939126"
......@@ -965,10 +964,7 @@ $ curl "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=pubmed&id
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\hugeslide{EFetch}
%%\begin{frame}[fragile]
\subsection{EFetch}
\subsubsection{Syntax}
Base URL:
......@@ -1007,7 +1003,7 @@ Seq-entry ::= set {
%%\end{frame}
%%\begin{frame}[fragile]
\subsection{EFetch}
\subsubsection{Retrieve nucleotide gi=507866428 as Fasta}
\url{http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=nucleotide&id=507866428&rettype=fasta}
\begin{lstlisting}[basicstyle=\tiny,breaklines=true]
......@@ -1025,7 +1021,7 @@ NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
%%\end{frame}
%%\begin{frame}[fragile]
\subsection{EFetch}
\subsubsection{Retrieve nucleotide gi=507866428 as TinySeq}
\url{http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=nucleotide&id=507866428&rettype=fasta&retmode=xml}
\begin{lstlisting}[language=xml,basicstyle=\tiny,breaklines=false]
......@@ -1047,8 +1043,6 @@ NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
%%\end{frame}
%%\begin{frame}[fragile]
\subsection{EFetch}
\subsubsection{Retrieve nucleotide gi=507866428 as Genbank-xml}
\url{http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=nucleotide&id=507866428&retmode=xml}
\begin{lstlisting}[language=xml,basicstyle=\tiny,breaklines=false]
......@@ -1075,7 +1069,7 @@ NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
%%\end{frame}
%%\begin{frame}[fragile]
\subsection{EFetch}
\subsubsection{Retrieve nucleotide gi=507866428 as Genbank}
\url{http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=nucleotide&id=507866428&rettype=gb}
\begin{lstlisting}[language=bash,basicstyle=\tiny,breaklines=false]
......@@ -1124,7 +1118,7 @@ FEATURES Location/Qualifiers
%%\begin{frame}[fragile]
\subsection{EFetch}
\subsubsection{Efetch works with the ACCESSION NUMBERS}
\url{http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=nucleotide&id=KC524742&rettype=gb}
\begin{lstlisting}[language=bash,basicstyle=\tiny,breaklines=false]
......@@ -1173,14 +1167,14 @@ FEATURES Location/Qualifiers
%%\begin{frame}[fragile]
\subsection{EFetch}
\subsubsection{Using the WebEnv parameter.}
Web environment string returned from a previous ESearch, EPost or ELink call. When provided, ESearch will post the results of the search operation to this pre-existing WebEnv.
%%\end{frame}
%%\begin{frame}[fragile]
\subsection{EFetch}
\subsubsection{Using the WebEnv parameter.}
Searching extinct species in the NCBI taxonomy ('extinct[PROP]')
\begin{lstlisting}[language=bash,basicstyle=\tiny,breaklines=true,escapechar=\!]
curl "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?!\color{red}{usehistory=y}!&db=taxonomy&term=extinct%5BPROP%5D"
......@@ -1231,7 +1225,8 @@ curl "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?!\color{red}{us
%%\end{frame}
%%\begin{frame}[fragile]
\subsection{EFetch}
\subsubsection{Using the WebEnv parameter.}
Fetch the extinct species in the NCBI taxonomy ('extinct[PROP]') using the WebEnv parameter.
......@@ -1266,6 +1261,10 @@ $ curl "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=taxonomy&!\c
%%\begin{frame}[fragile]
\subsection{EPost}
"Accepts a list of UIDs from a given database, stores the set on the History Server, and responds with a query key and web environment for the uploaded dataset."
XSLT : \url{https://gitlab.univ-nantes.fr/pierre.lindenbaum/tdncbi/blob/master/ncbi2epost.xsl}
\begin{lstlisting}[language=xslt,basicstyle=\tiny]
<?xml version='1.0' encoding="UTF-8" ?>
<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>
......@@ -1299,7 +1298,7 @@ EOF
%%\end{frame}
%%\begin{frame}[fragile]
\subsection{EPost}
\subsubsection{Post gi to epost}
Transforms the result of EFetch to a Bash script calling curl+Epost.
\begin{lstlisting}[language=bash,basicstyle=\tiny,breaklines=true,escapechar=\!]
......@@ -1318,7 +1317,6 @@ EOF
%%\begin{frame}[fragile]
\subsection{EPost}
\subsubsection{Post gi to epost}
... the result is now piped into {\bf bash}
\begin{lstlisting}[language=bash,basicstyle=\tiny,breaklines=true,escapechar=\!]
......@@ -1339,7 +1337,6 @@ NCBI answer:
%%\end{frame}
%%\begin{frame}[fragile]
\subsection{EPost}
\subsubsection{Searching in the WebEnv}
Search {\bf Homo Sapiens} in {\bf WebEnv} ?
......@@ -1373,7 +1370,6 @@ curl -s "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=taxonomy&t
%%\end{frame}
%%\begin{frame}[fragile]
\subsection{EPost}
\subsubsection{Searching in the WebEnv}
Search {\bf Tyranosaurus} in {\bf WebEnv} ?
\begin{lstlisting}[language=bash,basicstyle=\tiny,breaklines=true,escapechar=\!]
......@@ -1430,7 +1426,7 @@ $ curl -s "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=taxonomy
%%\end{frame}
%%\begin{frame}[fragile]
\subsection{Elink}
Base URL:
\small
\url{http://eutils.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi}
......@@ -1438,7 +1434,7 @@ Base URL:
%%\begin{frame}[fragile]
\subsection{ELink}
\subsubsection{Searching the pubmed records associated to sequence gi:507866428}
\begin{lstlisting}[language=bash,basicstyle=\tiny,breaklines=true,escapechar=\!]
http://eutils.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?dbfrom=nucleotide&db=pubmed&id=507866428&cmd=neighbor_score
......@@ -1485,10 +1481,10 @@ LID - 10.1126/science.1234192 [doi]
\subsection{Efetch}
\subsubsection{Transforming to SVG}
Using the stylesheet \url{https://github.com/lindenb/xslt-sandbox/blob/master/stylesheets/bio/ncbi/gb2svg.xsl}
Using the stylesheet \url{https://gitlab.univ-nantes.fr/pierre.lindenbaum/tdncbi/blob/master/gb2svg.xsl}
\begin{lstlisting}[language=bash,basicstyle=\tiny,breaklines=true,escapechar=\!]
xsltproc <(curl "https://raw.github.com/lindenb/xslt-sandbox/master/stylesheets/bio/ncbi/gb2svg.xsl") \
xsltproc gb2svg.xsl \
"http://www.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=nucleotide&id=14971102&retmode=xml&rettype=gbc"
\end{lstlisting}
%%\end{frame}
......@@ -1496,7 +1492,7 @@ xsltproc <(curl "https://raw.github.com/lindenb/xslt-sandbox/master/stylesheets
%%\begin{frame}[fragile]
\subsection{Efetch}
\subsubsection{Transforming to R}
\begin{lstlisting}[language=bash,basicstyle=\tiny,breaklines=true,escapechar=\!]
$ curl -s "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pubmed&term=Tyrannosaurus&usehistory=true" | xmllint --format -
......@@ -1504,6 +1500,8 @@ $ curl -s "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=pubmed&us
\end{lstlisting}
%%\end{frame}
Using the stylesheet \url{https://gitlab.univ-nantes.fr/pierre.lindenbaum/tdncbi/blob/master/pubmed2rstats.xsl}
\begin{lstlisting}[language=xslt,basicstyle=\tiny]
<?xml version='1.0' encoding="UTF-8" ?>
<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>
......@@ -1532,8 +1530,8 @@ date2count[["<xsl:value-of select="$year"/>"]] &lt;- ifelse(is.null(date2count[[
\end{lstlisting}
%%\begin{frame}[fragile]
\subsection{Efetch}
\subsubsection{Transforming to R}
\begin{lstlisting}[language=bash,basicstyle=\tiny,breaklines=true,escapechar=\!]
$ curl "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=pubmed&usehistory=true&WebEnv=NCID_1_52434791_130.14.22.215_9001_1375957034_1619786167&query_key=1&retmode=xml" |\
......@@ -1559,14 +1557,8 @@ title('pubmed: count(articles)=f(year)')
dev.off()
\end{lstlisting}
%%\end{frame}
%%\begin{frame}[fragile]
\subsection{Efetch}
\subsubsection{Transforming to R}
\begin{lstlisting}[language=bash,basicstyle=\tiny,breaklines=true,escapechar=\!]
$ curl "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=pubmed&usehistory=true&WebEnv=NCID_1_52434791_130.14.22.215_9001_1375957034_1619786167&query_key=1&retmode=xml" |\
xsltproc pubmed2rstats.xsl - |\
......@@ -1581,7 +1573,7 @@ R --no-save
%%\begin{frame}[fragile]
\subsection{Using the XML schema}
\subsubsection{XML Schema for dbSNP}
\url{ftp://ftp.ncbi.nlm.nih.gov/snp/specs/docsum_3.3.xsd}
\url{ftp://ftp.ncbi.nlm.nih.gov/snp/specs/docsum_3.4.xsd}
\begin{lstlisting}[language=xml,basicstyle=\tiny,breaklines=false]
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.ncbi.nlm.nih.gov/SNP/docsum" targetNamespace="http://www.ncbi.nlm.nih.gov/SNP/docsum" el
......@@ -1616,7 +1608,7 @@ ementFormDefault="qualified" attributeFormDefault="unqualified">
%%\end{frame}
%%\begin{frame}[fragile]
\subsection{Using the XML schema}
\subsubsection{Compiling the XML Schema for dbSNP with XJC}
\begin{lstlisting}[language=bash,basicstyle=\tiny,breaklines=false]
......@@ -1642,8 +1634,11 @@ gov/nih/nlm/ncbi/snp/docsum/package-info.java
%%\begin{frame}[fragile]
\subsection{Using the XML schema}
\subsubsection{Compiling the XML Schema for dbSNP with XJC}
\url{https://gitlab.univ-nantes.fr/pierre.lindenbaum/tdncbi/blob/master/ParseDbSnp.java}
Search the non-genomic rs\# in dbSNP.
\begin{lstlisting}[language=java,basicstyle=\tiny]
......@@ -1679,7 +1674,7 @@ class ParseDbSnp
%%\end{frame}
%%\begin{frame}[fragile]
\subsection{Using the XML schema}
\subsubsection{Compiling the XML Schema for dbSNP with XJC}
compile...
\begin{lstlisting}[language=bash,basicstyle=\tiny,breaklines=false]
......@@ -1724,7 +1719,7 @@ rs946 cDNA
%%\end{frame}
%%\begin{frame}[fragile]
\subsection{NCBI EBot}
\subsubsection{Sample output}
\begin{lstlisting}[language=perl,basicstyle=\tiny,breaklines=true]
#!/usr/bin/perl
......@@ -1768,7 +1763,6 @@ export PATH=${PATH}:/path/to/ncbi-blast-2.2.28+/bin
%%\begin{frame}[fragile]
\subsection{Standalone Blast}
\subsubsection{Download a sample}
apis mellifera proteins
\begin{lstlisting}[language=bash,basicstyle=\tiny,breaklines=true]
......@@ -1780,7 +1774,6 @@ gunzip protein.fa.gz
%%\begin{frame}[fragile]
\subsection{Standalone Blast}
\subsubsection{Create a Blast database with makeblastdb}
Getting help...
\begin{lstlisting}[language=bash]
......@@ -1800,7 +1793,6 @@ $ makeblastdb -help
%%\begin{frame}[fragile]
\subsection{Standalone Blast}
\subsubsection{Create a Blast database with makeblastdb}
Create the BLAST database:
\begin{lstlisting}[language=bash]
......@@ -1818,7 +1810,7 @@ Adding sequences from FASTA; added 10570 sequences in 1.84458 seconds.
%%\end{frame}
%%\begin{frame}[fragile]
\subsection{Standalone Blast}
\subsubsection{Query a Blast database with blastp}
Get help:
\begin{lstlisting}[language=bash]
......@@ -1834,7 +1826,6 @@ $ blastp -help
%%\end{frame}
%%\begin{frame}[fragile]
\subsection{Standalone Blast}
\subsubsection{Blast human EIF4G1 gi:187956781 }
\begin{lstlisting}[language=bash,basicstyle=\tiny,breaklines=true]
$ curl "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=protein&rettype=fasta&id=187956781" |\
......