view alphafold.xml @ 8:ca90d17ff51b draft

"planemo upload for repository https://github.com/usegalaxy-au/tools-au commit 03537aada92b5fff565ff48dd47c81462c5df47e"
author galaxy-australia
date Fri, 19 Aug 2022 00:29:16 +0000
parents eb085b3dbaf8
children 3bd420ec162d
line wrap: on
line source

<tool id="alphafold" name="Alphafold 2" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="20.01">
    <description> - AI-guided 3D structural prediction of proteins</description>
    <macros>
      <token name="@TOOL_VERSION@">2.1.2</token>
      <token name="@VERSION_SUFFIX@">1</token>
    </macros>
    <edam_topics>
      <edam_topic>topic_0082</edam_topic>
    </edam_topics>
    <edam_operations>
      <edam_operation>operation_0474</edam_operation>
    </edam_operations>
    <xrefs>
      <xref type="bio.tools">alphafold_2.0</xref>
    </xrefs>
    <requirements>
        <container type="docker">neoformit/alphafold:v2.1.2_0</container>
    </requirements>
    <command detect_errors="exit_code"><![CDATA[

## $ALPHAFOLD_DB variable should point to the location of the AlphaFold
## databases - defaults to /data

## fasta setup ----------------------------
#if $fasta_or_text.input_mode == 'history':
    cp '$fasta_or_text.fasta_file' input.fasta &&

#elif $fasta_or_text.input_mode == 'textbox':
    echo '$fasta_or_text.fasta_text' > input.fasta &&
#end if

python3 '$__tool_directory__/validate_fasta.py' input.fasta
--min_length \${ALPHAFOLD_AA_LENGTH_MIN:-0}
--max_length \${ALPHAFOLD_AA_LENGTH_MAX:-0}
> alphafold.fasta &&

## env vars -------------------------------
export TF_FORCE_UNIFIED_MEMORY=1 &&
export XLA_PYTHON_CLIENT_MEM_FRACTION=4.0 &&
export DATE=`date +"%Y-%m-%d"` &&

## run alphafold  -------------------------
python /app/alphafold/run_alphafold.py
--fasta_paths alphafold.fasta
--output_dir output
--data_dir \${ALPHAFOLD_DB:-/data}
--uniref90_database_path \${ALPHAFOLD_DB:-/data}/uniref90/uniref90.fasta
--mgnify_database_path \${ALPHAFOLD_DB:-/data}/mgnify/mgy_clusters_2018_12.fa
--pdb70_database_path \${ALPHAFOLD_DB:-/data}/pdb70/pdb70
--template_mmcif_dir \${ALPHAFOLD_DB:-/data}/pdb_mmcif/mmcif_files
--obsolete_pdbs_path \${ALPHAFOLD_DB:-/data}/pdb_mmcif/obsolete.dat
--max_template_date=\$DATE
--bfd_database_path \${ALPHAFOLD_DB:-/data}/bfd/bfd_metaclust_clu_complete_id30_c90_final_seq.sorted_opt
--uniclust30_database_path \${ALPHAFOLD_DB:-/data}/uniclust30/uniclust30_2018_08/uniclust30_2018_08
## Param introduced in AlphaFold v2.1.2:
--use_gpu_relax=\${ALPHAFOLD_USE_GPU:-True}
&&

## Generate additional outputs ------------
python3 '$__tool_directory__/gen_extra_outputs.py' output/alphafold $output_plddts &&

## HTML output
mkdir -p '${ html.files_path }' &&
cp '$__tool_directory__/alphafold.html' '${html}' &&
cp output/alphafold/ranked_*.pdb '${html.files_path}' &&

## This is a (hacky) fix for a bug that has appeared in multiple Pulsar servers.
## The working directory ends up two levels deep and the visualization html page
## fails to load the PDB files as static assets.
[ -d working ] && cp -r working/* .

    ]]></command>
    <inputs>
        <conditional name="fasta_or_text">
            <param name="input_mode" type="select" label="Fasta Input" help="Single protein sequence to fold. Input can be fasta file from history, or text. Sequence must be valid IUPAC amino acid characters. Provide only 1 sequence per job.">
                <option value="history">Use fasta from history</option>
                <option value="textbox">Paste sequence into textbox</option>
            </param>
            <when value="history">
                <param name="fasta_file" type="data" format="fasta" label="Fasta file from history" help="Select single fasta protein sequence from your history. If you wish to fold multiple proteins, submit an individual job for each protein." />
            </when>
            <when value="textbox">
                <param name="fasta_text" type="text" area="true" value="" label="Paste sequence" help="Paste single protein sequence into the textbox. If you wish to fold multiple proteins, submit individual jobs for each protein." />
            </when>
        </conditional>
        <param name="output_plddts" type="boolean" checked="false" label="Output per-residue confidence scores" truevalue="--plddts" falsevalue="" help="Alphafold produces a pLDDT score between 0-100 for each residue in the folded models. High scores represent high confidence in placement for the residue, while low scoring residues have lower confidence. Sections of low confidence often occur in disordered regions. " />
    </inputs>
    <outputs>
        <data name="model5" format="pdb" from_work_dir="output/alphafold/ranked_4.pdb" label="${tool.name} on ${on_string}: Model 5"/>
        <data name="model4" format="pdb" from_work_dir="output/alphafold/ranked_3.pdb" label="${tool.name} on ${on_string}: Model 4"/>
        <data name="model3" format="pdb" from_work_dir="output/alphafold/ranked_2.pdb" label="${tool.name} on ${on_string}: Model 3"/>
        <data name="model2" format="pdb" from_work_dir="output/alphafold/ranked_1.pdb" label="${tool.name} on ${on_string}: Model 2"/>
        <data name="model1" format="pdb" from_work_dir="output/alphafold/ranked_0.pdb" label="${tool.name} on ${on_string}: Model 1"/>
        <data name="confidence_scores" format="tsv" from_work_dir="output/alphafold/model_confidence_scores.tsv" label="${tool.name} on ${on_string}: Model confidence scores"/>
        <data name="plddts" format="tsv" from_work_dir="output/alphafold/plddts.tsv" label="${tool.name} on ${on_string}: Per-residue confidence scores (plddts)">
            <filter>(output_plddts)</filter>
        </data>
        <data name="html" format="html" label="${tool.name} on ${on_string}: Visualization" />
    </outputs>
    <tests>
        <test expect_num_outputs="8">
            <conditional name="fasta_or_text">
                <param name="input_mode" value="history"/>
                <param name="fasta_file" value="test1.fasta"/>
            </conditional>
            <param name="output_plddts" value="true"/>
            <output name="plddts">
                <assert_contents>
                    <has_n_columns n="2"/>
                    <has_n_lines n="6"/>
                    <has_size value="2900" delta="300"/>
                </assert_contents>
            </output>
            <output name="confidence_scores">
                <assert_contents>
                    <has_n_columns n="2"/>
                    <has_n_lines n="6"/>
                    <has_size value="70" delta="50"/>
                </assert_contents>
            </output>
            <output name="model1">
                <assert_contents>
                    <has_n_columns n="12"/>
                    <has_n_lines n="1517"/>
                    <has_size value="123000" delta="10000"/>
                </assert_contents>
            </output>
            <output name="model2">
                <assert_contents>
                    <has_n_columns n="12"/>
                    <has_n_lines n="1517"/>
                    <has_size value="123000" delta="10000"/>
                </assert_contents>
            </output>
            <output name="model3">
                <assert_contents>
                    <has_n_columns n="12"/>
                    <has_n_lines n="1517"/>
                    <has_size value="123000" delta="10000"/>
                </assert_contents>
            </output>
            <output name="model4">
                <assert_contents>
                    <has_n_columns n="12"/>
                    <has_n_lines n="1517"/>
                    <has_size value="123000" delta="10000"/>
                </assert_contents>
            </output>
            <output name="model5">
                <assert_contents>
                    <has_n_columns n="12"/>
                    <has_n_lines n="1517"/>
                    <has_size value="123000" delta="10000"/>
                </assert_contents>
            </output>
        </test>
    </tests>
    <help><![CDATA[

    .. class:: infomark

    **What it does**

    | AlphaFold v2.0: AI-guided 3D structure prediction of proteins
    |

    *What is AlphaFold?*

    | AlphaFold is a program which uses neural networks to predict the tertiary (3D) structure of proteins. AlphaFold accepts an amino acid sequence (in Fasta format), then will 'fold' that sequence into a 3D model.
    | NOTE: AlphaFold has a number of versions - this tool uses AlphaFold v2.0.
    |

    *What makes AlphaFold different?*

    | The ability to use computers to predict 3D protein structures with high accuracy is desirable because it removes the time-consuming and costly process of determining structures experimentally.
    | In-silico protein folding has been an active field of research for decades, but existing tools ran more slowly and with less reliability than AlphaFold.
    | AlphaFold represents a leap forward by regularly predicting structures to atomic-level accuracy, even when no similar structures are known.
    |

    *Downstream analysis*

    | Obtaining a protein fold is the first step in many analyses.
    | The 3D models created by AlphaFold can be used in downstream analysis, including the following:
    |

    - Inspecting protein features
        3D viewers (pymol, chimera, ngl, blender) can be used to inspect active sites, regulatory domains, binding sites.
    - Molecular docking
        3D structures can be used to predict the binding affinity of different compounds.
        This is especially useful in screening drug candidates.
    - Protein-protein interactions
        Proteins associate in many biological processes, including intracellular signalling pathways and protein complex formation.
        To predict these interactions, other programs may ingest 3D models predicted by AlphaFold. Proprietary softwares include `GOLD <https://www.ccdc.cam.ac.uk/solutions/csd-discovery/components/gold/>`_ and `SeeSAR <https://www.biosolveit.de/SeeSAR>`_, but many `free and open-source options <https://en.wikipedia.org/wiki/List_of_protein-ligand_docking_software>`_ are available such as `AutoDock <https://autodock.scripps.edu/>`_ and `SwissDock <http://www.swissdock.ch/>`_.

    **Input**

    *Amino acid sequence*

    | AlphaFold accepts a **single amino acid sequence** in FASTA format.
    | You can choose to input either a file from your Galaxy history or paste a sequence into a text box.
    | Please paste only a single sequence - we can only process a single sequence per job.
    | Multiple sequences will return an error.
    |

    **Outputs**

    *Visualization*

    | An interactive 3D graphic of the best predicted molecular structures.
    | This output can be opened in Galaxy to give a visual impression of the results, with different structural representations to choose from.
    | Open the "Visualization" history output by clicking on the "view data" icon:
    |

    .. image:: https://github.com/usegalaxy-au/galaxy-local-tools/blob/1a8d3e8daa7ccc5a345ca377697735ab95ed0666/tools/alphafold/static/img/alphafold-visualization.png?raw=true
        :height: 520
        :alt: Result visualization

    |

    *PDB files*

    | Five PDB (Protein Data Bank) files will be created for the best ranking models predicted by AlphaFold.
    | These files describe the molecular structures and can be used for downstream analysis. e.g. *in silico* molecular docking.
    |

    *Model confidence scores (optional)*

    | This optional output produces a file which describes the confidence scores for each model (based on `pLDDTs <https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3799472/>`_) which may be useful for downstream analysis.
    | Model confidence scores are also included as a column in the default PDB output.
    |

    **External Resources**

    We recommend checking out the
    `Alphafold Protein Structure Database <https://alphafold.ebi.ac.uk/>`_,
    which contains predicted sequences for thousands of Human proteins. See also:

    - `Google Deepmind's article on AlphaFold <https://deepmind.com/blog/article/alphafold-a-solution-to-a-50-year-old-grand-challenge-in-biology>`_
    - `AlphaFold source code on GitHub <https://github.com/deepmind/alphafold>`_

    ]]></help>
    <citations>
        <citation type="doi">https://doi.org/10.1038/s41586-021-03819-2</citation>
    </citations>
</tool>