Hi, Peter,

You are right, I thought there was already a datatype defined for PSSM, but
it turned out there isn't one yet. I attached a draft tool configuration
file for psiblast, it was based on the blastp configuration file, please
revise as you like.

The options that are specific to psiblast are the following:
1. num_iterations
2. pseudocount
3. inclusion_ethresh

Other options should be the same as the blastp program. So a typical
command line would be the same as blastp except adding above options if
non-default values are used. I can see there are two optional output files,
one is the PSSM and the other is ASCII PSSM. Besides using a typical query
input, psiblast can take a PSSM file or a multiple sequence alignment file
as the input.

Luobin

On Tue, Feb 5, 2013 at 4:53 AM, Peter Cock <p.j.a.c...@googlemail.com>wrote:

> On Mon, Feb 4, 2013 at 7:32 PM, Peter Cock <p.j.a.c...@googlemail.com>
> wrote:
> >
> >
> > On Monday, February 4, 2013, Luobin Yang wrote:
> >>
> >> Hi, Peter,
> >>
> >> Thanks for pointing them out!
> >>
> >> The phi-blast and psi-blast actually share the same binary, both use the
> >> psiblast program in the NCBI BLAST+ tools. When the option -phi_pattern
> is
> >> used, then it does phi-blast searching.
> >>
> >> Best,
> >> Luobin
> >>
> >>
> >
> > Could you give a few command line examples of how you typically use
> > psiblast,  focussing in the main options only?
> >
> > I would find that helpful when putting together a new wrapper - since
> > including all the options right away is overwhelming.
> >
> > Thanks,
> >
> > Peter
>
> I suspect we would also need to define another datatype for the PSSM
> pattern files. That makes things more complicated.
>
> Peter
>
<tool id="ncbi_psiblast_wrapper" name="NCBI BLAST+ psiblast" version="0.0.15">
    <description>Search protein database with protein query sequence(s)</description>
    <!-- If job splitting is enabled, break up the query file into parts -->
    <parallelism method="multi" split_inputs="query" split_mode="to_size" split_size="1000" shared_inputs="subject,histdb" merge_outputs="output1"></parallelism>
    <version_command>psiblast -version</version_command>
    <command>
## The command is a Cheetah template which allows some Python based syntax.
## Lines starting hash hash are comments. Galaxy will turn newlines into spaces
psiblast
#if str($input_opts.input_opts_selector) == "query"
-query "$query"
#else if str($input_opts.input_opts_selector) == "pssm"
-in_pssm "$in_pssm"
#else if str($input_opts.input_opts_selector) == "msa"
-in_msa "$in_msa"
#end if

#if $db_opts.db_opts_selector == "db":
  -db "${db_opts.database.fields.path}"
#elif $db_opts.db_opts_selector == "histdb":
  -db "${os.path.join($db_opts.histdb.extra_files_path,'blastdb')}"
#else:
  -subject "$db_opts.subject"
#end if

-evalue $evalue_cutoff
-out $output1

##Set the extended list here so if/when we add things, saved workflows are not affected
#if str($out_format)=="ext":
    -outfmt "6 std sallseqid score nident positive gaps ppos qframe sframe qseq sseq qlen slen"
#else:
    -outfmt $out_format
#end if

-num_threads 8

#if $adv_opts.adv_opts_selector=="advanced":
$adv_opts.filter_query
-matrix $adv_opts.matrix
## Need int(str(...)) because $adv_opts.max_hits is an InputValueWrapper object not a string
## Note -max_target_seqs overrides -num_descriptions and -num_alignments
#if (str($adv_opts.max_hits) and int(str($adv_opts.max_hits)) > 0):
-max_target_seqs $adv_opts.max_hits
#end if
#if (str($adv_opts.word_size) and int(str($adv_opts.word_size)) > 0):
-word_size $adv_opts.word_size
#end if
##Ungapped disabled for now - see comments below
##$adv_opts.ungapped
$adv_opts.parse_deflines
## End of advanced options:
#end if

#if $psiblast_opts.psiblast_opts_selector=="advanced"
-num_iterations $psiblast_opts.num_iterations
-pseudocount $psiblast_opts.pseudocount
-inclusion_ethresh $psiblast_opts.inclusion_ethresh
#end if

#if $pssm_output_condition.pssm_output_selector == "yes" 
-out_pssm $pssm_output
#end if

#if $pssm_ascii_output_condition.pssm_ascii_output_selector == "yes" 
-out_ascii_pssm $pssm_ascii_output
#end if

    </command>
    <stdio>
        <!-- Anything other than zero is an error -->
        <exit_code range="1:" />
        <exit_code range=":-1" />
        <!-- In case the return code has not been set propery check stderr too -->
        <regex match="Error:" />
        <regex match="EXception:" />
    </stdio>
    <inputs>
        <conditional name="input_opts">
            <param name="input_opts_selector" type="select" label="Select the input file type">
                <option value="query" selected="true">Query</option>
                <option value="msa">Multiple Sequence Alignment file</option>
                <option value="pssm">PSI-BLAST checkpoint file</option>
            </param>
            <when value="query">
                <param name="query" type="data" format="fasta" label="Protein query sequence(s)"/> 
            </when>
            <when value="msa">
                <param name="in_msa" type="data" format="msa,phylip" label="Multiple Sequence Alignment File" />
            </when>
            <when value="pssm">
                <param name="in_pssm" type="data" format="pssm" label="PSI-BLAST checkpoint file" />
            </when>
        </conditional>

        <conditional name="db_opts">
            <param name="db_opts_selector" type="select" label="Subject database/sequences">
              <option value="db" selected="True">BLAST Database</option>
              <option value="histdb">BLAST database from your history</option>
              <option value="file">FASTA file from your history (see warning note below)</option>
            </param>
            <when value="db">
                <param name="database" type="select" label="Protein BLAST database">
                    <options from_file="blastdb_p.loc">
                      <column name="value" index="0"/>
                      <column name="name" index="1"/>
                      <column name="path" index="2"/>
                    </options>
                </param>
                <param name="histdb" type="hidden" value="" />
                <param name="subject" type="hidden" value="" /> 
            </when>
            <when value="histdb">
                <param name="database" type="hidden" value="" />
                <param name="histdb" type="data" format="blastdbp" label="Protein BLAST database" />
                <param name="subject" type="hidden" value="" />
            </when>
            <when value="file">
                <param name="database" type="hidden" value="" /> 
                <param name="histdb" type="hidden" value="" />
                <param name="subject" type="data" format="fasta" label="Protein FASTA file to use as database"/> 
            </when>
        </conditional>
        
        <param name="evalue_cutoff" type="float" size="15" value="0.001" label="Set expectation value cutoff" />
        <param name="out_format" type="select" label="Output format">
            <option value="6" selected="True">Tabular (standard 12 columns)</option>
            <option value="ext">Tabular (extended 24 columns)</option>
            <option value="5">BLAST XML</option>
            <option value="0">Pairwise text</option>
            <option value="0 -html">Pairwise HTML</option>
            <option value="2">Query-anchored text</option>
            <option value="2 -html">Query-anchored HTML</option>
            <option value="4">Flat query-anchored text</option>
            <option value="4 -html">Flat query-anchored HTML</option>
            <!--
            <option value="-outfmt 11">BLAST archive format (ASN.1)</option>
            -->
        </param>
        <conditional name="psiblast_opts">
            <param name="psiblast_opts_selector" type="select" label="PSI-BLAST options">
                <option value="basic" selected="True">Hide PSI-BLAST Options</option>
                <option value="advanced">Show PSI-BLAST Options</option>
            </param>
            <when value="basic" />
            <when value="advanced">
               <param name="num_iterations" type="integer" label="Number of iterations to perform" value="1" />
               <param name="inclusion_ethresh" type="float" label="The statistical significance threshold to include a sequence" help="Set the statistical significant threshold to include a sequence in the model used by PSI-BLAST to create the PSSM on the next iteration." value="0.002" />
               <param name="pseudocount" type="integer" label="Pseudocount value used when constructing PSSM" value="0" help="If zero is specified, then the parameter is automatically determined through a minimum length description principle (PMID 19088134). A value of 30 is suggested in order to obtain the approximate behavior before the minimum length principle was implemented" /> 
            </when>
        </conditional>

        <conditional name="adv_opts">
            <param name="adv_opts_selector" type="select" label="Advanced Options">
              <option value="basic" selected="True">Hide Advanced Options</option>
              <option value="advanced">Show Advanced Options</option>
            </param>
            <when value="basic" />
            <when value="advanced">
                <!-- Could use a select (yes, no, other) where other allows setting 'window locut hicut' -->
                <param name="filter_query" type="boolean" label="Filter out low complexity regions (with SEG)" truevalue="-seg yes" falsevalue="-seg no" checked="false" />
                <param name="matrix" type="select" label="Scoring matrix">
                    <option value="BLOSUM90">BLOSUM90</option>
                    <option value="BLOSUM80">BLOSUM80</option>
                    <option value="BLOSUM62" selected="true">BLOSUM62 (default)</option>
                    <option value="BLOSUM50">BLOSUM50</option> 
                    <option value="BLOSUM45">BLOSUM45</option>
                    <option value="PAM250">PAM250</option>
                    <option value="PAM70">PAM70</option>
                    <option value="PAM30">PAM30</option>
                </param>
                <!-- Why doesn't optional override a validator? I want to accept an empty string OR a non-negative integer -->
                <param name="max_hits" type="integer" value="0" label="Maximum hits to show" help="Use zero for default limits">
                    <validator type="in_range" min="0" />
                </param>
                <!-- I'd like word_size to be optional, with minimum 2 for blastp -->
                <param name="word_size" type="integer" value="0" label="Word size for wordfinder algorithm" help="Use zero for default, otherwise minimum 2.">
                    <validator type="in_range" min="0" />
                </param>
                <!--
                Can't use '-ungapped' on its own, error back is:
                Composition-adjusted searched are not supported with an ungapped search, please add -comp_based_stats F or do a gapped search
                Tried using '-ungapped -comp_based_stats F' and blastp crashed with 'Attempt to access NULL pointer.'
                <param name="ungapped" type="boolean" label="Perform ungapped alignment only?" truevalue="-ungapped -comp_based_stats F" falsevalue="" checked="false" />
                -->
                <param name="parse_deflines" type="boolean" label="Should the query and subject defline(s) be parsed?" truevalue="-parse_deflines" falsevalue="" checked="false" help="This affects the formatting of the query/subject ID strings"/>
            </when>
        </conditional>

        <conditional name="pssm_output_condition">
            <param name="pssm_output_selector" type="select" label="Generate PSSM output?" >
                <option value="yes">Yes</option>
                <option value="no" selected="true">No</option>
            </param>
        </conditional>

        <conditional name="pssm_ascii_output_condition">
            <param name="pssm_ascii_output_selector" type="select" label="Generate PSSM text output?" >
                <option value="yes">Yes</option>
                <option value="no" selected="true">No</option> 
            </param>
        </conditional>

    </inputs>
    <outputs>
        <data name="output1" format="tabular" label="psiblast on ${db_opts.db_opts_selector} on ${on_string}">
            <change_format>
                <when input="out_format" value="0" format="txt"/>
                <when input="out_format" value="0 -html" format="html"/>
                <when input="out_format" value="2" format="txt"/>
                <when input="out_format" value="2 -html" format="html"/>
                <when input="out_format" value="4" format="txt"/>
                <when input="out_format" value="4 -html" format="html"/>
                <when input="out_format" value="5" format="blastxml"/>
            </change_format>
        </data>

        <data name="pssm_ascii_output" format="txt" label="psiblast.pssm.txt" >
            <filter>pssm_ascii_output_condition['pssm_ascii_output_selector'] == "yes" </filter>
        </data>

        <data name="pssm_output" format="pssm" label="psiblast.pssm" >
            <filter>pssm_output_condition['pssm_output_selector'] == "yes"</filter>
        </data>

    </outputs>
    <requirements>
        <requirement type="binary">blastp</requirement>
    </requirements>
    <tests>
        <test>
            <param name="query" value="four_human_proteins.fasta" ftype="fasta" />
            <param name="db_opts_selector" value="file" />
            <param name="subject" value="rhodopsin_proteins.fasta" ftype="fasta" />
            <param name="database" value="" />
            <param name="evalue_cutoff" value="1e-8" />
            <param name="blast_type" value="blastp" />
            <param name="out_format" value="5" />
            <param name="adv_opts_selector" value="advanced" />
            <param name="filter_query" value="False" />
            <param name="matrix" value="BLOSUM62" />
            <param name="max_hits" value="0" />
            <param name="word_size" value="0" />
            <param name="parse_deflines" value="True" />
            <output name="output1" file="blastp_four_human_vs_rhodopsin.xml" ftype="blastxml" />
        </test>
        <test>
            <param name="query" value="four_human_proteins.fasta" ftype="fasta" />
            <param name="db_opts_selector" value="file" />
            <param name="subject" value="rhodopsin_proteins.fasta" ftype="fasta" />
            <param name="database" value="" />
            <param name="evalue_cutoff" value="1e-8" />
            <param name="blast_type" value="blastp" />
            <param name="out_format" value="6" />
            <param name="adv_opts_selector" value="advanced" />
            <param name="filter_query" value="False" />
            <param name="matrix" value="BLOSUM62" />
            <param name="max_hits" value="0" />
            <param name="word_size" value="0" />
            <param name="parse_deflines" value="True" />
            <output name="output1" file="blastp_four_human_vs_rhodopsin.tabular" ftype="tabular" />
        </test>
        <test>
            <param name="query" value="four_human_proteins.fasta" ftype="fasta" />
            <param name="db_opts_selector" value="file" />
            <param name="subject" value="rhodopsin_proteins.fasta" ftype="fasta" />
            <param name="database" value="" />
            <param name="evalue_cutoff" value="1e-8" />
            <param name="blast_type" value="blastp" />
            <param name="out_format" value="ext" />
            <param name="adv_opts_selector" value="advanced" />
            <param name="filter_query" value="False" />
            <param name="matrix" value="BLOSUM62" />
            <param name="max_hits" value="0" />
            <param name="word_size" value="0" />
            <param name="parse_deflines" value="True" />
            <output name="output1" file="blastp_four_human_vs_rhodopsin_ext.tabular" ftype="tabular" />
        </test>
        <test>
            <param name="query" value="rhodopsin_proteins.fasta" ftype="fasta" />
            <param name="db_opts_selector" value="file" />
            <param name="subject" value="four_human_proteins.fasta" ftype="fasta" />
            <param name="database" value="" />
            <param name="evalue_cutoff" value="1e-8" />
            <param name="blast_type" value="blastp" />
            <param name="out_format" value="6" />
            <param name="adv_opts_selector" value="basic" />
            <output name="output1" file="blastp_rhodopsin_vs_four_human.tabular" ftype="tabular" />
        </test>
    </tests>
    <help>
    
.. class:: warningmark

**Note**. Database searches may take a substantial amount of time.
For large input datasets it is advisable to allow overnight processing.  

-----

**What it does**

Search a *protein database* using a *protein query*,
using the NCBI BLAST+ blastp command line tool.

.. class:: warningmark

You can also search against a FASTA file of subject protein
sequences. This is *not* advised because it is slower (only one
CPU is used), but more importantly gives e-values for pairwise
searches (very small e-values which will look overly signficiant).
In most cases you should instead turn the other FASTA file into a
database first using *makeblastdb* and search against that.

-----

**Output format**

Because Galaxy focuses on processing tabular data, the default output of this
tool is tabular. The standard BLAST+ tabular output contains 12 columns:

====== ========= ============================================
Column NCBI name Description
------ --------- --------------------------------------------
     1 qseqid    Query Seq-id (ID of your sequence)
     2 sseqid    Subject Seq-id (ID of the database hit)
     3 pident    Percentage of identical matches
     4 length    Alignment length
     5 mismatch  Number of mismatches
     6 gapopen   Number of gap openings
     7 qstart    Start of alignment in query
     8 qend      End of alignment in query
     9 sstart    Start of alignment in subject (database hit)
    10 send      End of alignment in subject (database hit)
    11 evalue    Expectation value (E-value)
    12 bitscore  Bit score
====== ========= ============================================

The BLAST+ tools can optionally output additional columns of information,
but this takes longer to calculate. Most (but not all) of these columns are
included by selecting the extended tabular output. The extra columns are
included *after* the standard 12 columns. This is so that you can write
workflow filtering steps that accept either the 12 or 24 column tabular
BLAST output.

====== ============= ===========================================
Column NCBI name     Description
------ ------------- -------------------------------------------
    13 sallseqid     All subject Seq-id(s), separated by a ';'
    14 score         Raw score
    15 nident        Number of identical matches
    16 positive      Number of positive-scoring matches
    17 gaps          Total number of gaps
    18 ppos          Percentage of positive-scoring matches
    19 qframe        Query frame
    20 sframe        Subject frame
    21 qseq          Aligned part of query sequence
    22 sseq          Aligned part of subject sequence
    23 qlen          Query sequence length
    24 slen          Subject sequence length
====== ============= ===========================================

The third option is BLAST XML output, which is designed to be parsed by
another program, and is understood by some Galaxy tools.

You can also choose several plain text or HTML output formats which are designed to be read by a person (not by another program).
The HTML versions use basic webpage formatting and can include links to the hits on the NCBI website.
The pairwise output (the default on the NCBI BLAST website) shows each match as a pairwise alignment with the query.
The two query anchored outputs show a multiple sequence alignment between the query and all the matches,
and differ in how insertions are shown (marked as insertions or with gap characters added to the other sequences).

-------

**References**

Altschul et al. Gapped BLAST and PSI-BLAST: a new generation of protein database search programs. 1997. Nucleic Acids Res. 25:3389-3402.

Schaffer et al. Improving the accuracy of PSI-BLAST protein database searches with composition-based statistics and other refinements. 2001. Nucleic Acids Res. 29:2994-3005.

    </help>
</tool>
___________________________________________________________
Please keep all replies on the list by using "reply all"
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:

  http://lists.bx.psu.edu/

Reply via email to