<div class="accordion-item">
  <h2 class="accordion-header" id="helpUploadHeading">
    <button class="accordion-button collapsed" type="button"
            data-bs-toggle="collapse" data-bs-target="#helpUpload"
            aria-expanded="true" aria-controls="helpUpload">
      <span class="fw-bold">Upload</span>
    </button>
  </h2>
  <div id="helpUpload" class="accordion-collapse collapse"
       aria-labelledby="helpUploadHeading"
       data-bs-parent="#help">
    <div class="accordion-body">
      <div>
        <p>
          You can use the 'Upload' tab at the top of the page to upload
          complex structures, PAE values and crosslinks. It is also
          possible to label the different chains/subunits of the
          uploaded complex.
        </p>
        <p>
          The form is designed to use the output files of
          <a href="https://doi.org/10.1038/s41586-024-07487-w" target="_blank">
            AlphaFold 3</a>
          (use
          <a href="https://alphafoldserver.com/" target="_blank">
            AlphaFold Server</a>
          for an online version)
          and
          <a href="https://www.biorxiv.org/content/10.1101/2021.10.04.463034v2"
             target="_blank">
            AlphaFold-Multimer</a>
          (use
          <a href="https://colab.research.google.com/github/sokrypton/ColabFold/blob/v1.5.2/AlphaFold2.ipynb"
             target="_blank">
            ColabFold</a>
          or the
          <a href="https://colab.research.google.com/github/deepmind/alphafold/blob/main/notebooks/AlphaFold.ipynb"
             target="_blank">
            Colab notebook from Deepmind</a>
          for an online version).
          You can also
          <a href="pae-viewer/sample/GatA-GatB.zip" download="GatA-GatB.zip">
            download some sample files (GatA-GatB.zip)</a> to try it out.
          Have a look at the included ReadMe for instructions.
        </p>
        <p>
          If you would like to use the
          <span class="font-monospace">.pkl</span> /
          <span class="font-monospace">.pickle</span> files generated by
          AlphaFold directly, you can download the following Python script
          to convert them into compatible
          <span class="font-monospace">.json</span> files:
          <span class="font-monospace">
            <a href="pae-viewer/jsonify_scores.py" download>
              jsonify_scores.py
            </a>
          </span>
        </p>
        <p>
          Usage:
          <span class="font-monospace">
            python3 jsonify_scores.py scores.pkl
          </span>
        </p>
        <p>
          <span class="font-monospace">scores.pkl</span> is a placeholder
          for the <span class="font-monospace">.pkl</span> /
          <span class="font-monospace">.pickle</span> file containing
          the scores from AlphaFold.
          The script requires
          <a href="https://numpy.org/" target="_blank">numpy</a> to be
          installed. It was tested with Python 3.10 and the output of
          AlphaFold v2.3.1. Converting the output of older AlphaFold versions
          might require
          <a href="https://jax.readthedocs.io/en/latest/" target="_blank">
            jax / jaxlib
          </a> to be installed, as well.
        </p>
        <p>
          Different structures and PAE files from following sources were tested:
        </p>
        <ul>
          <li>
            <a href="https://alphafoldserver.com/" target="_blank">
              AlphaFold Server: AlphaFold 3 (2024-11-12)
            </a>
          </li>
          <li>
            <a href="https://colab.research.google.com/github/sokrypton/ColabFold/blob/v1.5.2/AlphaFold2.ipynb"
               target="_blank">
              ColabFold v1.5.2: AlphaFold2 using MMseqs2 (2023-04-06)
            </a>
            (older versions could not be tested, as the Colab notebooks seem
            to not be functional anymore)
          </li>
          <li>
            <a href="https://colab.research.google.com/github/deepmind/alphafold/blob/main/notebooks/AlphaFold.ipynb"
               target="_blank">
              Colab notebook from Deepmind (2023-04-06)
            </a>
          </li>
          <li>
            Output of local AlphaFold-Multimer v2.3.1 (pickle files converted
            using the provided
            <span class="font-monospace">
              <a href="pae-viewer/jsonify_scores.py" download>
                jsonify_scores.py</a></span>
            script)
          </li>
          <li>
            Downloads from the
            <a href="https://alphafold.ebi.ac.uk/"
               target="_blank">
              AlphaFold Protein Structure Database (2023-04-06)
            </a>
            (however, structure downloads in .cif unfortunately cannot be read)
          </li>
        </ul>
      </div>
      <div>
        <h5>Structure file</h5>
        <p>
          Two structure formats for complex structures as well as monomers
          are supported: PDB (<span class="font-monospace">.pdb</span>)
          and PDBx/mmCIF
          (<span class="font-monospace">.cif,.mcif,.mmcif</span>).
          However, the structure downloads from the AlphaFold Protein Structure
          Database in PDBx/mmCIF format are unfortunately not supported.
          Please use the PDB format downloads instead.
        </p>
      </div>
      <div>
        <h5>Chain labels (optional)</h5>
        <p>
          The 'Chain labels' input field lets you define unique names for
          the chains/subunits of the predicted multimer. These labels
          will then be used for display in the viewers, instead of
          the chain identifiers which are read from the
          .pdb structure file, and which are usually single-letter
          identifiers. To provide the labels, type in a
          semicolon-separated list of unique, non-empty identifiers
          in order of the corresponding chains in the .pdb file.
          Example:
          <span class="font-monospace">GatA;GatB</span>.
          If a label is invalid or the number of provided labels
          doesn't match the number of subunits/chains of the complex,
          the upload will fail.
        </p>
      </div>
      <div>
        <h5>Scores file</h5>
        <p>
          The PAE can be provided using the
          <span class="font-monospace">fold_*_full_data_0.json</span>
          output of
          <a href="https://alphafoldserver.com/" target="_blank">
            AlphaFold Server</a>,
          the <span class="font-monospace">*_scores.json</span>
          output of
          <a href="https://colab.research.google.com/github/sokrypton/ColabFold/blob/v1.5.2/AlphaFold2.ipynb"
             target="_blank">
            ColabFold</a>, or the
          <span class="font-monospace">predicted_aligned_error.json</span> by
          the
          <a href="https://colab.research.google.com/github/deepmind/alphafold/blob/main/notebooks/AlphaFold.ipynb"
             target="_blank">
            Colab notebook from Deepmind</a>
          (same as downloads from the
          <a href="https://alphafold.ebi.ac.uk/"
             target="_blank">
            AlphaFold Protein Structure Database</a>).
          If you would like to use the output of an AlphaFold run directly,
          please use the conversion script
          <span class="font-monospace">
            <a href="pae-viewer/jsonify_scores.py" download>
              jsonify_scores.py</a></span> as described above.
          The JSON file should contain a JSON object (or a list with the object
          as its first element) with the following keys:
        </p>
        <dl>
          <dt>
            <span class="font-monospace">pae</span>
            /
            <span class="font-monospace">predicted_aligned_error</span>
          </dt>
          <dd>
            An N*N number array (array of arrays), where N is the overall
            length of the complex amino acid sequence (total number of
            residues).
            <span class="font-monospace">pae[y][x]</span> corresponds to
            the PAE at <em>scored residue x</em> for
            <em>aligned residue y</em>.
          </dd>
          <dt>
            <span class="font-monospace">max_pae</span>
            /
            <span class="font-monospace">max_predicted_aligned_error</span>
            (optional)
          </dt>
          <dd>
            A single number denoting the maximum PAE value. For
            AlphaFold-Multimer predictions, this value is usually clamped
            at 31.75. If not provided, the maximum PAE value from the
            PAE matrix is used.
          </dd>
          <dt>
            <span class="font-monospace">plddt</span> (optional)
          </dt>
          <dd>
            A number array of length N, where N is the overall
            length of the complex amino acid sequence (total number of
            residues).
            <span class="font-monospace">plddt[x]</span> corresponds to
            the pLDDT<sup><a
                      href="https://doi.org/10.1038/s41586-021-03819-2"
                      target="_blank"
                      title="Highly accurate protein structure prediction with AlphaFold (2021)">?</a></sup>
            of residue <em>x</em>. The pLDDT is a
            <q>per-residue estimate of [AlphaFold's] confidence on a scale
              from 0 - 100</q> (see
            <a href="https://alphafold.ebi.ac.uk/faq#faq-5" target="_blank">
              FAQ on AlphaFold DB</a>).
            These values will be used to calculate the mean pLDDT.
          </dd>
          <dt>
            <span class="font-monospace">ptm</span> (optional)
          </dt>
          <dd>
            A single number corresponding to the predicted TM-score
            (pTM)<sup><a
                      href="https://doi.org/10.1038/s41586-021-03819-2"
                      target="_blank"
                      title="Highly accurate protein structure prediction with AlphaFold (2021)">?</a></sup>,
            another model accuracy estimate.
          </dd>
          <dt>
            <span class="font-monospace">iptm</span> (optional)
          </dt>
          <dd>
            A single number corresponding to the Interface pTM
            (ipTM)<sup><a
                      href="https://doi.org/10.1101/2021.10.04.463034"
                      target="_blank"
                      title="Protein complex prediction with AlphaFold-Multimer (2022)">?</a></sup>,
            which scores interactions between residues of
            different chains.
          </dd>
        </dl>
      </div>
      <div>
        <h5>Crosslinks file (optional)</h5>
        <h6>CSV</h6>
        <p>
          A CSV file containing the crosslinks can be uploaded, as well.
          A header row is required, which needs to define
          the columns seen in this format example
          (except for the optional <code>RestraintSatisfied</code> and
          <code>Atom*</code> columns):
        </p>
        <div class="card" style="margin-bottom: 1em">
          <div class="card-body font-monospace small">
            Protein1,SeqPos1,Atom1,Protein2,SeqPos2,Atom2,RestraintSatisfied<br />
            GatB,421,CA,GatB,457,CA,True<br />
            GatA,21,CA,GatA,56,CA,True<br />
            GatB,129,CA,GatA,22,CA,False<br />
            ...
          </div>
        </div>
        <p>
          Other columns are ignored, and the order of columns
          doesn't matter. The <code>Protein1</code> and
          <code>Protein2</code> columns need to use the
          user-defined labels, if provided; otherwise, the chain
          identifiers from the structure file are used.
          The positions in <code>SeqPos1</code> and
          <code>SeqPos2</code> refer to residues and are 1-based, and can't be
          higher than the number of residues in the corresponding complex
          chains. The <code>Atom1</code> and <code>Atom2</code> columns are
          optional, and refer to the names of the atoms in the corresponding
          residues. If not provided, <code>'CA'</code> (C⍺ atom) is used by
          default.
        </p>
        <p>
          The <code>RestraintSatisfied</code> column is optional and
          can be used to distinguish the corresponding crosslinks in the
          structure viewer. If defined, the values must be set <code>True</code>
          (case-insensitive), if the restraint is satisfied, and
          <code>False</code> (case-insensitive) otherwise. Other values
          will cause an error.
          If the column is not defined, all crosslinks are displayed
          in the style for satisfied restraints (blue).
        </p>
        <h6>Pseudobonds</h6>
        <p>
          Alternatively, there is limited support for
          <code>.pb</code> files containing
          <a href="https://www.rbvi.ucsf.edu/chimerax/docs/user/pseudobonds.html"
             target="_blank"
          >
            pseudobonds (as, for example, used by ChimeraX)</a>,
          which consist of pairs of atom specifiers.
          Example:
        </p>
        <div class="card" style="margin-bottom: 1em">
          <div class="card-body font-monospace small">
            /b:1@ca /c:2@ca<br />
            /b:1@ca /c:5@cb
          </div>
        </div>
        <p>
          However, user-defined labels are not supported, and the chain names
          as specified in the corresponding structure file must be used.
          Additionally, the residues must be specified using 1-based indices,
          and atom names are not validated (invalid atom names might lead
          to the structure viewer displaying the associated crosslinks
          incorrectly).
          Models, comments and colors are ignored. The validation feedback
          is optimized for CSV input, so error messages might be inaccurate.
        </p>
      </div>
    </div>
  </div>
</div>
