Giter Site home page Giter Site logo

Comments (3)

alchemistcai avatar alchemistcai commented on May 28, 2024

Clear the tmpfiles generated by lightdock3_setup.py and try this conversion for AMBER94 atom type compatibility by conda and Ambertools:

install ambertools
convert atom types

conda install -c conda-forge ambertools
pdb4amber --reduce xxx.pdb > xxx.amber.pdb

Then use lightdock3_setup.py again.

See also #45 ,a similar problem.

@MarielEsquivel98

from lightdock.

brianjimenez avatar brianjimenez commented on May 28, 2024

Hi @MarielEsquivel98 , thanks for using LightDock.

First, we have never tested DNA-DNA docking, we are curious about this case scenario, but not sure if the dna scoring function will handle properly DNA-DNA since it was designed specifically for protein-DNA.

Concerning the issue with atom types, @alchemistcai pointed out a few different approaches. Another workaround would be to prepare structures as stated in the tutorial with reduce and then applying the reduce_to_amber.py script:

reduce -Trim dna.pdb > dna_noh.pdb
reduce -BUILD dna_noh.pdb > dna_h.pdb

reduce_to_amber.py:

#!/usr/bin/env python3

import os
import argparse
from lightdock.scoring.dna.data.amber import atoms_per_residue
from lightdock.pdbutil.PDBIO import read_atom_line


def _format_atom_name(atom_name):
    """Format ATOM name with correct padding"""
    if len(atom_name) == 4:
        return atom_name
    else:
        return " %s" % atom_name


def write_atom_line(atom, output):
    """Writes a PDB file format line to output."""
    if atom.__class__.__name__ == "HetAtom":
        atom_type = "HETATM"
    else:
        atom_type = "ATOM  "
    line = "%6s%5d %-4s%-1s%3s%2s%4d%1s   %8.3f%8.3f%8.3f%6.2f%6.2f%12s\n" % (
        atom_type,
        atom.number,
        _format_atom_name(atom.name),
        atom.alternative,
        atom.residue_name,
        atom.chain_id,
        atom.residue_number,
        atom.residue_insertion,
        atom.x,
        atom.y,
        atom.z,
        atom.occupancy,
        atom.b_factor,
        atom.element,
    )
    output.write(line)


def translate_rna(residue_name):
    if residue_name in ['U', 'G', 'A', 'C']:
        residue_name = f'R{residue_name}'
    return residue_name


translation = {"H5'":"H5'1", "H5''":"H5'2", "H2'":"H2'1", "H2''":"H2'2", "OP1":"O1P", "OP2":"O2P"}


if __name__ == "__main__":

    parser = argparse.ArgumentParser()
    parser.add_argument("input_pdb_file")
    parser.add_argument("output_pdb_file")
    args = parser.parse_args()

    with open(args.input_pdb_file) as ih:
        with open(args.output_pdb_file, 'w') as oh:
            for line in ih:
                line = line.rstrip(os.linesep)
                if line.startswith("ATOM  "):
                    atom = read_atom_line(line)
                    atom.residue_name = translate_rna(atom.residue_name)
                    if atom.residue_name not in atoms_per_residue:
                        print(f"[Warning] Not supported atom: {atom.residue_name}.{atom.name}")
                    else:
                        if atom.name not in atoms_per_residue[atom.residue_name]:
                            try:
                                atom.name = translation[atom.name]
                                write_atom_line(atom, oh)
                            except KeyError:
                                print(f"[Warning] Atom not found in mapping: {atom.residue_name}.{atom.name}")
                        else:
                            write_atom_line(atom, oh)
python3 reduce_to_amber.py dna_h.pdb > dna_fixed.pdb

Maybe it would be a good idea also to test the system on the LightDock server, many fixes will be performed automatically for you: https://server.lightdock.org/

from lightdock.

brianjimenez avatar brianjimenez commented on May 28, 2024

Closing issue since there is no feedback. Please feel free to reopen if needed.

from lightdock.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.