Showing 82 of 82 total issues
Function motifs
has a Cognitive Complexity of 52 (exceeds 15 allowed). Consider refactoring. Open
def motifs(args):
"""Calculate ROC_AUC and other metrics and optionally plot ROC curve."""
if args.outdir is None:
raise ValueError("an output directory is required!")
if not os.path.exists(args.outdir):
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Motif
has 46 functions (exceeds 20 allowed). Consider refactoring. Open
class Motif(object):
"""
Representation of a transcription factor binding motif.
Function calc_stats_iterator
has a Cognitive Complexity of 49 (exceeds 15 allowed). Consider refactoring. Open
def calc_stats_iterator(
fg_file=None,
bg_file=None,
fg_table=None,
bg_table=None,
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function cluster_motifs
has a Cognitive Complexity of 47 (exceeds 15 allowed). Consider refactoring. Open
def cluster_motifs(
motifs,
match="total",
metric="wic",
combine="mean",
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function cli
has 136 lines of code (exceeds 25 allowed). Consider refactoring. Open
def cli(sys_args):
config = MotifConfig()
params = config.get_default_params()
default_pfm_file = os.path.join(config.get_motif_dir(), params["motif_db"])
default_pfm = params["motif_db"]
Function set_meanstd
has a Cognitive Complexity of 41 (exceeds 15 allowed). Consider refactoring. Open
def set_meanstd(self, gc=False):
if not self.background:
self.set_background(gc=gc)
self.meanstd = {}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function plot_ensembl_logo
has a Cognitive Complexity of 37 (exceeds 15 allowed). Consider refactoring. Open
def plot_ensembl_logo(self, fname=None, ic=True, title=True, letters=True, height=2):
"""Plot motif logo.
This is an implementation of the logo presented here:
http://www.ensembl.info/2018/10/15/new-ensembl-motif-features/
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function parse
has a Cognitive Complexity of 34 (exceeds 15 allowed). Consider refactoring. Open
def parse(self, fo):
"""
Convert MEME output to motifs
Parameters
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function parse
has a Cognitive Complexity of 34 (exceeds 15 allowed). Consider refactoring. Open
def parse(self, fo):
"""
Convert MEME output to motifs
Parameters
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function moap
has a Cognitive Complexity of 33 (exceeds 15 allowed). Consider refactoring. Open
def moap(
inputfile,
method="hypergeom",
scoring=None,
outfile=None,
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
ExtraStyler
has 26 functions (exceeds 20 allowed). Consider refactoring. Open
class ExtraStyler(Styler):
"""
Extra styles for a DataFrame or Series based on pandas.styler using HTML and CSS.
"""
Scanner
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
class Scanner(object):
"""
scan sequences with motifs
"""
MotifConfig
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class MotifConfig(object):
"""Configuration object for the gimmemotifs module."""
# Borg design pattern: all instances of this class will have the same attributes
__shared_state = {}
Function set_threshold
has a Cognitive Complexity of 28 (exceeds 15 allowed). Consider refactoring. Open
def set_threshold(self, fpr=None, threshold=None, gc=False):
"""Set motif scanning threshold based on background sequences.
Parameters
----------
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function diff_plot
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
def diff_plot(
motifs,
pwms,
names,
freq,
Function get_all_scores
has a Cognitive Complexity of 27 (exceeds 15 allowed). Consider refactoring. Open
def get_all_scores(
self,
motifs,
dbmotifs,
match,
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function load_orthogroups_in_db
has a Cognitive Complexity of 27 (exceeds 15 allowed). Consider refactoring. Open
def load_orthogroups_in_db(db, genomes, orthofinder_result):
"""
Save the results of orthofinder (tsv file) in a relational database
(SQLite). This makes it possible to easily switch between genes and
orthogroups.
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function set_background
has a Cognitive Complexity of 26 (exceeds 15 allowed). Consider refactoring. Open
def set_background(
self, fname=None, genome=None, size=200, nseq=None, gc=False, gc_bins=None
):
"""Set the background to use for FPR and z-score calculations.
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function compare_motifs
has a Cognitive Complexity of 25 (exceeds 15 allowed). Consider refactoring. Open
def compare_motifs(
self, m1, m2, match="total", metric="wic", combine="mean", pval=False
):
"""Compare two motifs.
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function make_motif2factors
has a Cognitive Complexity of 25 (exceeds 15 allowed). Consider refactoring. Open
def make_motif2factors(
prefix,
new_reference,
database_references,
motifsandfactors,
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"