search

Rabu, 30 Agustus 2006

CML RSS Reader in Java

In addition to a Java version of MoleculeBlogInfo, I've also developed a first cut of an RSS reader devoted to RSS (1.0) feeds containing Chemical Markup Language (CML). A zip file containing this software can be found here. Although not (yet) very sophisticated, particularly in its user interface, this software has several useful features, which I expect to build upon. Like all feed readers, it will run in the background, periodically checking for and downloading new feed items as they appear (in fact, the user interface can be turned off, allowing the program to be run on a server machine). All CML contained in items is parsed out into separate XML files, which can be viewed with a molecular viewer such as Jmol, or processed in other ways. Other chemical information in the feed, such as SMILES, InChIs, molecular weights, and suppliers, are also extracted and displayed in the user interface as they are found. The most interesting feature of this software, however, and closely in keeping with the vision of chemical information in RSS, is the ability to configure program "hooks" to perform any additional processing desired. For example, a "post-download" program could be configured to perform any desired calculations on a molecule, or perform a web search for information; the results could then be automatically added to a database, uploaded to a web site, or e-mailed to all interested parties. An example of a configuration file for the software is given below:

<?xml version="1.0" encoding="utf-8" ?>
<Configuration>
<Feeds>
<Feed>
<DownloadURL>http://showme.physics.drexel.edu/usefulchem/Software/MoleculeBlogInfo/usefulchem-molecules/usefulchem-molecules.rss</DownloadURL>
<DownloadURLLastModified>Fri, 25 Aug 2006 23:47:26 GMT</DownloadURLLastModified>
<DataDirectory>usefulchem-molecules</DataDirectory>
<DownloadFileName>usefulchem-molecules.rss</DownloadFileName>
<Hooks>
<PostDownload>java UsefulChemMoleculesPage D:\Drexel\Cheminformatics\Ajax\UsefulChemistryMolecules</PostDownload>
</Hooks>
<RefreshInterval>
<Days>0</Days>
<Hours>1</Hours>
</RefreshInterval>
</Feed>
</Feeds>
<FeedsFrame>
<Display>true</Display>
<Width>800</Width>
<Height>600</Height>
</FeedsFrame>
<MoleculeViewer>java -Xmx512m -jar Jmol.jar</MoleculeViewer>
<OutputFile>CMLRSSReader.out</OutputFile>
</Configuration>
Note the <PostDownload> entry in the <Hooks> section; the program UsefulChemMoleculesPage generates a dynamic HTML page which allows you to select the <description> fields from the RSS item entries (this page, incidentally, is a demonstration of the use of Ajax and Javascript to dynamically load data from a server without refreshing the entire page).


Tidak ada komentar:

Posting Komentar