Git Product home page Git Product logo

p5-hackamol's People

Contributors

autolife avatar demianriccardi avatar dmr3 avatar jwilk avatar manwar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

p5-hackamol's Issues

pdb reader for common pdbs (no entry in col 78)

HackaMol needs a pdbreader that does not depend on the Atom being in the 78 as in the PDB specifications. This is a common type of pdb. The atom type will need to be converted from the atom name via a hash table look-up. Something similar was implemented in pdbqt, just not to this extreme.

Improve grouping with selection

creating grouping of unique cysteine residues required too much Perl. The trouble for those with same resid, but different chains; group_by_atom_attr would need another attr. Perhaps group_by_atom_attrs with an internal union would work.

FileFetchRole test is failing with file not found

read_file '1L2Y.pdb' - sysopen: No such file or directory at t/Roles/HackaMol-FileFetchRole.t line 41.
# Tests were run but no plan was declared and done_testing() was not seen.
# Looks like your test exited with 2 just after 6.

this is not an issue with most OSs. see testers on metacpan.

print all coordinates into one file

it would be nice to have a way to print all the coordinates into a single pdb file without breaks (model 1 end model 1, etc). Useful for things like crystals and capsids

charge method for molecules

Currently, the charge method does not allow the current (t) charge to be set. This was to safe-guard atom data, but it is annoying in practice for molecules. (both atoms and molecules consume the role that provides charge). Override the method in the molecule to make it easier to use for molecules.

Ability to read different configurations into separate molecules

It would be helpful to have a function that can generate multiple molecules from configurations are to be able to read in separate files from a given file. e.g. for a pdb with different models, each model can be loaded into a new molecule. similar for xyz files

centered vector script

use Modern::Perl;
use HackaMol;
use Math::Trig;

my $bldr  = HackaMol->new();
my $pdbid = shift || '5umo';
my $add_2 = shift;

my $sel1 = 'resid 62-75';
my $sel2 = 'resid 121-140';

if ($add_2) {
    $sel1 = 'resid 64-77';
    $sel2 = 'resid 123-142';
}

ERK_0P: {
    my $mol = $bldr->pdbid_mol($pdbid);
    my $bb  = $mol->select_group('protein')->select_group('backbone');

    my $helix_a = $bb->select_group($sel1);
    my $helix_b = $bb->select_group($sel2);

    my @ca_a = $helix_a->select_group('name CA')->all_atoms;
    my @ca_b = $helix_b->select_group('name CA')->all_atoms;

    my $dist_a = $ca_a[0]->distance( $ca_a[-1] );
    my $dist_b = $ca_b[0]->distance( $ca_b[-1] );

    my $vec_a = $helix_a->centered_vector;
    my $vec_b = $helix_b->centered_vector;

    #$helix_a->print_pdb;
    #$helix_b->print_pdb;
    say $pdbid;
    say rad2deg( atan2( $vec_a, $vec_b ) );

    #  to visually debug
    my $catom_a1 = HackaMol::Atom->new(
        symbol  => 'Pb',
        name    => 'PB',
        resname => 'FK1',
        coords  => [ $helix_a->center - $vec_a * $dist_a / 2 ]
    );
    my $catom_a2 = HackaMol::Atom->new(
        symbol  => 'Au',
        name    => 'AU',
        resname => 'FK1',
        coords  => [ $helix_a->center + $vec_a * $dist_a / 2 ]
    );
    my $catom_b1 = HackaMol::Atom->new(
        symbol  => 'Pb',
        name    => 'PB',
        resname => 'FK2',
        coords  => [ $helix_b->center - $vec_b * $dist_b / 2 ]
    );
    my $catom_b2 = HackaMol::Atom->new(
        symbol  => 'Au',
        name    => 'AU',
        resname => 'FK2',
        coords  => [ $helix_b->center + $vec_b * $dist_b / 2 ]
    );

    my $dihe = HackaMol::Dihedral->new(
        atoms => [ $catom_a1, $catom_a2, $catom_b1, $catom_b2 ] );

    say $dihe->dihe_deg;
    my $mol2 = HackaMol::Molecule->new(
        atoms => [
            $helix_a->all_atoms, $catom_a1, $catom_a2,
            $helix_b->all_atoms, $catom_b1, $catom_b2
        ]
    );
    my $i = $bb->count_atoms;
    $_->iatom( $i++ ) foreach $mol2->all_atoms;
    $_->resid(999) foreach $mol2->all_atoms;
    $mol2->print_pdb("shit.pdb");

}

Trouble with reading in pdb_print method has "%4s" or " %-3s"

Pdb is annoying in printing out the atom names. most of the time there are 1-3 characters in a name. There can be four, and it should print like this

'\s\w\s\s'
'\s\w\w\s'
'\s\w\w\w'
'\w\w\w\w'

Programs that are particular about reading pdbs, will choke if you send them "%-4s" for all of them. So we need a conditional formatting. Bleh.

PDBQT file writing support

Think about activation and deactivation of rotatable groups, and whether there is a tricky way to tie into an existing pdbqt file.

Separate some core roles into their on repos

Much of the core remains unchanged as roles are added and enhanced. They may need to be extracted from the core repo and developed more modularly to improve releases. Think on this.

getstore_pdbid

If you download a lot of pdb by the method, the website(pdb.org) will refuse your request.
the website will think downloading pdb by the robot not human.

one solvtion:
try mojo or LWP, disguise a browser.

adjust api for printing

currently, print_pdb, xyz, etc. will either print to the screen or to a file handle. A better approach would be to return a string (or lines or an iterator) that the user can decide where the output should go.

a string could then be used for easy clones (not really clone, but gens of similar objects) via reading in strings.

Perhaps adding the new method would be a good start:

form_string('pdb', [xyz .. etc])

is_constrained attribute to AtomGroupRole

Programs such as Orca and Gaussian allow coordinates to be fixed in calculations. adding the attribute would allow groups of atoms to be flagged when using these programs.

select_group method gives warnings on mixed type attrs (number/letter)

found by @tlfobe ,
pdb chains are typically letters; big complexes use numbers.
$mol->select("chain 1") will give a warning when comparisons to letters because of how the regex method is initiated (numeric -> == ); a possible fix is to use strings are attrs and revisit type. However, the selector still works, ('A' == 1) -> '' which is still false, but the warning is annoying.

real world example.
5l8r:
Argument "F" isn't numeric in numeric eq (==) at (eval 865) line 1.

enable a YAML molecular format derived from Z-Matrix reader

The YAML molecular format should allow for variables to be fed in as arrays.

currently debating simple vs flexible representations:

simple:

---
atoms:
- N 0    0.483824   1.697569  -0.701935
- C 0    0.027824   0.314569  -0.780935
- C 0    0.152824  -0.407431   0.563065
- O 0   -0.559176  -1.416431   0.778065
- C 2   CC 3 CCC 4 CCCC
vars:
- CC :       1.54
- CCC :    106.42
- CCCC :  [-81.90, 89, 09]

flexible:

---
atoms :
- N :  { '0' : [[0,0,0], [0.483824,   1.697569,  -0.701935]] }
- C :  { '0' : [[0.027824,   0.314569,  -0.780935]] }
- C :  { '0' : [[0.152824,  -0.407431,   0.563065]] }
- O :  { '0' :  [[-0.559176,  -1.416431,   0.778065]] }
- C :  { '2' : CC, '3' :CCC, '4' : CCCC }
vars:
- CC : [1.54]
- CCC :  [106.42]
- CCCC  : [-81.90, 80, 90]

Selections are needed

using grep is awesome, but challenging for newbies.

charmm, pymol, and VMD selections could serve as inspirations.

$atomgroup = $mol->vmd_select("same residue as within 5 of element Zn");

that one seems annoying

however,
$backbone = $mol->select_group("backbone");
doesn't seem so bad.

Make the PDB download seamless

Currently, a PDB will be downloaded only if it doesn't exist in the current directory.

  1. Add a directory where PDBs can be stored. If you want to work with a database of 1000 pdbs, HackaMol, should make that easy to set up in a persistent way. If a requested pdb doesn't exist, download it. Since the database can include a ton of files, you could use the first two letters of the pdbid as a layer to the files.
  2. Dream: use JSON to store the molecular object. Time it out. The trouble with this approach is the potential loss of information, that which isn't parsed from the file.

System, universe, Mol_Coll or ... new class for collections of molecules

the api may be cleaner with another class that contains collections of molecules. The molecule collection should have methods for adjusting and comparing structures, such as superposition, packing, etc.

One useful attribute would be that of symmetry operators, and lattice parameters. with one molecule and a handful of symmetry operators one could have a faithful representation of a crystal lattice.

Pull HackaMol::X::NERF into core and make Zmatrices useable

you just gotta have Z matrices. We need support for variables.

The parsing of Z-matrices should occur in two stages:

Stage 1. substitute variables
Stage 2. build the molecule using NERF

Dream: implement a YAML specification for molecular geometries that stores variable as arrays. Looping over the arrays of Z-matrix variables can compactly populate a large ensemble of configurations.

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.