Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
fernandomeyer committed May 22, 2023
1 parent f1db022 commit 8a27c64
Show file tree
Hide file tree
Showing 18 changed files with 30 additions and 30 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM python:3.11.3-slim

ADD *.py /usr/local/bin/
ADD src /usr/local/bin/src
ADD src/utils /usr/local/bin/src/utils
ADD cami_amber /usr/local/bin/cami_amber
ADD cami_amber/utils /usr/local/bin/cami_amber/utils
ADD requirements.txt requirements.txt
RUN pip install -r requirements.txt
18 changes: 9 additions & 9 deletions amber.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@
# 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 cami_amber import amber_html
from cami_amber import plot_by_genome
from cami_amber import plots
from cami_amber.utils import load_data
from cami_amber.utils import argparse_parents
from cami_amber.utils import labels as utils_labels
from cami_amber import binning_classes
from cami_amber.utils import load_ncbi_taxinfo
from version import __version__
import argparse
import errno
import logging
Expand All @@ -23,15 +32,6 @@
import pandas as pd
import matplotlib
matplotlib.use('Agg')
from src import amber_html
from src import plot_by_genome
from src import plots
from version import __version__
from src.utils import load_data
from src.utils import argparse_parents
from src.utils import labels as utils_labels
from src import binning_classes
from src.utils import load_ncbi_taxinfo


def get_logger(output_dir, silent):
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions src/amber_html.py → cami_amber/amber_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
import logging
from jinja2 import Template
from statistics import median
from src import plots
from src import binning_classes
from src.utils import labels as utils_labels
from src.utils import load_ncbi_taxinfo
from cami_amber import plots
from cami_amber import binning_classes
from cami_amber.utils import labels as utils_labels
from cami_amber.utils import load_ncbi_taxinfo

import matplotlib
matplotlib.use('Agg')
Expand Down
12 changes: 6 additions & 6 deletions src/binning_classes.py → cami_amber/binning_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@
from abc import ABC, abstractmethod
from collections import defaultdict
from collections import OrderedDict
from src.utils import labels as utils_labels
from src.utils import load_ncbi_taxinfo
from src.utils import ProfilingTools as pf
from src import unifrac_distance as uf
from src import precision_recall_per_bin
from src import plots
from cami_amber.utils import labels as utils_labels
from cami_amber.utils import load_ncbi_taxinfo
from cami_amber.utils import ProfilingTools as pf
from cami_amber import unifrac_distance as uf
from cami_amber import precision_recall_per_bin
from cami_amber import plots


class Metrics:
Expand Down
4 changes: 2 additions & 2 deletions src/plot_by_genome.py → cami_amber/plot_by_genome.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(currentdir)
sys.path.insert(0, parentdir)
from src import plots
from src.utils import labels as utils_labels
from cami_amber import plots
from cami_amber.utils import labels as utils_labels


def plot_by_genome(data, out_file=None, sort_by='completeness'):
Expand Down
6 changes: 3 additions & 3 deletions src/plots.py → cami_amber/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
# 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 src.utils import labels as utils_labels
from src.utils import load_ncbi_taxinfo
from src import binning_classes
from cami_amber.utils import labels as utils_labels
from cami_amber.utils import load_ncbi_taxinfo
from cami_amber import binning_classes
import matplotlib
matplotlib.use('Agg')
import seaborn as sns
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions src/unifrac_distance.py → cami_amber/unifrac_distance.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This is an example of how to use the script
from src.utils import ProfilingTools as PF
from src.utils import EMDUnifrac as EMDU
from cami_amber.utils import ProfilingTools as PF
from cami_amber.utils import EMDUnifrac as EMDU
import numpy as np
import argparse
import copy
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions src/utils/load_data.py → cami_amber/utils/load_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
from multiprocessing.pool import ThreadPool
from collections import defaultdict
from collections import OrderedDict
from src import binning_classes
from src.utils import labels as utils_labels
from cami_amber import binning_classes
from cami_amber.utils import labels as utils_labels

try:
import load_ncbi_taxinfo
Expand Down
File renamed without changes.

0 comments on commit 8a27c64

Please sign in to comment.