Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Converted to package. Changed all imports appropriately. Added README… #33

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed .DS_Store
Binary file not shown.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,6 @@ dmypy.json

# Pyre type checker
.pyre/

# MacOSX
.DS_store
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Protein holography

Create the protein holography conda environment by running

```bash
conda env create -f env.yml
```

to install the necessary dependencies.
Then run

```bash
pip install .
```

to install the `protein_holography` package.
If you're going to make edits to the `protein_holography` package, run

```bash
pip install -e .
```

so you can test your changes.
20 changes: 0 additions & 20 deletions coordinates/geo.py

This file was deleted.

1 change: 0 additions & 1 deletion env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,3 @@ dependencies:
- GitPython
- freesasa
- tensorflow-gpu==2.6

41 changes: 0 additions & 41 deletions hologram/COA_ref_frame.py

This file was deleted.

20 changes: 0 additions & 20 deletions hologram/geo.py

This file was deleted.

32 changes: 0 additions & 32 deletions hologram/protein.py

This file was deleted.

Binary file removed notes/.DS_Store
Binary file not shown.
32 changes: 0 additions & 32 deletions preprocess/sample/protein.py

This file was deleted.

File renamed without changes.
7 changes: 4 additions & 3 deletions config.py → protein_holography/config.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import yaml
import os
from argparse import ArgumentParser
import datetime
import getpass
import itertools
from argparse import ArgumentParser
import os

import yaml

class Config:
def __parse_args(self):
Expand Down
7 changes: 4 additions & 3 deletions config_sampler.py → protein_holography/config_sampler.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import yaml
import os
from argparse import ArgumentParser
import datetime
import getpass
import itertools
from argparse import ArgumentParser
import os

import numpy as np
import yaml

class Config:
def __parse_args(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,23 @@
# - The neighborhood radius
# - "easy" flag to include central res
#

from preprocessorRosetta import PDBPreprocessor
import pandas as pd
import numpy as np
import logging
from argparse import ArgumentParser
import itertools
import logging
import os
import sys

from Bio.PDB import Selection, NeighborSearch
from argparse import ArgumentParser
from progress.bar import Bar
import coordinates as co
import h5py
import sys
sys.path.append('/gscratch/spe/mpun/protein_holography/utils')
from posterity import get_metadata,record_metadata
import protein
import charge
import numpy as np
import pandas as pd
from progress.bar import Bar

import protein_holography.coordinates.charge as charge
import protein_holography.coordinates.coordinates as co
from protein_holography.coordinates.preprocessorRosetta import PDBPreprocessor
from protein_holography.utils.posterity import get_metadata, record_metadata
import protein_holography.utils.protein as protein # Is this even used?

def c(nb_list, pose, d, easy, COA=False):
if pose is None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@
# - The neighborhood radius
# - "easy" flag to include central res
#

from preprocessor import PDBPreprocessor
import pandas as pd
import numpy as np
import logging
from argparse import ArgumentParser
import itertools
import logging
import os
import sys

from Bio.PDB import Selection, NeighborSearch
from argparse import ArgumentParser
from progress.bar import Bar
import coordinates as co
import h5py
import sys
sys.path.append('/gscratch/spe/mpun/protein_holography/utils')
from posterity import get_metadata,record_metadata
import protein
import numpy as np
import pandas as pd
from progress.bar import Bar

from protein_holography.coordinates.preprocessor import PDBPreprocessor
import protein_holography.coordinates.coordinates as co
from protein_holography.utils.posterity import get_metadata,record_metadata
import protein_holography.coordinates.protein as protein


def c(struct, res, d, easy, COA=False):
Expand Down
Empty file.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#
# File to take coordinates from list of neighborhoods
#



import COA_ref_frame as COA_calc
import numpy as np
import protein
from geo import cartesian_to_spherical
import Bio.PDB as pdb
import sys
sys.path.append('/gscratch/stf/mpun/software/freesasa-python')

import Bio.PDB as pdb
import freesasa
import numpy as np


import protein_holography.coordinates.COA_ref_frame as COA_calc
from protein_holography.coordinates.geo import cartesian_to_spherical
import protein_holography.utils.protein as protein

# six channels for C,N,O,S,HOH,SASA
EL_CHANNEL_NUM = 6
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import coordinates as co
import Bio.PDB as pdb
import protein
import numpy as np

import protein_holography.coordinates.coordinates as co
import protein_holography.utils.protein as protein

print('Program starting')

parser = pdb.PDBParser(QUIET=True)
Expand Down
44 changes: 44 additions & 0 deletions protein_holography/coordinates/geo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""This module converts Cartesian coordinate arrays to spherical coordinate arrays.
Copyright (C) 2019 Pun, Michael
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
"""
from typing import Tuple

import numpy as np

def cartesian_to_spherical(r: np.ndarray) -> Tuple[float]:
"""
Convert Cartesian coordinates to spherical coorindates.

Parameters
----------
r : numpy.ndarray
Array of Cartesian coordinates x, y, z.

Returns
-------
r_mag : float
Radial distance.
theta : float
Polar angle.
phi : float
Azimuthal angle.
"""
x, y, z = *r,

r_mag = np.sqrt(np.sum(r**2))
theta = np.arccos(z / r_mag)
phi = np.arctan2(y, x)

return r_mag, theta , phi
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@
# - The neighborhood radius
# - "easy" flag to include central res
#

from pyrosetta_hdf5_proteins import get_structural_info,pad_structural_info
from preprocessor_pdbs import PDBPreprocessor
from argparse import ArgumentParser
import numpy as np
import h5py
import sys
sys.path.append('/gscratch/spe/mpun/protein_holography/utils')
from posterity import get_metadata,record_metadata
import logging
import sys

import h5py
import numpy as np
from progress.bar import Bar

from protein_holography.coordinates.pyrosetta_hdf5_proteins import get_structural_info,pad_structural_info
from protein_holography.coordinates.preprocessor_pdbs import PDBPreprocessor
from protein_holography.utils.posterity import get_metadata,record_metadata

def c(pose):

if pose is None:
Expand Down
Loading