Skip to content

Commit

Permalink
Merge pull request #3 from jakobnissen/tblastx
Browse files Browse the repository at this point in the history
Add tblastx
  • Loading branch information
kescobo authored Oct 9, 2024
2 parents 432176e + 4b752f8 commit 90a65f8
Showing 1 changed file with 61 additions and 4 deletions.
65 changes: 61 additions & 4 deletions src/NCBIBlast.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,22 @@ export blastn,
blastp,
blastx,
tblastn,
tblastx,
makeblastdb

using CondaPkg

function add_cli_kwargs!(cmd, kwargs)
function add_cli_kwargs!(cmd::Vector{String}, kwargs)
for (key,val) in pairs(kwargs)
if val isa Bool
val && push!(cmd, string("-", key))
elseif val isa AbstractVector
append!(cmd, [string("-", key), string.(val)...])
else
append!(cmd, [string("-", key), string(val)])
push!(cmd, string("-", key))
if val isa AbstractVector
append!(cmd, map(string, val))
else
push!(cmd, string(val))
end
end
end

Expand Down Expand Up @@ -261,6 +265,59 @@ function tblastn(stdin = nothing; stdout=stdout, kwargs...)
end
end

"""
tblastx([input]; stdout, kwargs...)
Run `tblastx` with passed kwargs.
Use `arg=true` to pass flags
(eg `lcase_masking=true` will pass `-lcase_masking`).
Optionally, provide an input that will be provided
as `stdin` (a file string, or `IO` type).
To print results to somewhere other than `stdout`,
use eg `stdout="results.txt"`.
```julia
julia> tblastx(; h=true)
USAGE
tblastx [-h] [-help] [-import_search_strategy filename]
[-export_search_strategy filename] [-db database_name]
[-dbsize num_letters] [-gilist filename] [-seqidlist filename]
[-negative_gilist filename] [-negative_seqidlist filename]
[-taxids taxids] [-negative_taxids taxids] [-taxidlist filename]
[-negative_taxidlist filename] [-no_taxid_expansion]
[-entrez_query entrez_query] [-db_soft_mask filtering_algorithm]
[-db_hard_mask filtering_algorithm] [-subject subject_input_file]
[-subject_loc range] [-query input_file] [-out output_file]
[-evalue evalue] [-word_size int_value] [-qcov_hsp_perc float_value]
[-max_hsps int_value] [-xdrop_ungap float_value] [-searchsp int_value]
[-sum_stats bool_value] [-max_intron_length length] [-seg SEG_options]
[-soft_masking soft_masking] [-matrix matrix_name]
[-threshold float_value] [-culling_limit int_value]
[-best_hit_overhang float_value] [-best_hit_score_edge float_value]
[-subject_besthit] [-window_size int_value] [-lcase_masking]
[-query_loc range] [-strand strand] [-parse_deflines]
[-query_gencode int_value] [-db_gencode int_value] [-outfmt format]
[-show_gis] [-num_descriptions int_value] [-num_alignments int_value]
[-line_length line_length] [-html] [-sorthits sort_hits]
[-sorthsps sort_hsps] [-max_target_seqs num_sequences]
[-num_threads int_value] [-remote] [-version]
DESCRIPTION
Translated Query-Translated Subject BLAST 2.16.0+
Use '-help' to print detailed descriptions of command line arguments
```
"""
function tblastx(stdin = nothing; stdout=stdout, kwargs...)
cmd = ["tblastx"]
add_cli_kwargs!(cmd, kwargs)
CondaPkg.withenv() do
run(pipeline(Cmd(cmd); stdout, stdin))
end
end


"""
makeblastdb(; kwargs...)
Expand Down

2 comments on commit 90a65f8

@kescobo
Copy link
Member Author

@kescobo kescobo commented on 90a65f8 Oct 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/116900

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.0 -m "<description of version>" 90a65f820322e22a028fc34028a3befc718af93e
git push origin v0.1.0

Please sign in to comment.