public class PUGProcessor extends net.idea.modbcum.p.DefaultAmbitProcessor<List<IStructureRecord>,List<IStructureRecord>>
Constructor and Description |
---|
PUGProcessor() |
public static final String PUBCHEM_CID
protected static String pugURL
protected QuerySupport<List<IStructureRecord>,List<IStructureRecord>> support
protected static final String PCT_attribute_value
protected static final String[] PCT_status
protected static final int PCT_download_compression_none
protected static final int PCT_download_compression_gzip
protected static final int PCT_download_compression_bzip2
protected static final String[] PCT_download_compression
protected static final int PCT_download_format_text_asn
protected static final int PCT_download_format_binary_asn
protected static final int PCT_download_format_xml
protected static final int PCT_download_format_sdf
protected static final String[] PCT_download_format
protected static final String tag_PCT_Data
protected static final String tag_PCT_Data_input
protected static final String tag_PCT_Data_output
protected static final String tag_PCT_InputData
protected static final String tag_PCT_OutputData
protected static final String tag_PCT_OutputData_status
protected static final String tag_PCT_OutputData_output
protected static final String tag_PCT_OutputData_output_download_url
protected static final String tag_PCT_Download_URL
protected static final String tag_PCT_Download_URL_url
protected static final String tag_PCT_OutputData_output_waiting
protected static final String tag_PCT_Waiting
protected static final String tag_PCT_Waiting_reqid
protected static final String tag_PCT_InputData_download
protected static final String tag_PCT_Download
protected static final String tag_PCT_Download_uids
protected static final String tag_PCT_QueryUids
protected static final String tag_PCT_QueryUids_ids
protected static final String tag_PCT_ID_List
protected static final String tag_PCT_ID_List_uids
protected static final String tag_PCT_ID_List_uids_E
protected static final String tag_PCT_ID_List_db
protected static final String tag_PCT_Download_format
protected static final String tag_PCT_Download_compression
protected static final String tag_PCT_download_3D
protected boolean retrieveConformers
public boolean isRetrieveConformers()
public void setRetrieveConformers(boolean retrieveConformers)
public List<IStructureRecord> process(List<IStructureRecord> target) throws net.idea.modbcum.i.exceptions.AmbitException
Example: You want to download CID 1 and CID 99 being uids 1 and 99 in the 'pccompound' Entrez database in SDF format with gzip compression. The typical flow of information is as follows. First, the initial input XML is sent to PUG via HTTP POST. Note the input data container with the download request and uid and format options:If the request is small and finishes very quickly, you may get a final URL right away (see further below). But usually PUG will respond initially with a waiting message and a request ID ( pccompound 1 99 ) such as: You would then parse out this request id, being '402936103567975582', in this case, and use this id to 'poll' PUG on the status of the request, composing an XML message like: 402936103567975582 Note that here the request type 'status' is used; there is also the request type 'cancel' that you may use to cancel a running job. If the request is still running, you well get back another waiting message as above, and then you would poll again after some reasonable interval. If the request is finished, you will get a final result message like: 402936103567975582 You would parse out the URL from the ftp://ftp-private.ncbi.nlm.nih.gov/pubchem/.fetch/1064385222466625960.sdf.gz tag, and then use a tool of your choice to connect to that URL to retrieve the actual requested data.
net.idea.modbcum.i.exceptions.AmbitException
protected HTTPRequest<List<IStructureRecord>,List<IStructureRecord>> createDownloadHTTPRequest(List<IStructureRecord> record)
protected HTTPRequest<List<IStructureRecord>,List<IStructureRecord>> createPollRequest(List<IStructureRecord> waitingregids)
public void createDownloadRequest(List<IStructureRecord> sids, Writer out) throws ParserConfigurationException, TransformerException, IOException
public static void createPollRequest(IStructureRecord regid, Writer out) throws ProcessorException
ProcessorException
public static List<IStructureRecord> parseOutput(Document doc) throws ProcessorException
doc
- ProcessorException
protected static List<IStructureRecord> processWaiting(Document doc, Element waiting) throws ProcessorException
ProcessorException
protected static List<IStructureRecord> processDownloadURL(Document doc, Element download) throws ProcessorException
ProcessorException
protected static Element getNodes(Document doc, Element parent, String tag) throws ProcessorException
ProcessorException
Copyright © 2004–2020 Ideaconsult Ltd.. All rights reserved.