Skip to content

Commit

Permalink
nicer function signature for webblast()
Browse files Browse the repository at this point in the history
  • Loading branch information
hng committed Mar 31, 2015
1 parent 02d89fb commit a3734c9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
13 changes: 7 additions & 6 deletions docs/webblast.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
# WebBLAST

API for Julia to call the BLAST Web API of NCBI and EBI.
API for Julia to call the BLAST Web API of [NCBI](http://blast.ncbi.nlm.nih.gov/Blast.cgi?CMD=Web&PAGE_TYPE=BlastHome).

## Exported functions

#### webblast

```julia
webblast(provider::String, sequence::String, threshold::Float64, cached=false)
webblast(sequence::String, threshold::Float64=0.005, provider::Symbol=:ncbi, cached=false)
```

Calls the the API of the given provider to search for a protein sequence and returns all hits within a E-Value threshold.

**provider** A provider for a BLAST REST API, e.g. NCBI/EBI BLAST. Default "ncbi" (EBI to be implemented), "ncbi" searches for the sequence in the PDB.

**sequence** The sequence to search for.

**cached** Default ```false```, results can be cached, for example during development.
**threshhold** threshold for the E-value of hits to be returned. Default is 0.005.

**provider** A provider for a BLAST REST API, e.g. NCBI/EBI BLAST. Default ``:ncbi` (EBI to be implemented), "ncbi" searches for the sequence in the PDB.

**cached** Default ```false```, results can be cached, for example during development.
4 changes: 2 additions & 2 deletions src/WebBLAST/WebBLAST.jl
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ module WebBLAST

#main()

function webblast(provider::String, sequence::String, threshold::Float64, cached=false)
function webblast(sequence::String, threshold::Float64=0.005, provider::Symbol=:ncbi, cached=false)
info("Searching for sequence: $(sequence)")

# try to use cached version
Expand All @@ -117,7 +117,7 @@ module WebBLAST
end


if provider == "ncbi"
if provider == :ncbi
rid, rtoe = ncbi_blast_put(sequence)
info("NCBI rid: $(rid)")
if ncbi_blast_search_info(rid)
Expand Down
4 changes: 2 additions & 2 deletions src/pipeline.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ FLFLIKHNPTNTIVYFGRYWSP"
threshold = 0.005


results = webblast("ncbi", seq, threshold, true)
results = webblast(seq, threshold, :ncbi, true)


# PDB IDs and Chain IDs
Expand Down Expand Up @@ -58,4 +58,4 @@ end
for struc in structures
m = structure_to_matrix(struc)
println(size(m))
end
end

0 comments on commit a3734c9

Please sign in to comment.