NCBI Blast API 的调用

由 admin 发布


在NCIBI的Develop版块中,含有官方的APIs调用方法,包括了Entrez Programming Utilities (E-utilities)、BLAST URL API、PubChem Power User Gateway (PUG)、PubMed Central (PMC) APIs。



NCBI Blast API调用的官网文档


ParameterDefinitionTypeCMDAllowed values
QUERYSearch queryStringPut *Accession, GI, or FASTA.
DATABASEBLAST databaseStringPut *Database from appendix 2 or one uploaded to blastdb_custom (see appendix 4)
PROGRAMBLAST programStringPut *One of blastn, blastp, blastx, tblastn, tblastx. To enable megablast, use PROGRAM=blastn&MEGABLAST=on.
FILTERLow complexity filteringStringPutF to disable. T or L to enable. Prepend “m” for mask at lookup (e.g., mL)
FORMAT_TYPEReport typeStringPut, GetHTML, Text, XML, XML2, JSON2, or Tabular. HTML is the default.
EXPECTExpect valueDoublePutNumber greater than zero.
NUCL_REWARDReward for matching bases (BLASTN and megaBLAST)IntegerPutInteger greater than zero.
NUCL_PENALTYCost for mismatched bases (BLASTN and megaBLAST)IntegerPutInteger less than zero.
GAPCOSTSGap existence and extension costsStringPutPair of positive integers separated by a space such as “11 1”.
MATRIXScoring matrix nameStringPutOne of BLOSUM45, BLOSUM50, BLOSUM62, BLOSUM80, BLOSUM90, PAM250, PAM30 or PAM70. Default: BLOSUM62 for all applicable programs
HITLIST_SIZENumber of databases sequences to keepIntegerPut,GetInteger greater than zero.
DESCRIPTIONSNumber of descriptions to print (applies to HTML and Text)IntegerPut,GetInteger greater than zero.
ALIGNMENTSNumber of alignments to print (applies to HTML and Text)IntegerPut,GetInteger greater than zero.
NCBI_GIShow NCBI GIs in reportStringPut, GetT or F
RIDBLAST search request identifierStringGet , Delete The Request ID (RID) returned when the search was submitted
THRESHOLDNeighboring score for initial wordsIntegerPutPositive integer (BLASTP default is 11). Does not apply to BLASTN or MegaBLAST).
WORD_SIZESize of word for initial matchesIntegerPutPositive integer.
COMPOSITION_BASED_STATISTICSComposition based statistics algorithm to useIntegerPutOne of 0, 1, 2, or 3. See comp_based_stats command line option in the BLAST+ user manual for details.
FORMAT_OBJECTObject typeStringGetSearchInfo (status check) or Alignment (report formatting).
NUM_THREADSNumber of virtual CPUs to useIntegerPutInteger greater than zero and less than the maximum number of cores on the instance (default is the maximum number of cores on the instance). Supported only on the cloud



import requests

    'PROGRAM':program,  #比如 blastp,blastn等