Skip to content

Commit

Permalink
move urls to dedicated module
Browse files Browse the repository at this point in the history
  • Loading branch information
rvhonorato committed May 22, 2024
1 parent a7454db commit 66e6948
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 15 deletions.
8 changes: 3 additions & 5 deletions src/arctic3d/cli_localise.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,27 +41,25 @@
arctic3d-localise ./example/clustered_interfaces.out \
--scale=2.0
"""

import argparse
import os
import sys
import time
from pathlib import Path

from arctic3d import log

from arctic3d.functions import make_request
from arctic3d.modules.interface import parse_out_partner
from arctic3d.modules.log import add_log_for_CLI
from arctic3d.modules.output import (
# create_barplot,
from arctic3d.modules.output import ( # create_barplot,
create_barplotly,
create_output_folder,
parse_clusters,
setup_output_folder,
write_dict,
)

UNIPROT_API_URL = "https://www.ebi.ac.uk/proteins/api/proteins"
from arctic3d.modules.url import UNIPROT_API_URL

argument_parser = argparse.ArgumentParser()
argument_parser.add_argument(
Expand Down
5 changes: 1 addition & 4 deletions src/arctic3d/modules/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,10 @@
import jsonpickle

from arctic3d.functions import make_request
from arctic3d.modules.url import INTERFACE_URL, LIGAND_URL

log = logging.getLogger("arctic3d.log")

INTERFACE_URL = (
"https://www.ebi.ac.uk/pdbe/graph-api/uniprot/interface_residues"
)
LIGAND_URL = "https://www.ebi.ac.uk/pdbe/graph-api/uniprot/ligand_sites/"
# maximum number of interfaces in interface file
MAX_INTERFACES = 10000

Expand Down
4 changes: 1 addition & 3 deletions src/arctic3d/modules/pdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@

from arctic3d.functions import make_request
from arctic3d.modules.interface_matrix import filter_interfaces
from arctic3d.modules.url import BESTPDB_URL, PDBE_URL

log = logging.getLogger("arctic3d.log")

BESTPDB_URL = "https://www.ebi.ac.uk/pdbe/graph-api/mappings/best_structures"
PDBE_URL = "https://www.ebi.ac.uk/pdbe/entry-files/download"


def _remove_altloc(lines):
# the altloc ID is removed in processed altloc lines
Expand Down
7 changes: 7 additions & 0 deletions src/arctic3d/modules/url.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
UNIPROT_API_URL = "https://www.ebi.ac.uk/proteins/api/proteins"
INTERFACE_URL = (
"https://www.ebi.ac.uk/pdbe/graph-api/uniprot/interface_residues"
)
LIGAND_URL = "https://www.ebi.ac.uk/pdbe/graph-api/uniprot/ligand_sites/"
BESTPDB_URL = "https://www.ebi.ac.uk/pdbe/graph-api/mappings/best_structures"
PDBE_URL = "https://www.ebi.ac.uk/pdbe/entry-files/download"
9 changes: 6 additions & 3 deletions tests/test_apis.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
import pytest
import requests

from arctic3d.cli_localise import UNIPROT_API_URL
from arctic3d.modules.interface import LIGAND_URL
from arctic3d.modules.pdb import BESTPDB_URL, PDBE_URL
from arctic3d.modules.url import ( # noqa
BESTPDB_URL,
LIGAND_URL,
PDBE_URL,
UNIPROT_API_URL,
)

TARGET_UNIPROT = "P07550"
TARGET_PDB = "1crn"
Expand Down

0 comments on commit 66e6948

Please sign in to comment.