Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sequence type parameter required #28

Open
TayyabaQamar opened this issue Apr 11, 2017 · 0 comments
Open

Sequence type parameter required #28

TayyabaQamar opened this issue Apr 11, 2017 · 0 comments

Comments

@TayyabaQamar
Copy link

// [2] Prepare data
string seq = @"GACGCCGCCGCCACCACCGCCACCGCCGCAGCAGAAGCAGCGCACCGCAGGAGGGAAG";
seq.ToString();
Sequence sequence = new Sequence(Alphabets.DNA, seq);

        // [3] Create and configure service handler
        EbiWuBlastHandler blastService = new EbiWuBlastHandler();
       // NCBIBlastHandler blastService = new NCBIBlastHandler();

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

        // [4] Define query.
        BlastParameters searchParams = new BlastParameters();
        searchParams.Add("Program", "blastn");

        searchParams.Add("Database", "em_rel");
        searchParams.Add("Expect", "1e-10");
        //searchParams.Add("Email", "YourAddress@YourInstitution");

        // [5] create and submit request
        string jobID;
        try
        {
            jobID = blastService.SubmitRequest(sequence, searchParams);
        }
        catch (Exception ex)
        {
            Console.WriteLine("Service is not available.");
            Console.WriteLine(ex);
            return;
        }

        // [6] Wait for Ready status
        ServiceRequestInformation info = blastService.GetRequestStatus(jobID);

        if (info.Status != ServiceRequestStatus.Waiting
               && info.Status != ServiceRequestStatus.Ready)
        {
            Console.WriteLine("Service is not ready or waiting.");
            return;
        }

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

        // [7] Get results
        IList<BlastResult> results2 =
              blastService.FetchResultsSync(jobID, searchParams) as List<BlastResult>;

I'm running this code mentioned in MBF programming guide but it is giving me an error that sequence type parameter is required: Service not available

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant