From 16c3f3bff759c2a8cf0a2ba1573cfa4fe2d62ec0 Mon Sep 17 00:00:00 2001 From: Caralyn Reisle Date: Tue, 28 Dec 2021 21:49:05 -0800 Subject: [PATCH 01/14] Upgrade networkx to v2 --- setup.py | 2 +- src/mavis/assemble.py | 33 +++++++++++++++++++++------------ tests/unit/test_assemble.py | 19 +++++++++++-------- 3 files changed, 33 insertions(+), 21 deletions(-) diff --git a/setup.py b/setup.py index 015bb674..fdeeaf77 100644 --- a/setup.py +++ b/setup.py @@ -83,7 +83,7 @@ def check_nonpython_dependencies(): 'biopython>=1.70, <1.78', 'braceexpand==0.1.2', 'colour', - 'networkx==1.11.0', + 'networkx>=2.5,<3', 'numpy>=1.13.1', 'pandas>=1.1, <2', 'pysam', diff --git a/src/mavis/assemble.py b/src/mavis/assemble.py index f7a9d301..0370ea01 100644 --- a/src/mavis/assemble.py +++ b/src/mavis/assemble.py @@ -66,6 +66,15 @@ class DeBruijnGraph(nx.DiGraph): enforces edge weights """ + def get_out_edges(self, *args, **kwargs): + return list(self.out_edges(*args, **kwargs)) + + def get_in_edges(self, *args, **kwargs): + return list(self.in_edges(*args, **kwargs)) + + def get_nodes(self, *args, **kwargs): + return list(self.nodes(*args, **kwargs)) + def get_edge_freq(self, n1, n2): """ returns the freq from the data attribute for a specified edge @@ -85,7 +94,7 @@ def add_edge(self, n1, n2, freq=1): nx.DiGraph.add_edge(self, n1, n2, freq=freq) def all_edges(self, *nodes, data=False): - return self.in_edges(*nodes, data=data) + self.out_edges(*nodes, data=data) + return self.get_in_edges(*nodes, data=data) + self.get_out_edges(*nodes, data=data) def trim_tails_by_freq(self, min_weight): """ @@ -95,7 +104,7 @@ def trim_tails_by_freq(self, min_weight): min_weight (int): the minimum weight for an edge to be retained """ ends = sorted( - [n for n in self.nodes() if self.out_degree(n) == 0 or self.in_degree(n) == 0] + [n for n in self.get_nodes() if self.out_degree(n) == 0 or self.in_degree(n) == 0] ) visited = set() @@ -126,16 +135,16 @@ def trim_forks_by_freq(self, min_weight): for all nodes in the graph, if the node has an out-degree > 1 and one of the outgoing edges has freq < min_weight. then that outgoing edge is deleted """ - nodes = [n for n in self.nodes() if self.degree(n) > 2] + nodes = [n for n in self.get_nodes() if self.degree(n) > 2] for node in sorted(nodes): if self.out_degree(node) > 1: - outgoing_edges = self.out_edges(node, data=True) + outgoing_edges = self.get_out_edges(node, data=True) best = max([e[2]['freq'] for e in outgoing_edges]) for src, tgt, data in outgoing_edges: if data['freq'] < min_weight and data['freq'] != best: self.remove_edge(src, tgt) if self.in_degree(node) > 1: - ingoing_edges = self.in_edges(node, data=True) + ingoing_edges = self.get_in_edges(node, data=True) best = max([e[2]['freq'] for e in ingoing_edges]) for src, tgt, data in ingoing_edges: if data['freq'] < min_weight and data['freq'] != best: @@ -157,7 +166,7 @@ def trim_noncutting_paths_by_freq(self, min_weight): else: path = [] while self.in_degree(src) == 1 and self.out_degree(src) == 1: - s, t, data = self.in_edges(src, data=True)[0] + s, t, data = self.get_in_edges(src, data=True)[0] if data['freq'] >= min_weight or s in path: break path.insert(0, src) @@ -165,7 +174,7 @@ def trim_noncutting_paths_by_freq(self, min_weight): path.insert(0, src) while self.in_degree(tgt) == 1 and self.out_degree(tgt) == 1: - s, t, data = self.out_edges(tgt, data=True)[0] + s, t, data = self.get_out_edges(tgt, data=True)[0] if data['freq'] >= min_weight or t in path: break path.append(tgt) @@ -193,7 +202,7 @@ def get_sinks(self, subgraph=None): """ nodeset = set() if subgraph is None: - subgraph = self.nodes() + subgraph = self.get_nodes() for node in subgraph: if self.out_degree(node) == 0: nodeset.add(node) @@ -205,7 +214,7 @@ def get_sources(self, subgraph=None): """ nodeset = set() if subgraph is None: - subgraph = self.nodes() + subgraph = self.get_nodes() for node in subgraph: if self.in_degree(node) == 0: nodeset.add(node) @@ -227,7 +236,7 @@ def digraph_connected_components(graph, subgraph=None): List[List]: returns a list of compnents which are lists of node names """ if subgraph is None: - subgraph = set(graph.nodes()) + subgraph = set(graph.get_nodes()) g = nx.Graph() for src, tgt in graph.edges(): if src in subgraph and tgt in subgraph: @@ -387,7 +396,7 @@ def assemble( for kmer in kmers_list: assembly.add_edge(kmer[:-1], kmer[1:]) # use the ab min edge weight to remove all low weight edges first - nodes = list(assembly.nodes()) + nodes = assembly.get_nodes() for n in nodes: if assembly.in_degree(n) == 0 and assembly.out_degree(n) == 0: assembly.remove_node(n) @@ -396,7 +405,7 @@ def assemble( subgraph = assembly.subgraph(component) if not nx.is_directed_acyclic_graph(subgraph): log('dropping cyclic component', time_stamp=False) - for node in subgraph.nodes(): + for node in subgraph.get_nodes(): assembly.remove_node(node) # initial data cleaning assembly.trim_forks_by_freq(min_edge_trim_weight) diff --git a/tests/unit/test_assemble.py b/tests/unit/test_assemble.py index fbd5d0cb..73b3c6bf 100644 --- a/tests/unit/test_assemble.py +++ b/tests/unit/test_assemble.py @@ -105,7 +105,7 @@ def test_trim_tails_by_freq_forks(self): g.add_edge(8, 7) g.add_edge(9, 8) g.trim_tails_by_freq(2) - assert sorted(g.nodes()) == [1, 2, 3, 4, 5, 6] + assert sorted(g.get_nodes()) == [1, 2, 3, 4, 5, 6] g = DeBruijnGraph() for s, t in itertools.combinations([1, 2, 3, 4, 5, 6], 2): @@ -117,7 +117,7 @@ def test_trim_tails_by_freq_forks(self): g.add_edge(8, 7) g.add_edge(9, 8) g.trim_tails_by_freq(2) - assert sorted(g.nodes()) == [1, 2, 3, 4, 5, 6, 7, 8] + assert sorted(g.get_nodes()) == [1, 2, 3, 4, 5, 6, 7, 8] g = DeBruijnGraph() for s, t in itertools.combinations([1, 2, 3, 4, 5, 6], 2): @@ -128,7 +128,7 @@ def test_trim_tails_by_freq_forks(self): g.add_edge(7, 8) g.add_edge(9, 8) g.trim_tails_by_freq(2) - assert sorted(g.nodes()) == [1, 2, 3, 4, 5, 6] + assert sorted(g.get_nodes()) == [1, 2, 3, 4, 5, 6] def test_add_edge(self): g = DeBruijnGraph() @@ -151,22 +151,25 @@ def test_trim_noncutting_paths_by_freq_degree_stop(self): for edge in g.edges(): print(edge) g.trim_noncutting_paths_by_freq(3) - assert g.nodes() == list(range(1, 9)) + path1[1:-1] + print('g.nodes', g.nodes) + assert g.get_nodes() == list(range(1, 9)) + path1[1:-1] + print('g.nodes', g.nodes) # add an equal weight path to force namesorting path2 = [5, 13, 14, 15, 16, 1] for s, t in zip(path2, path2[1:]): g.add_edge(s, t) - + print('g.nodes', g.nodes) g.trim_noncutting_paths_by_freq(3) - assert g.nodes() == list(range(1, 9)) + path2[1:-1] + print('g.nodes', g.nodes) + assert g.get_nodes() == list(range(1, 9)) + path2[1:-1] # add back the original path with a higher (but still low) weight for s, t in zip(path1, path1[1:]): g.add_edge(s, t, freq=2) g.trim_noncutting_paths_by_freq(3) - assert g.nodes() == list(range(1, 9)) + path1[1:-1] + assert g.get_nodes() == list(range(1, 9)) + path1[1:-1] # add the second path with 1 high weight edge path2 = [5, 13, 14, 15, 16, 1] @@ -175,7 +178,7 @@ def test_trim_noncutting_paths_by_freq_degree_stop(self): g.add_edge(14, 15, freq=6) g.trim_noncutting_paths_by_freq(3) - assert g.nodes() == list(range(1, 9)) + path2[1:-1] + assert g.get_nodes() == list(range(1, 9)) + path2[1:-1] @pytest.fixture From af634de4aafb36e2edeb83855da0ccb91fb8ec81 Mon Sep 17 00:00:00 2001 From: Caralyn Reisle Date: Tue, 28 Dec 2021 21:50:52 -0800 Subject: [PATCH 02/14] Add python 3.9/3.10 to workflows --- .github/workflows/build.yml | 2 +- .github/workflows/quick-tests.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 17b952f1..b5809403 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.7", "3.8"] + python-version: ["3.7", "3.8", "3.9", "3.10"] name: python-${{ matrix.python-version }} steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/quick-tests.yml b/.github/workflows/quick-tests.yml index 178eab7b..a1d333b4 100644 --- a/.github/workflows/quick-tests.yml +++ b/.github/workflows/quick-tests.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.7", "3.8"] + python-version: ["3.7", "3.8", "3.9", "3.10"] name: python-${{ matrix.python-version }} quick steps: - uses: actions/checkout@v2 From 21366907cb1706941f77f70a599afde2a3c1f628 Mon Sep 17 00:00:00 2001 From: Caralyn Reisle Date: Tue, 28 Dec 2021 21:51:08 -0800 Subject: [PATCH 03/14] do not include docs/tests in dist --- MANIFEST.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index 2ab6e3c1..c1af92d1 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,5 @@ recursive-include src *.py *.json include README.md include LICENSE -prune docs/build -prune docs/source/auto +prune docs +prune tests From a9415e28d99fa95b70afbb4a4011123db091849b Mon Sep 17 00:00:00 2001 From: Caralyn Reisle Date: Tue, 28 Dec 2021 21:52:23 -0800 Subject: [PATCH 04/14] Remove m2r dependency --- setup.py | 34 ++++++---------------------------- 1 file changed, 6 insertions(+), 28 deletions(-) diff --git a/setup.py b/setup.py index fdeeaf77..6cb7600d 100644 --- a/setup.py +++ b/setup.py @@ -1,37 +1,14 @@ import os import re +from pathlib import Path from setuptools import find_packages, setup +this_directory = Path(__file__).parent +long_description = (this_directory / "README.md").read_text() VERSION = '2.2.8' -def parse_md_readme(): - """ - pypi won't render markdown. After conversion to rst it will still not render unless raw directives are removed - """ - try: - from m2r import parse_from_file - - rst_lines = parse_from_file('README.md').split('\n') - long_description = [ - '.. image:: http://mavis.bcgsc.ca/docs/latest/_static/acronym.svg\n\n|\n' - ] # backup since pip can't handle raw directives - i = 0 - while i < len(rst_lines): - if re.match(r'^..\s+raw::.*', rst_lines[i]): - i += 1 - while re.match(r'^(\s\s+|\t|$).*', rst_lines[i]): - i += 1 - else: - long_description.append(re.sub('>`_ ', '>`__ ', rst_lines[i])) # anonymous links - i += 1 - long_description = '\n'.join(long_description) - except (ImportError, OSError): - long_description = '' - return long_description - - def check_nonpython_dependencies(): """ check that the non-python dependencies have been installed. @@ -92,7 +69,7 @@ def check_nonpython_dependencies(): 'mavis_config>=1.1.0, <2.0.0', ] -DEPLOY_REQS = ['twine', 'm2r', 'wheel'] +DEPLOY_REQS = ['twine', 'wheel'] setup( @@ -103,7 +80,8 @@ def check_nonpython_dependencies(): package_dir={'': 'src'}, packages=find_packages(where='src'), description='A Structural Variant Post-Processing Package', - long_description=parse_md_readme(), + long_description=long_description, + long_description_content_type='text/markdown', install_requires=INSTALL_REQS, extras_require={ 'docs': DOC_REQS, From dd6f0e1b59c6944311e7f6f7be0557c95a9a6d19 Mon Sep 17 00:00:00 2001 From: Caralyn Reisle Date: Tue, 28 Dec 2021 21:58:07 -0800 Subject: [PATCH 05/14] Fix mapping import for 3.10 --- src/mavis/schemas/__init__.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/mavis/schemas/__init__.py b/src/mavis/schemas/__init__.py index a0568bac..f41bda5c 100644 --- a/src/mavis/schemas/__init__.py +++ b/src/mavis/schemas/__init__.py @@ -1,10 +1,14 @@ -import collections +try: + from collections import Mapping +except ImportError: + from collections.abc import Mapping + import os from snakemake.utils import validate as snakemake_validate -class ImmutableDict(collections.Mapping): +class ImmutableDict(Mapping): def __init__(self, data): self._data = data From b53ff6476a833104df104b8f950bf81b80957041 Mon Sep 17 00:00:00 2001 From: Jeremy Fan Date: Tue, 28 Dec 2021 14:52:44 -0800 Subject: [PATCH 06/14] added edited toml files --- pyproject.toml | 1 + setup.cfg | 95 +++++++++++++++++++++++++++++++++++++++++++------- setup.py | 83 ++----------------------------------------- 3 files changed, 85 insertions(+), 94 deletions(-) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..9e5a9848 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1 @@ +build-backend = "setuptools.build_meta" diff --git a/setup.cfg b/setup.cfg index afe52b99..2459069c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,23 +1,92 @@ -[nosetests] -with-coverage=1 -cover-package=mavis,tab -cover-html=1 -cover-html-dir=coverage -cover-inclusive=1 -cover-erase=1 -processes=2 -process-timeout=600 - [metadata] -description-file = README.md +name = mavis +version = 2.2.10 +url = https://github.com/bcgsc/mavis.git +download_url = https://github.com/bcgsc/mavis/archive/v2.2.10.tar.gz +description = A Structural Variant Post-Processing Package +author_email = creisle@bcgsc.ca +author = Caralyn Reisle +maintainer_email = creisle@bcgsc.ca +maintainer = Caralyn Reisle +long_description = file: README.md, LICENSE +long_description_content_type = text/markdown license_file = LICENSE +project_urls = mavis = http://mavis.bcgsc.ca [bdist_wheel] universal = 1 [pycodestyle] -ignore = E501,W503,E203 +ignore = E501 + W503 + E203 statistics = True [flake8] -ignore = E501,W503,E203 +ignore = E501 + W503 + E203 + +[options] +packages = find: +python_requires = >=3.2 +dependency_links = [] +include_package_data = True +install_requires = + Distance>=0.1.3 + Shapely>=1.6.4.post1 + biopython>=1.70, <1.78 + braceexpand==0.1.2 + colour + networkx>=2.5,<3 + numpy>=1.13.1 + pysam + shortuuid>=0.5.0 + svgwrite +setup_requires = + pip>=9.0.0 + setuptools>=36.0.0 + +[options.packages.find] +exclude = + tests + +[options.extras_require] +doc = + mkdocs==1.1.2 + markdown-refdocs + mkdocs-material==5.4.0 + markdown-include + mkdocs-simple-hooks==0.1.2 +test = + timeout-decorator>=0.3.3 + coverage>=4.2 + pycodestyle>=2.3.1 + pytest + pytest-cov +dev = + black + flake8 + twine + wheel + timeout-decorator>=0.3.3 + coverage>=4.2 + pycodestyle>=2.3.1 + pytest + pytest-cov + mkdocs==1.1.2 + markdown-refdocs + mkdocs-material==5.4.0 + markdown-include + mkdocs-simple-hooks==0.1.2 +deploy = + twine + wheel +tools = + pyensembl + simplejson + +[options.entry_points] +console_scripts = + mavis = mavis.main:main + calculate_ref_alt_counts = tools.calculate_ref_alt_counts:main diff --git a/setup.py b/setup.py index 6cb7600d..853de05b 100644 --- a/setup.py +++ b/setup.py @@ -1,12 +1,7 @@ import os import re -from pathlib import Path -from setuptools import find_packages, setup - -this_directory = Path(__file__).parent -long_description = (this_directory / "README.md").read_text() -VERSION = '2.2.8' +from setuptools import setup def check_nonpython_dependencies(): @@ -31,79 +26,5 @@ def check_nonpython_dependencies(): print('Found: aligner at', pth) -# HSTLIB is a dependency for pysam. -# The cram file libraries fail for some OS versions and mavis does not use cram files so we disable these options -os.environ['HTSLIB_CONFIGURE_OPTIONS'] = '--disable-lzma --disable-bz2 --disable-libcurl' - - -TEST_REQS = [ - 'timeout-decorator>=0.3.3', - 'coverage>=4.2', - 'pycodestyle>=2.3.1', - 'pytest', - 'pytest-cov', -] - - -DOC_REQS = [ - 'mkdocs==1.1.2', - 'markdown_refdocs', - 'mkdocs-material==5.4.0', - 'markdown-include', - 'mkdocs-simple-hooks==0.1.2', -] - - -INSTALL_REQS = [ - 'Distance>=0.1.3', - 'Shapely>=1.6.4.post1', - 'biopython>=1.70, <1.78', - 'braceexpand==0.1.2', - 'colour', - 'networkx>=2.5,<3', - 'numpy>=1.13.1', - 'pandas>=1.1, <2', - 'pysam', - 'shortuuid>=0.5.0', - 'svgwrite', - 'mavis_config>=1.1.0, <2.0.0', -] - -DEPLOY_REQS = ['twine', 'wheel'] - - -setup( - name='mavis', - version='{}'.format(VERSION), - url='https://github.com/bcgsc/mavis.git', - download_url='https://github.com/bcgsc/mavis/archive/v{}.tar.gz'.format(VERSION), - package_dir={'': 'src'}, - packages=find_packages(where='src'), - description='A Structural Variant Post-Processing Package', - long_description=long_description, - long_description_content_type='text/markdown', - install_requires=INSTALL_REQS, - extras_require={ - 'docs': DOC_REQS, - 'test': TEST_REQS, - 'dev': ['black==20.8b1', 'flake8'] + DOC_REQS + TEST_REQS + DEPLOY_REQS, - 'deploy': DEPLOY_REQS, - 'tools': ['pyensembl', 'simplejson'], - }, - tests_require=TEST_REQS, - setup_requires=['pip>=9.0.0', 'setuptools>=36.0.0'], - python_requires='>=3.7', - author='Caralyn Reisle', - author_email='creisle@bcgsc.ca', - test_suite='tests', - entry_points={ - 'console_scripts': [ - 'mavis = mavis.main:main', - 'calculate_ref_alt_counts = tools.calculate_ref_alt_counts:main', - ] - }, - include_package_data=True, - data_files=[('mavis', ['src/mavis/schemas/config.json', 'src/mavis/schemas/overlay.json'])], - project_urls={'mavis': 'http://mavis.bcgsc.ca'}, -) +setup() check_nonpython_dependencies() From a646440e548775d86efa6756def4c1448a4a5d14 Mon Sep 17 00:00:00 2001 From: Caralyn Reisle Date: Tue, 28 Dec 2021 22:33:57 -0800 Subject: [PATCH 07/14] Swap maintainer to mavis email alias --- setup.cfg | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.cfg b/setup.cfg index 2459069c..c8f751e8 100644 --- a/setup.cfg +++ b/setup.cfg @@ -6,9 +6,9 @@ download_url = https://github.com/bcgsc/mavis/archive/v2.2.10.tar.gz description = A Structural Variant Post-Processing Package author_email = creisle@bcgsc.ca author = Caralyn Reisle -maintainer_email = creisle@bcgsc.ca -maintainer = Caralyn Reisle -long_description = file: README.md, LICENSE +maintainer_email = mavis@bcgsc.ca +maintainer = mavis +long_description = file: README.md long_description_content_type = text/markdown license_file = LICENSE project_urls = mavis = http://mavis.bcgsc.ca From 0970918a4770c9765ae11cb4f58425bc3290a62f Mon Sep 17 00:00:00 2001 From: Caralyn Reisle Date: Tue, 28 Dec 2021 22:42:41 -0800 Subject: [PATCH 08/14] Specify src dir for install --- setup.cfg | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/setup.cfg b/setup.cfg index c8f751e8..8b1a07da 100644 --- a/setup.cfg +++ b/setup.cfg @@ -29,7 +29,9 @@ ignore = E501 [options] packages = find: -python_requires = >=3.2 +package_dir = + = src +python_requires = >=3.7 dependency_links = [] include_package_data = True install_requires = @@ -48,8 +50,8 @@ setup_requires = setuptools>=36.0.0 [options.packages.find] -exclude = - tests +exclude = tests +where = src [options.extras_require] doc = From 2cf3065ab69b99004cc3590f084c3223706e952f Mon Sep 17 00:00:00 2001 From: Caralyn Reisle Date: Tue, 28 Dec 2021 22:47:03 -0800 Subject: [PATCH 09/14] Add v3 dependencies --- setup.cfg | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/setup.cfg b/setup.cfg index 8b1a07da..b5cfe3a3 100644 --- a/setup.cfg +++ b/setup.cfg @@ -35,14 +35,16 @@ python_requires = >=3.7 dependency_links = [] include_package_data = True install_requires = - Distance>=0.1.3 - Shapely>=1.6.4.post1 biopython>=1.70, <1.78 braceexpand==0.1.2 colour + Distance>=0.1.3 + mavis_config>=1.1.0, <2.0.0 networkx>=2.5,<3 numpy>=1.13.1 + pandas>=1.1, <2 pysam + Shapely>=1.6.4.post1 shortuuid>=0.5.0 svgwrite setup_requires = From f16b17492371557bedd725d93e5ad4e139cac0b7 Mon Sep 17 00:00:00 2001 From: Caralyn Reisle Date: Tue, 4 Jan 2022 11:34:57 -0800 Subject: [PATCH 10/14] Add typing extensions as dependency --- setup.cfg | 1 + src/mavis/tools/vcf.py | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index b5cfe3a3..a34fc7ef 100644 --- a/setup.cfg +++ b/setup.cfg @@ -47,6 +47,7 @@ install_requires = Shapely>=1.6.4.post1 shortuuid>=0.5.0 svgwrite + typing_extensions>=4 setup_requires = pip>=9.0.0 setuptools>=36.0.0 diff --git a/src/mavis/tools/vcf.py b/src/mavis/tools/vcf.py index 77a2e22a..f87aa764 100644 --- a/src/mavis/tools/vcf.py +++ b/src/mavis/tools/vcf.py @@ -5,7 +5,12 @@ import pandas as pd from pysam import VariantFile -from typing_extensions import TypedDict + +try: + # TypedDict added to typing package directly in later versions + from typing import TypedDict +except ImportError: + from typing_extensions import TypedDict from ..constants import COLUMNS, ORIENT, SVTYPE from ..util import DEVNULL From 967bdb481b49001ba62a1d7473e45b1debd8dd91 Mon Sep 17 00:00:00 2001 From: Caralyn Reisle Date: Tue, 4 Jan 2022 11:50:34 -0800 Subject: [PATCH 11/14] Try being more explicit about json in manifest --- MANIFEST.in | 1 + 1 file changed, 1 insertion(+) diff --git a/MANIFEST.in b/MANIFEST.in index c1af92d1..691ef59e 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,5 @@ recursive-include src *.py *.json +include src/mavis/schemas/*.json include README.md include LICENSE prune docs From c3363cc55072035bf3754279f4571e136647b3a0 Mon Sep 17 00:00:00 2001 From: Caralyn Reisle Date: Tue, 4 Jan 2022 12:16:14 -0800 Subject: [PATCH 12/14] Copy manifest and pyproject.toml to docker container --- Dockerfile | 2 ++ MANIFEST.in | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index d3fbd1f4..b62ea761 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,6 +28,8 @@ RUN wget http://hgdownload.soe.ucsc.edu/admin/exe/linux.x86_64/blat/blat && \ COPY setup.py setup.py COPY setup.cfg setup.cfg +COPY MANIFEST.in MANIFEST.in +COPY pyproject.toml pyproject.toml COPY src src COPY LICENSE LICENSE COPY README.md README.md diff --git a/MANIFEST.in b/MANIFEST.in index 691ef59e..c1af92d1 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,4 @@ recursive-include src *.py *.json -include src/mavis/schemas/*.json include README.md include LICENSE prune docs From 86b046fe9f81e4a5c2ed5e2621093e0f36276ed4 Mon Sep 17 00:00:00 2001 From: Caralyn Reisle Date: Tue, 4 Jan 2022 12:42:14 -0800 Subject: [PATCH 13/14] Create editable copy of subgraph In networkx v2 subgraphs are frozen and must be copied to be edited --- src/mavis/assemble.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mavis/assemble.py b/src/mavis/assemble.py index 0370ea01..0683dbad 100644 --- a/src/mavis/assemble.py +++ b/src/mavis/assemble.py @@ -418,7 +418,7 @@ def assemble( # pull the path scores path_scores.update( pull_contigs_from_component( - assembly.subgraph(component), + assembly.subgraph(component).copy(), component, min_edge_trim_weight=min_edge_trim_weight, assembly_max_paths=assembly_max_paths, From ca06372fe0d88b257981632b34fb52af4c54420d Mon Sep 17 00:00:00 2001 From: Caralyn Reisle Date: Tue, 4 Jan 2022 13:04:10 -0800 Subject: [PATCH 14/14] Increase assembly timeout to account for new graph copy requirement --- tests/integration/test_assemble.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/test_assemble.py b/tests/integration/test_assemble.py index 8cae4394..6930b685 100644 --- a/tests/integration/test_assemble.py +++ b/tests/integration/test_assemble.py @@ -351,7 +351,7 @@ def test_multiple_events(self): assert assemblies[0].seq == expected assert len(assemblies) == 1 - @timeout_decorator.timeout(300) + @timeout_decorator.timeout(600) @long_running_test def test_large_assembly(self, large_assembly_seq): # simply testing that this will complete before the timeout