Ncbi Blast Parameters

Sep 5, 2014 at 1:40 AM
How I can use the parameter n u m _ a l i g n m e n t s in BlastParameters on .NETBio?

Best,
Coordinator
Sep 5, 2014 at 5:27 AM
Welcome.
The BlastParameters class stores the params as a dictionary. There is a method called Add which should allow you to deal with it:

public void Add(
string parameterName,
string parameterValue
)

You will find some use of this in the cookbook example here: https://bio.codeplex.com/wikipage?title=execute_ncbi_blast&referringTitle=.NET%20Bio%20Cookbook
or in more detail in part 7 of the training material (downloadable here: https://bio.codeplex.com/wikipage?title=Training&referringTitle=Documentation&ANCHOR#home )

cheers
jh
Sep 5, 2014 at 10:54 AM
Hi jh,

I not found more parameter in https://bio.codeplex.com/SourceControl/latest#bio/Source/Framework/Bio.WebServices/Blast/BlastRequestParameters.cs , how I can see params as a dictionary.
I have this code:

ISequence sequence = new Sequence(alph, rawData, false);
        BlastParameters blastParameters = new BlastParameters();
        blastParameters.Add("Database", databaseText.Text);
        blastParameters.Add("Program", programText.Text);
        blastParameters.Add("Expect", "0.000001");
        blastParameters.Add("Filter", "F");
       // blastParameters.Add("Max", "20"); ???
Thanks, Best,
Coordinator
Sep 5, 2014 at 5:16 PM
I'm not sure what you mean - every BLAST service has slightly different parameters, and the requirements are generally also different. So it's a free-form dictionary which allows you to add key + value just as you are doing. These are passed as-is to the service, so you need to verify what each parameter format should be prior to calling it.

What are you wanting to do?

Thanks,
mark
Sep 5, 2014 at 5:59 PM
Hi Mark,

I need parameter for limiting the number of alignments returned (Max target sequences).

blastParameters.Add("Max_target", "20"); ?????

Thanks,
Coordinator
Sep 5, 2014 at 6:40 PM
From this:
http://www.ncbi.nlm.nih.gov/blast/Doc/urlapi.html

I think you want:

blastParameters.Add("ALIGNMENTS", "20");

By the way, it appears you are using the older .NET Bio toolkit support for BLAST, the V2 code looks slightly different - it's what Jim referenced in his original answer. It's fine, but I just wanted to point that out.

mark
Sep 5, 2014 at 7:49 PM
Thanks Mark,

Now worked!!!

Best!