Mercurial > repos > devteam > ncbi_blast_plus
view tools/ncbi_blast_plus/ncbi_makeblastdb.xml @ 13:623f727cdff1 draft
Uploaded v0.1.00, uses BLAST+ 2.2.29, allows custom column selection for tabular output - including taxonomy fields.
author | peterjc |
---|---|
date | Fri, 14 Mar 2014 07:40:46 -0400 |
parents | 4c4a0da938ff |
children | 2fe07f50a41e |
line wrap: on
line source
<tool id="ncbi_makeblastdb" name="NCBI BLAST+ makeblastdb" version="0.1.00"> <description>Make BLAST database</description> <macros> <token name="@BINARY@">makeblastdb</token> <import>ncbi_macros.xml</import> </macros> <expand macro="requirements" /> <command interpreter="python">check_no_duplicates.py ##First check for duplicates (since BLAST+ 2.2.28 fails to do so) ##and abort (via the ampersand ampersand trick) if any are found. #for i in $input_file#"${i}" #end for# && makeblastdb -out "${os.path.join($outfile.extra_files_path,'blastdb')}" $parse_seqids $hash_index ## Single call to -in with multiple filenames space separated with outer quotes ## (presumably any filenames with spaces would be a problem). Note this gives ## some extra spaces, e.g. -in "file1 file2 file3 " but BLAST seems happy: -in "#for i in $input_file#${i} #end for#" #if $title: -title "$title" #else: ##Would default to being based on the cryptic Galaxy filenames, which is unhelpful -title "BLAST Database" #end if -dbtype $dbtype ## -------------------------------------------------------------------- ## Masking ## -------------------------------------------------------------------- ## HACK: If no mask files, evaluates as a list with just None in it: ## See Trello issue https://trello.com/c/lp5YmA1O #if ' '.join( map(str, $mask_data_file) ) != 'None': #for i in $mask_data_file: -mask_data "${i}" #end for #end if ## -------------------------------------------------------------------- ## Taxonomy ## -------------------------------------------------------------------- #if $tax.taxselect == 'id': -taxid $tax.taxid ## TODO - Can we use a tabular file for the taxonomy mapping? ## #else if $tax.taxselect == 'map': ## -taxid_map $tax.taxmap #end if ## -------------------------------------------------------------------- ## Capture the stdout log information to the primary file (plain text): > "$outfile" </command> <expand macro="stdio" /> <inputs> <param name="dbtype" type="select" display="radio" label="Molecule type of input"> <option value="prot">protein</option> <option value="nucl">nucleotide</option> </param> <!-- TODO Allow merging of existing BLAST databases (conditional on the database type)? NOTE Double check the new database would be self contained first --> <!-- Note this is a mandatory parameter - default should be most recent FASTA file --> <param name="input_file" type="data" multiple="true" optional="false" format="fasta" label="Input FASTA files(s)" help="One or more FASTA files" /> <param name="title" type="text" value="" label="Title for BLAST database" help="This is the database name shown in BLAST search output" /> <param name="parse_seqids" type="boolean" truevalue="-parse_seqids" falsevalue="" checked="False" label="Parse the sequence identifiers" help="This is only advised if your FASTA file follows the NCBI naming conventions using pipe '|' symbols" /> <param name="hash_index" type="boolean" truevalue="-hash_index" falsevalue="" checked="true" label="Enable the creation of sequence hash values" help="These hash values can then be used to quickly determine if a given sequence data exists in this BLAST database." /> <!-- SEQUENCE MASKING OPTIONS --> <!-- Note this is an optional parameter - default should be NO files --> <param name="mask_data_file" type="data" multiple="true" optional="true" value="" format="maskinfo-asn1,maskinfo-asn1-binary" label="Optional ASN.1 file(s) containing masking data" help="As produced by NCBI masking applications (e.g. dustmasker, segmasker, windowmasker)" /> <!-- TODO - Option to create GI indexed masking data? via -gi_mask and -gi_mask_name? --> <!-- TAXONOMY OPTIONS --> <conditional name="tax"> <param name="taxselect" type="select" label="Taxonomy options"> <option value="">Do not assign a Taxonomy ID to the sequences</option> <option value="id">Assign the same Taxonomy ID to all the sequences</option> <!-- <option value="map">Supply text file mapping sequence IDs to taxnomy IDs</option> --> </param> <when value=""> </when> <when value="id"> <param name="taxid" type="integer" value="" label="NCBI taxonomy ID" help="Integer >=0, e.g. 9606 for Homo sapiens" min="0" /> </when> <!-- TODO: File format? <when value="map"> <param name="taxmap" type="data" format="txt" label="Seq ID : Tax ID mapping file" help="Format: SequenceId TaxonomyId" /> </when> --> </conditional> </inputs> <outputs> <!-- If we only accepted one FASTA file, we could use its human name here... --> <data name="outfile" format="data" label="${dbtype.value_label} BLAST database from ${on_string}"> <change_format> <when input="dbtype" value="nucl" format="blastdbn" /> <when input="dbtype" value="prot" format="blastdbp" /> </change_format> </data> </outputs> <tests> <!-- Note the (two line) PIN file is not reproducible run to run. Likewise there is a datestamp in the log file as well, so use contains comparison With and without the masking makes no difference. With and without the taxid the only real difference is in the *.phr file. --> <test> <param name="dbtype" value="prot" /> <param name="input_file" value="four_human_proteins.fasta" ftype="fasta" /> <param name="title" value="Just 4 human proteins" /> <param name="parse_seqids" value="" /> <param name="hash_index" value="true" /> <output name="out_file" compare="contains" file="four_human_proteins.fasta.log.txt" ftype="blastdbp"> <extra_files type="file" value="four_human_proteins.fasta.phr" name="blastdb.phr" /> <extra_files type="file" value="four_human_proteins.fasta.pin" name="blastdb.pin" lines_diff="2" /> <extra_files type="file" value="four_human_proteins.fasta.psq" name="blastdb.psq" /> <extra_files type="file" value="four_human_proteins.fasta.pog" name="blastdb.pog" /> <extra_files type="file" value="four_human_proteins.fasta.phd" name="blastdb.phd" /> <extra_files type="file" value="four_human_proteins.fasta.phi" name="blastdb.phi" /> <extra_files type="file" value="four_human_proteins.fasta.psd" name="blastdb.psd" /> <extra_files type="file" value="four_human_proteins.fasta.psi" name="blastdb.psi" /> </output> </test> <test> <param name="dbtype" value="prot" /> <param name="input_file" value="four_human_proteins.fasta" ftype="fasta" /> <param name="title" value="Just 4 human proteins" /> <param name="parse_seqids" value="" /> <param name="hash_index" value="true" /> <param name="taxselect" value="id" /> <param name="taxid" value="9606" /> <output name="out_file" compare="contains" file="four_human_proteins_taxid.fasta.log.txt" ftype="blastdbp"> <extra_files type="file" value="four_human_proteins_taxid.fasta.phr" name="blastdb.phr" /> <extra_files type="file" value="four_human_proteins_taxid.fasta.pin" name="blastdb.pin" lines_diff="2" /> <extra_files type="file" value="four_human_proteins_taxid.fasta.psq" name="blastdb.psq" /> <extra_files type="file" value="four_human_proteins_taxid.fasta.pog" name="blastdb.pog" /> <extra_files type="file" value="four_human_proteins_taxid.fasta.phd" name="blastdb.phd" /> <extra_files type="file" value="four_human_proteins_taxid.fasta.phi" name="blastdb.phi" /> <extra_files type="file" value="four_human_proteins_taxid.fasta.psd" name="blastdb.psd" /> <extra_files type="file" value="four_human_proteins_taxid.fasta.psi" name="blastdb.psi" /> </output> </test> <test> <param name="dbtype" value="prot" /> <param name="input_file" value="four_human_proteins.fasta" ftype="fasta" /> <param name="title" value="Just 4 human proteins" /> <param name="parse_seqids" value="" /> <param name="hash_index" value="true" /> <param name="mask_data_file" value="segmasker_four_human.maskinfo-asn1" ftype="maskinfo-asn1" /> <output name="out_file" compare="contains" file="four_human_proteins.fasta.log.txt" ftype="blastdbp"> <extra_files type="file" value="four_human_proteins.fasta.phr" name="blastdb.phr" /> <extra_files type="file" value="four_human_proteins.fasta.pin" name="blastdb.pin" lines_diff="2" /> <extra_files type="file" value="four_human_proteins.fasta.psq" name="blastdb.psq" /> <extra_files type="file" value="four_human_proteins.fasta.pog" name="blastdb.pog" /> <extra_files type="file" value="four_human_proteins.fasta.phd" name="blastdb.phd" /> <extra_files type="file" value="four_human_proteins.fasta.phi" name="blastdb.phi" /> <extra_files type="file" value="four_human_proteins.fasta.psd" name="blastdb.psd" /> <extra_files type="file" value="four_human_proteins.fasta.psi" name="blastdb.psi" /> </output> </test> </tests> <help> **What it does** Make BLAST database from one or more FASTA files and/or BLAST databases. This is a wrapper for the NCBI BLAST+ tool 'makeblastdb', which is the replacement for the 'formatdb' tool in the NCBI 'legacy' BLAST suite. <!-- Applying masks to an existing BLAST database will not change the original database; a new database will be created. For this reason, it's best to apply all masks at once to minimize the number of unnecessary intermediate databases. --> **Documentation** http://www.ncbi.nlm.nih.gov/books/NBK1763/ **References** If you use this Galaxy tool in work leading to a scientific publication please cite the following papers: @REFERENCES@ </help> </tool>