Skip to content

Commit

Permalink
Merge pull request #65 from UCLOrengoGroup/add-pdb-globularity
Browse files Browse the repository at this point in the history
Add globularity measure for generic PDB files
  • Loading branch information
sillitoe authored Nov 15, 2023
2 parents b262dea + 8ae2bec commit 56ced3c
Show file tree
Hide file tree
Showing 9 changed files with 598 additions and 235 deletions.
2 changes: 2 additions & 0 deletions cath_alphaflow/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from .commands import convert_cif_to_fasta
from .commands import load_mongo
from .commands import measure_globularity
from .commands import measure_globularity_af_cif

logging.basicConfig(
level=logging.INFO, format="%(asctime)s | %(levelname)s | %(message)s"
Expand Down Expand Up @@ -67,3 +68,4 @@ def dump_config():
cli.add_command(convert_cif_to_fasta.convert_cif_to_fasta)
cli.add_command(load_mongo.load_af_from_archive)
cli.add_command(measure_globularity.measure_globularity)
cli.add_command(measure_globularity_af_cif.measure_globularity_af_cif)
17 changes: 8 additions & 9 deletions cath_alphaflow/commands/create_dataset_cath_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
Gene3DCrhPredictedCathDomainProvider,
DecoratedCrhPredictedCathDomainProvider,
)
from pydantic import ConfigDict

LOG = logging.getLogger()

Expand Down Expand Up @@ -128,12 +129,12 @@ def create_cath_dataset_from_files(src_decorated_crh, **kwargs):

class CathDatasetGeneratorBase(pydantic.BaseModel):

csv_uniprot_ids: typing.Any # click.File
gene3d_crh_output: typing.Any # click.File
csv_uniprot_md5: typing.Any # click.File
af_domainlist_ids: typing.Any # click.File
af_chainlist_ids: typing.Any # click.File
af_cath_annotations: typing.Any # click.File
csv_uniprot_ids: typing.Any = None # click.File
gene3d_crh_output: typing.Any = None # click.File
csv_uniprot_md5: typing.Any = None # click.File
af_domainlist_ids: typing.Any = None # click.File
af_chainlist_ids: typing.Any = None # click.File
af_cath_annotations: typing.Any = None # click.File
chunk_size: int
af_version: int
fragment_number: int
Expand All @@ -142,9 +143,7 @@ class CathDatasetGeneratorBase(pydantic.BaseModel):
af_domainlist_writer: typing.Any = None
af_chainlist_writer: typing.Any = None
af_cath_annotations_writer: typing.Any = None

class Config:
arbitrary_types_allowed = True
model_config = ConfigDict(arbitrary_types_allowed=True)

def run(self):

Expand Down
5 changes: 2 additions & 3 deletions cath_alphaflow/commands/load_mongo.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from cath_alphaflow.models.mongo import AFFile, AFFileType
from cath_alphaflow.models import beacons
from cath_alphaflow.errors import ParseError
from pydantic import ConfigDict

LOG = logging.getLogger(__name__)

Expand Down Expand Up @@ -119,9 +120,7 @@ class AFArchiveFile(pydantic.BaseModel):

filename: str
tarfileobj: tarfile.ExFileObject

class Config: # pylint: disable=missing-class-docstring
arbitrary_types_allowed = True
model_config = ConfigDict(arbitrary_types_allowed=True)


def yield_next_file_from_archive(archive_path) -> AFArchiveFile:
Expand Down
Loading

0 comments on commit 56ced3c

Please sign in to comment.