Пример #1
0
        public void InvalidateNcbiWebServiceRequestStatusWithoutConfigPams()
        {
            // Gets the search query parameter and their values.
            string alphabet = utilityObj.xmlUtil.GetTextValue(
                Constants.EbiBlastResultsNode, Constants.AlphabetNameNode);
            string querySequence = utilityObj.xmlUtil.GetTextValue(
                Constants.EbiBlastResultsNode, Constants.QuerySequency);

            Sequence seq = new Sequence(Utility.GetAlphabet(alphabet), querySequence);

            // Set Service confiruration parameters true.
            NCBIBlastHandler service = new NCBIBlastHandler();

            // Dispose Ncbi Blast Handler.
            service.Dispose();

            ConfigParameters configParams = new ConfigParameters();

            configParams.UseBrowserProxy = true;
            service.Configuration        = configParams;
            BlastParameters searchParams = new BlastParameters();

            // Get Request identifier from web service.
            try
            {
                service.SubmitRequest(seq, searchParams);
                Assert.Fail();
            }
            catch (Exception)
            {
                ApplicationLog.WriteLine(
                    "NcbiWebService P2 : Successfully validated the exception");
            }
        }
        /// <summary>
        /// Submits a blast query to a blast search provider.
        /// This sample uses NCBI as the provider.
        /// </summary>
        /// <param name="sequence">Sequence to submit for searching.</param>
        /// <returns>Job ID of the query. You can get the results using GetBlastResults after the job is completed.</returns>
        public static string SubmitBlastQuery(ISequence sequence)
        {
            // Create the service provider
            NCBIBlastHandler serviceProvider = new NCBIBlastHandler();

            ConfigParameters configParams = new ConfigParameters();
            configParams.UseBrowserProxy = true;
            serviceProvider.Configuration = configParams;

            // create the request and return the job ID.
            return serviceProvider.SubmitRequest(sequence, GetBlastSearchParams());
        }
Пример #3
0
        /// <summary>
        /// The execution method for the activity.
        /// </summary>
        /// <param name="executionContext">The execution context.</param>
        /// <returns>The execution status.</returns>
        protected override ActivityExecutionStatus Execute(ActivityExecutionContext executionContext)
        {
            FastAParser fastaParser = new FastAParser();

            fastaParser.Open(InputFile);
            ISequence searchSequence = fastaParser.Parse().FirstOrDefault();

            NCBIBlastHandler service = new NCBIBlastHandler();

            ConfigParameters configParams = new ConfigParameters();

            configParams.UseBrowserProxy = true;
            service.Configuration        = configParams;

            BlastParameters searchParams = new BlastParameters();

            // fill in the BLAST settings:
            searchParams.Add("Program", "blastn");
            searchParams.Add("Database", "nr");
            // higher Expect will return more results
            searchParams.Add("Expect", "1e-10");
            searchParams.Add("CompositionBasedStatistics", "0");

            // create the request
            string jobID = service.SubmitRequest(searchSequence, searchParams);

            // query the status
            ServiceRequestInformation info = service.GetRequestStatus(jobID);

            if (info.Status != ServiceRequestStatus.Waiting &&
                info.Status != ServiceRequestStatus.Ready)
            {
                // TODO: Add error handling here
            }

            // get async results, poll until ready
            int maxAttempts = 10;
            int attempt     = 1;

            while (attempt <= maxAttempts &&
                   info.Status != ServiceRequestStatus.Error &&
                   info.Status != ServiceRequestStatus.Ready)
            {
                ++attempt;
                info = service.GetRequestStatus(jobID);
                Thread.Sleep(
                    info.Status == ServiceRequestStatus.Waiting || info.Status == ServiceRequestStatus.Queued
                    ? 20000 * attempt : 0);
            }

            // Get blast result.
            BlastXmlParser      blastParser = new BlastXmlParser();
            IList <BlastResult> results     = blastParser.Parse(new StringReader(service.GetResult(jobID, searchParams)));

            // Convert blast result to BlastCollator.
            List <BlastResultCollator> blastResultCollator = new List <BlastResultCollator>();

            foreach (BlastResult result in results)
            {
                foreach (BlastSearchRecord record in result.Records)
                {
                    if (null != record.Hits &&
                        0 < record.Hits.Count)
                    {
                        foreach (Hit hit in record.Hits)
                        {
                            if (null != hit.Hsps &&
                                0 < hit.Hsps.Count)
                            {
                                foreach (Hsp hsp in hit.Hsps)
                                {
                                    BlastResultCollator blast = new BlastResultCollator();
                                    blast.Alignment     = hsp.AlignmentLength;
                                    blast.Bit           = hsp.BitScore;
                                    blast.EValue        = hsp.EValue;
                                    blast.Identity      = hsp.IdentitiesCount;
                                    blast.Length        = hit.Length;
                                    blast.QEnd          = hsp.QueryEnd;
                                    blast.QStart        = hsp.QueryStart;
                                    blast.QueryId       = record.IterationQueryId;
                                    blast.SEnd          = hsp.HitEnd;
                                    blast.SStart        = hsp.HitStart;
                                    blast.SubjectId     = hit.Id;
                                    blast.Positives     = hsp.PositivesCount;
                                    blast.QueryString   = hsp.QuerySequence;
                                    blast.SubjectString = hsp.HitSequence;
                                    blast.Accession     = hit.Accession;
                                    blast.Description   = hit.Def;
                                    blastResultCollator.Add(blast);
                                }
                            }
                        }
                    }
                }
            }

            BlastXmlSerializer serializer = new BlastXmlSerializer();
            Stream             stream     = serializer.SerializeBlastOutput(blastResultCollator);

            // set result to the output property.
            BlastResult = GetSerializedData(stream);

            return(ActivityExecutionStatus.Closed);
        }
Пример #4
0
        /// <summary>
        /// Validate general fetching results by passing 
        /// different parameters.
        /// </summary>
        /// <param name="nodeName">xml node name</param>
        /// <param name="NcbiCtorPam">Ncbi constructor different parameters</param>
        void GeneralMethodToValidateResults(string nodeName,
            NcbiWebServiceCtorParameters NcbiCtorPam)
        {
            // Gets the search query parameter and their values.
            string queryParameter = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.QuerySequencyparameter);
            string querySequence = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.QuerySequency);
            string queryDatabaseValue = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.DatabaseValue);
            string queryProgramValue = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.ProgramValue);
            string queryDatabaseParameter = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.DatabaseParameter);
            string queryProgramParameter = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.ProgramParameter);
            string expectedHitId = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.HitID);
            string expectedAccession = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.HitAccession);

            object responseResults = null;

            NCBIBlastHandler service;
            IBlastParser blastXmlParser = new BlastXmlParser();
            ConfigParameters configParams = new ConfigParameters();
            configParams.UseBrowserProxy = true;

            switch (NcbiCtorPam)
            {
                case NcbiWebServiceCtorParameters.ConfigPams:
                    service = new NCBIBlastHandler(configParams);
                    break;
                case NcbiWebServiceCtorParameters.ParserAndConfigPams:
                    service = new NCBIBlastHandler(blastXmlParser, configParams);
                    break;
                default:
                    service = new NCBIBlastHandler();
                    break;
            }

            ISequence sequence = new Sequence(Utility.GetAlphabet("DNA"), "ATCGCC");
            BlastParameters searchParams = new BlastParameters();

            searchParams.Add(queryParameter, querySequence);
            searchParams.Add(queryDatabaseParameter, queryDatabaseValue);
            searchParams.Add(queryProgramParameter, queryProgramValue);

            // Careate a request without passing sequence.
            string reqId = service.SubmitRequest(sequence, searchParams);

            // validate request identifier.
            Assert.IsNotNull(reqId);

            // submit request identifier and get the status
            ServiceRequestInformation info = service.GetRequestStatus(reqId);
            if (info.Status != ServiceRequestStatus.Waiting
                && info.Status != ServiceRequestStatus.Ready)
            {
                string err = ApplicationLog.WriteLine("Unexpected status: '{0}'", info.Status);
                Assert.Fail(err);
            }

            // get async results, poll until ready
            int maxAttempts = 10;
            int attempt = 1;
            while (attempt <= maxAttempts
                && info.Status != ServiceRequestStatus.Error
                && info.Status != ServiceRequestStatus.Ready)
            {
                Thread.Sleep(info.Status == ServiceRequestStatus.Waiting ? 40000 : 0);
                info = service.GetRequestStatus(reqId);
                ++attempt;
            }

            responseResults = blastXmlParser.Parse(
                    new StringReader(service.GetResult(reqId, searchParams)));

            // Validate blast results.
            Assert.IsNotNull(responseResults);
            List<BlastResult> blastResults = responseResults as List<BlastResult>;
            Assert.IsNotNull(blastResults);
            BlastSearchRecord record = blastResults[0].Records[0];
            Hit hit = null;
            if (record.Hits.Count > 0)
            {
                hit = record.Hits[0];
                Assert.AreEqual(hit.Accession, expectedAccession);
                Assert.AreEqual(hit.Id.ToString((IFormatProvider)null), expectedHitId);

                ApplicationLog.WriteLine(string.Format((IFormatProvider)null, "Blast BVT: Hits count '{0}'.", blastResults.Count));
                ApplicationLog.WriteLine(string.Format((IFormatProvider)null, "Blast BVT: Accession '{0}'.", hit.Accession));
                ApplicationLog.WriteLine(string.Format((IFormatProvider)null, "Blast BVT: Hit Id '{0}'.", hit.Id));
                ApplicationLog.WriteLine(string.Format((IFormatProvider)null, "Blast BVT: Hits Count '{0}'.", hit.Hsps.Count));
            }
        }
Пример #5
0
        /// <summary>
        /// Validate general fetching results.by passing 
        /// differnt parameters.
        /// <param name="nodeName">xml node name.</param>
        /// <param name="expectParameter">expectparameter name</param>
        /// <param name="compositionBasedStaticParameter">compositionBasedStaticParameter name</param>
        /// <param name="isFetchSynchronous">Is Fetch Synchronous?</param>
        /// </summary>
        void ValidateGeneralFetchResults(
            string nodeName, string expectParameter,
            string compositionBasedStaticParameter,
            bool isFetchSynchronous)
        {
            // Gets the search query parameter and their values.
            string queryParameter = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.QuerySequencyparameter);
            string querySequence = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.QuerySequency);
            string queryDatabaseValue = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.DatabaseValue);
            string queryProgramValue = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.ProgramValue);
            string queryDatabaseParameter = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.DatabaseParameter);
            string queryProgramParameter = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.ProgramParameter);
            string optionalExpectParameter = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.BlastExpectParameter);
            string optionalExpectValue = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.BlastExpectparameterValue);
            string optionalCBSParameter = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.BlastCompositionBasedStaticsParameter);
            string optionalCBSParameterValue = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.BlastCompositionBasedStaticsValue);
            string expectedHitId = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.HitID);
            string expectedAccession = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.HitAccession);

            object responseResults = null;

            NCBIBlastHandler service = new NCBIBlastHandler();
            ConfigParameters configParams = new ConfigParameters();
            configParams.UseBrowserProxy = true;
            service.Configuration = configParams;
            ISequence sequence = new Sequence(Alphabets.DNA, "ATCGGGGCCC");
            BlastParameters searchParams = new BlastParameters();

            // Set mandatory parameters only if optional parameters are null
            if ((0 == string.Compare(expectParameter, null, true,
                CultureInfo.CurrentCulture))
                && (0 == string.Compare(compositionBasedStaticParameter, null, true,
                CultureInfo.CurrentCulture)))
            {
                searchParams.Add(queryParameter, querySequence);
                searchParams.Add(queryDatabaseParameter, queryDatabaseValue);
                searchParams.Add(queryProgramParameter, queryProgramValue);
            }
            else
            {
                searchParams.Add(queryParameter, querySequence);
                searchParams.Add(queryDatabaseParameter, queryDatabaseValue);
                searchParams.Add(queryProgramParameter, queryProgramValue);
                searchParams.Add(optionalExpectParameter, optionalExpectValue);
                searchParams.Add(optionalCBSParameter, optionalCBSParameterValue);
            }

            // Careate a request without passing sequence.
            string reqId = service.SubmitRequest(sequence, searchParams);

            // validate request identifier.
            Assert.IsNotNull(reqId);

            // submit request identifier and get the status
            ServiceRequestInformation info = service.GetRequestStatus(reqId);
            if (info.Status != ServiceRequestStatus.Waiting &&
                info.Status != ServiceRequestStatus.Ready)
            {
                string err = ApplicationLog.WriteLine("Unexpected status: '{0}'", info.Status);
                Assert.Fail(err);
            }

            // get async results, poll until ready
            int maxAttempts = 10;
            int attempt = 1;
            while (attempt <= maxAttempts
                && info.Status != ServiceRequestStatus.Error
                && info.Status != ServiceRequestStatus.Ready)
            {
                if (isFetchSynchronous)
                {
                    info = service.GetRequestStatus(reqId);
                    Thread.Sleep(info.Status == ServiceRequestStatus.Waiting
                        || info.Status == ServiceRequestStatus.Queued
                        ? 20000 * attempt : 0);
                }
                else
                {
                    Thread.Sleep(info.Status == ServiceRequestStatus.Waiting ? 30000 : 0);
                    info = service.GetRequestStatus(reqId);
                }
                ++attempt;
            }

            IBlastParser blastXmlParser = new BlastXmlParser();
            responseResults = blastXmlParser.Parse(
                new StringReader(service.GetResult(reqId, searchParams)));

            // Validate blast results.
            Assert.IsNotNull(responseResults);
            List<BlastResult> blastResults = responseResults as List<BlastResult>;
            Assert.IsNotNull(blastResults);
            BlastSearchRecord record = blastResults[0].Records[0];
            if (record.Hits.Count > 0)
            {
                Hit hit = record.Hits[0];
                Assert.AreEqual(hit.Accession, expectedAccession);
                Assert.AreEqual(hit.Id.ToString((IFormatProvider)null), expectedHitId);
                ApplicationLog.WriteLine(string.Format((IFormatProvider)null,
                    "Blast BVT: Hits count '{0}'.", blastResults.Count));
                ApplicationLog.WriteLine(string.Format((IFormatProvider)null,
                    "Blast BVT: Accession '{0}'.", hit.Accession));
                ApplicationLog.WriteLine(string.Format((IFormatProvider)null, "Blast BVT: Hit Id '{0}'.", hit.Id));
                ApplicationLog.WriteLine(string.Format((IFormatProvider)null,
                    "Blast BVT: Hits Count '{0}'.", hit.Hsps.Count));
            }
            // Validate the results Synchronously with the results got earlier.
            if (isFetchSynchronous)
            {
                IList<BlastResult> syncBlastResults =
                    service.FetchResultsSync(reqId, searchParams) as List<BlastResult>;
                Assert.IsNotNull(syncBlastResults);
                if (null != blastResults[0].Records[0].Hits
                    && 0 < blastResults[0].Records[0].Hits.Count
                    && null != blastResults[0].Records[0].Hits[0].Hsps
                    && 0 < blastResults[0].Records[0].Hits[0].Hsps.Count)
                {
                    Assert.AreEqual(blastResults[0].Records[0].Hits[0].Hsps[0].QuerySequence,
                        syncBlastResults[0].Records[0].Hits[0].Hsps[0].QuerySequence);
                }
                else
                {
                    ApplicationLog.WriteLine("No significant hits found with the these parameters.");
                }
            }
        }
Пример #6
0
        /// <summary>
        /// Validate general SubmitSearchRequest method test cases 
        /// with the different parameters specified.
        /// <param name="nodeName">xml node name.</param>
        /// <param name="expectParameter">Expected parameter</param>
        /// <param name="compositionBasedStaticParameter">Composition based static parameter</param>
        /// </summary>
        void ValidateSubmitSearchMethod(string nodeName,
            string expectParameter, string compositionBasedStaticParameter)
        {
            // Gets the search query parameter and their values.
            string querySequence = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.QuerySequency);
            string queryDatabaseValue = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.DatabaseValue);
            string queryProgramValue = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.ProgramValue);
            string queryDatabaseParameter = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.DatabaseParameter);
            string queryProgramParameter = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.ProgramParameter);
            string alphabetName = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.AlphabetNameNode);
            string optionalExpectParameter = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.BlastExpectParameter);
            string optionalExpectValue = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.BlastExpectparameterValue);
            string optionalCBSParameter = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.BlastCompositionBasedStaticsParameter);
            string optionalCBSParameterValue = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.BlastCompositionBasedStaticsValue);
            string reqId = string.Empty;

            // Create a sequence.
            Sequence seq = new Sequence(Utility.GetAlphabet(alphabetName),
                querySequence);

            // Set Service confiruration parameters true.
            IBlastServiceHandler blastService = null;
            try
            {
                blastService = new NCBIBlastHandler();
                ConfigParameters configParameters = new ConfigParameters();
                configParameters.UseBrowserProxy = true;
                blastService.Configuration = configParameters;

                // Create search parameters object.
                BlastParameters queryParams = new BlastParameters();

                // Add parameter values to search query parameters.
                if ((0 == string.Compare(expectParameter, null, true,
                    CultureInfo.CurrentCulture))
                    && (0 == string.Compare(compositionBasedStaticParameter, null, true,
                    CultureInfo.CurrentCulture)))
                {
                    queryParams.Add(queryDatabaseParameter, queryDatabaseValue);
                    queryParams.Add(queryProgramParameter, queryProgramValue);
                }
                else
                {
                    queryParams.Add(queryDatabaseParameter, queryDatabaseValue);
                    queryParams.Add(queryProgramParameter, queryProgramValue);
                    queryParams.Add(optionalExpectParameter, optionalExpectValue);
                    queryParams.Add(optionalCBSParameter, optionalCBSParameterValue);
                }

                // Submit search request with valid parameter.
                reqId = blastService.SubmitRequest(seq, queryParams);

                // Validate request identifier returned by web service.
                Assert.IsNotNull(reqId);

                // Logs to the VSTest GUI (ApplicationLog.Out) window
                ApplicationLog.WriteLine(string.Format((IFormatProvider)null,
                    "Blast P1: Validation of SubmitSearchRequest() method was completed successfully."));
                ApplicationLog.WriteLine(string.Format((IFormatProvider)null,
                    "Blast P1: Request Id {0} is as expected.", reqId));
            }
            finally
            {
                if (blastService != null)
                    ((IDisposable)blastService).Dispose();
            }
        }
Пример #7
0
        public void ValidateNcbiSubmitSearchRequestForQueryList()
        {
            string nodeName = Constants.EmRelDatabaseParametersNode;

            // Gets the search query parameter and their values.
            string querySequence = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.QuerySequency);
            string queryDatabaseValue = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.DatabaseValue);
            string queryProgramValue = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.ProgramValue);
            string queryDatabaseParameter = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.DatabaseParameter);
            string queryProgramParameter = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.ProgramParameter);
            string alphabetName = utilityObj.xmlUtil.GetTextValue(
                nodeName, Constants.AlphabetNameNode);

            // Create a sequence.
            IList<ISequence> seqList = new List<ISequence>();
            Sequence seq = new Sequence(Utility.GetAlphabet(alphabetName), querySequence);
            seqList.Add(seq);

            // Set Service confiruration parameters true.
            IBlastServiceHandler NcbiBlastService = null;
            try
            {
                NcbiBlastService = new NCBIBlastHandler();
                ConfigParameters configParameters = new ConfigParameters();
                configParameters.UseBrowserProxy = true;
                NcbiBlastService.Configuration = configParameters;

                // Create search parameters object.
                BlastParameters NcbiParams = new BlastParameters();

                // Add parameter values to search query parameters.
                NcbiParams.Add(queryDatabaseParameter, queryDatabaseValue);
                NcbiParams.Add(queryProgramParameter, queryProgramValue);

                // Get Request identifier from web service for SeqList.
                // Automated this case to hit the Code.

                NcbiBlastService.SubmitRequest(seqList, NcbiParams);
            }
            catch (NotImplementedException)
            {
                ApplicationLog.WriteLine(string.Format((IFormatProvider)null,
                    "Ncbi Blast P1 : Validated the exception successfully."));
            }
            finally
            {
                if (NcbiBlastService != null)
                    ((IDisposable)NcbiBlastService).Dispose();
            }
        }
Пример #8
0
        /// <summary>
        /// A helper method for the BLAST task. Submits a job to BLAST.
        /// </summary>
        /// <param name="qp"></param>
        /// <returns></returns>
        private BlastJob submit(QueueSequence qp)
        {
            // Configure BLAST service
            ConfigParameters configParams = new ConfigParameters();
            configParams.UseBrowserProxy = Up.BlastUseBrowserProxy;
            BlastParameters searchParams = new BlastParameters();

            string query = ">" + qp.Sequence.DisplayID + "\n" + qp.Sequence.ToString();
            
            searchParams.Add("Program", Up.BlastProgram);
            searchParams.Add("Database", Up.BlastDatabase);
            searchParams.Add("GeneticCode", Up.BlastGeneticCode);
            searchParams.Add("Expect", "10");
            searchParams.Add("Query", query);


            // Create BLAST service
            NCBIBlastHandler blastService = new NCBIBlastHandler();
            
            blastService.Configuration = configParams;

            // Submit BLAST Job
            string jobId;
            
            try
            {
                jobId = blastService.SubmitRequest(qp.Sequence, searchParams);
            }
            catch(Exception eee)
            {
                if (eee.Message.Contains("WebException"))
                {
                    ToggleProxy();
                }
                BlastJob blastJob2 = new BlastJob();
                blastJob2.JobStatus = BlastJob.FAILED;
                blastJob2.Query = qp.Sequence;
                blastJob2.Position = qp.Position;
                return blastJob2;
            }
            // Make sure job was submitted successfully
            ServiceRequestInformation info = blastService.GetRequestStatus(jobId);

            if (info.Status != ServiceRequestStatus.Waiting
                && info.Status != ServiceRequestStatus.Ready
                && info.Status != ServiceRequestStatus.Queued)
            {
                //Console.WriteLine("\tError Submitting Job: " + info.Status);
                BlastJob blastJob2 = new BlastJob();
                blastJob2.JobStatus = BlastJob.FAILED;
                blastJob2.Query = qp.Sequence;
                blastJob2.Position = qp.Position;
                return blastJob2;
            }

            Thread.Sleep(BlastQueue.SubmitDelay);
            //Console.WriteLine("\tSuccessfully submitted jobId: " + jobId);
            // Return a BlastJob, set jobStatus to BUSY
            BlastJob blastJob = new BlastJob()
            {
                JobId = jobId,
                SearchParams = searchParams,
                ConfigParams = configParams,
                BlastService = blastService,
                JobStatus = BlastJob.BUSY,
                Query = qp.Sequence,
                Position = qp.Position

            };
            return blastJob;
        }