-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from aertslab/gpu-opt
Gpu opt
- Loading branch information
Showing
7 changed files
with
638 additions
and
391 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,22 @@ | ||
from loguru import logger | ||
|
||
from ._contribution_scores import contribution_scores | ||
from ._modisco_results import modisco_results, create_clustermap | ||
|
||
|
||
def _optional_function_warning(*args, **kwargs): | ||
logger.error( | ||
"The requested functionality requires the 'tfmodisco' package, which is not installed. " | ||
"Please install it with `pip install crested[tfmodisco]`.", | ||
) | ||
|
||
|
||
try: | ||
from ._modisco_results import create_clustermap, modisco_results | ||
except ImportError: | ||
modisco_results = _optional_function_warning | ||
create_clustermap = _optional_function_warning | ||
|
||
if modisco_results is not None: | ||
__all__ = ["contribution_scores", "modisco_results", "create_clustermap"] | ||
else: | ||
__all__ = ["contribution_scores"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,55 @@ | ||
from loguru import logger | ||
|
||
from . import data, losses, metrics, zoo | ||
from ._configs import TaskConfig, default_configs | ||
from ._crested import Crested | ||
from ._tfmodisco import tfmodisco, match_h5_files_to_classes, process_patterns, create_pattern_matrix, generate_nucleotide_sequences | ||
|
||
|
||
def _optional_function_warning(*args, **kwargs): | ||
logger.error( | ||
"The requested functionality requires the 'tfmodisco' package, which is not installed. " | ||
"Please install it with `pip install crested[tfmodisco]`.", | ||
) | ||
|
||
|
||
# Conditional import for tfmodisco since optional | ||
try: | ||
from ._tfmodisco import ( | ||
create_pattern_matrix, | ||
generate_nucleotide_sequences, | ||
match_h5_files_to_classes, | ||
process_patterns, | ||
tfmodisco, | ||
) | ||
except ImportError: | ||
create_pattern_matrix = _optional_function_warning | ||
generate_nucleotide_sequences = _optional_function_warning | ||
match_h5_files_to_classes = _optional_function_warning | ||
process_patterns = _optional_function_warning | ||
tfmodisco = _optional_function_warning | ||
|
||
if tfmodisco is not None: | ||
__all__ = [ | ||
"data", | ||
"losses", | ||
"metrics", | ||
"zoo", | ||
"TaskConfig", | ||
"default_configs", | ||
"Crested", | ||
"create_pattern_matrix", | ||
"generate_nucleotide_sequences", | ||
"match_h5_files_to_classes", | ||
"process_patterns", | ||
"tfmodisco", | ||
] | ||
else: | ||
__all__ = [ | ||
"data", | ||
"losses", | ||
"metrics", | ||
"zoo", | ||
"TaskConfig", | ||
"default_configs", | ||
"Crested", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.