001/*
002 *                    BioJava development code
003 *
004 * This code may be freely distributed and modified under the
005 * terms of the GNU Lesser General Public Licence.  This should
006 * be distributed with the code.  If you do not have a copy,
007 * see:
008 *
009 *      http://www.gnu.org/copyleft/lesser.html
010 *
011 * Copyright for this code is held jointly by the individual
012 * authors.  These should be listed in @author doc comments.
013 *
014 * For more information on the BioJava project and its aims,
015 * or to join the biojava-l mailing list, visit the home page
016 * at:
017 *
018 *      http://www.biojava.org/
019 *
020 */
021package org.biojava.nbio.ws.alignment;
022
023import org.biojava.nbio.core.sequence.template.Compound;
024import org.biojava.nbio.core.sequence.template.Sequence;
025
026import java.io.InputStream;
027/**
028 * This interface specifies minimal information needed to execute a pairwise alignment on a remote service.
029 *
030 * Example of service: QBlast service at NCBI
031 *                     Web Service at EBI
032 *
033 * @author Sylvain Foisy
034 * @since Biojava 3
035 *
036 */
037public interface RemotePairwiseAlignmentService {
038
039        /**
040         * Doing the actual analysis on the instantiated service using specified parameters and the RichSequence object
041         *
042         * @throws Exception
043         */
044        public String sendAlignmentRequest(Sequence<Compound> seq, RemotePairwiseAlignmentProperties rpa) throws Exception;
045
046        /**
047         * Doing the actual analysis on the instantiated service using specified parameters on the string representation
048         * of the Sequence object
049         *
050         * @throws Exception
051         */
052        public String sendAlignmentRequest(String str, RemotePairwiseAlignmentProperties rpa) throws Exception;
053
054        /**
055         * Simple method to check if the specified request has been completed by the service used.
056         *
057         * @param id :an ID for an alignment request
058         * @param present :a long integer value representing the actual time
059         * @return a boolean value telling if this requestID has been completed or not.
060         * @throws Exception if the ID does not exist.
061         */
062        public boolean isReady(String id,long present) throws Exception;
063
064        /**
065         * Getting the actual alignment results from this instantiated service for a given ID with specific
066         * formatting parameters held in a RemotePairwiseAlignmentOutputProperties-implemented object.
067         *
068         * @param rid :a String with the request ID for this single alignment run
069         * @param out :a RemotePairwiseAlignmentOutputProperties with the specific output instructions.
070         * @return : an <code>InputStream</code> with the actual alignment results
071         * @throws Exception
072         */
073        public InputStream getAlignmentResults(String rid,RemotePairwiseAlignmentOutputProperties out) throws Exception;
074}