Skip to content

Commit

Permalink
check analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
dadegrande99 committed Jul 5, 2024
1 parent a000493 commit 3002875
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions alignmentfreegraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class AlignmentFreeGraph(DBManager):
"""

def __init__(self, location: str = None, db_name: str = None, username: str = None,
password: str = None, configuration: [dict, str] = None, k: int = 3): # type: ignore
password: str = None, configuration: [dict, str] = None, k: int = 3, check_acycle: bool = False): # type: ignore
"""
Alignment-Free Sequence to Graph constructor
Expand All @@ -33,7 +33,7 @@ def __init__(self, location: str = None, db_name: str = None, username: str = No
:raises ValueError: If k is less than 1
"""

self.check_acycle = check_acycle
super().__init__(location, db_name, username, password, configuration)
if k < 1:
raise ValueError("k must be greater than 1")
Expand All @@ -50,12 +50,12 @@ def connect(self, location: str = None, db_name: str = None,
:return: True if the connection is successful
"""

if super().connect(location, db_name, username, password, configuration):
if self.is_acyclic():
return True
else:
raise ValueError("Graph must be acyclic")
if self.check_acycle:
if self.is_acyclic():
return True
else:
raise ValueError("Graph must be acyclic")

def compute_hashtable(self, k: int = None):
"""
Expand Down

0 comments on commit 3002875

Please sign in to comment.