Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
from multiqc.modules.base_module import BaseMultiqcModule
import logging
from collections import OrderedDict
from multiqc import config
from multiqc.plots import bargraph
log = logging.getLogger(__name__)
class MultiqcModule(BaseMultiqcModule):
def __init__(self):
# Initialise the parent object
super(MultiqcModule, self).__init__(name='HiCExplorer', anchor='hicexplorer',
href="https://hicexplorer.readthedocs.io",
info=" addresses the common tasks of Hi-C analysis from processing to visualization.")
self.mod_data = dict()
for file in self.find_log_files('hicexplorer'):
if file['s_name'] != "QC_table":
s_name = file['root'] + "_" + file['s_name']
self.mod_data[s_name] = self.parse_logs(file['f'])
self.mod_data[s_name]['File'][0] = self.clean_s_name(file['root'] + "_" + s_name + "_" + self.mod_data[s_name]['File'][0], file['root'])
self.add_data_source(file)
#!/usr/bin/env python
""" MultiQC module to parse output from Flexbar """
from __future__ import print_function
from collections import OrderedDict
import logging
import re
from multiqc.plots import bargraph
from multiqc.modules.base_module import BaseMultiqcModule
# Initialise the logger
log = logging.getLogger(__name__)
class MultiqcModule(BaseMultiqcModule):
def __init__(self):
# Initialise the parent object
super(MultiqcModule, self).__init__(name='Flexbar', anchor='flexbar',
href='https://github.com/seqan/flexbar',
info="is a barcode and adapter removal tool.")
# Parse logs
self.flexbar_data = dict()
for f in self.find_log_files('flexbar', filehandles=True):
self.parse_flexbar(f)
# Filter to strip out ignored sample names
self.flexbar_data = self.ignore_samples(self.flexbar_data)
""" MultiQC module to parse output from methylQA """
from __future__ import print_function
from collections import OrderedDict
import logging
import os
import re
from multiqc.plots import linegraph
from multiqc.modules.base_module import BaseMultiqcModule
# Initialise the logger
log = logging.getLogger(__name__)
class MultiqcModule(BaseMultiqcModule):
def __init__(self):
# Initialise the parent object
super(MultiqcModule, self).__init__(name='methylQA', anchor='methylqa',
target='methylQA', href="http://methylqa.sourceforge.net/",
info=" - a methylation sequencing data quality assessment tool.")
# Find and load any methylQA reports
self.methylqa_data = dict()
self.methylqa_coverage_counts = dict()
self.methylqa_coverage_percentages = dict()
for f in self.find_log_files('methylQA'):
self.parse_methylqa_logs(f)
# Filter to strip out ignored sample names
#!/usr/bin/env python
""" MultiQC module to parse output from HiCUP """
from __future__ import print_function
from collections import OrderedDict
import logging
from multiqc import config
from multiqc.plots import bargraph
from multiqc.modules.base_module import BaseMultiqcModule
# Initialise the logger
log = logging.getLogger(__name__)
class MultiqcModule(BaseMultiqcModule):
""" HiCUP module, parses log files saved by HiCUP. """
def __init__(self):
# Initialise the parent object
super(MultiqcModule, self).__init__(name='HiCUP', anchor='hicup',
href='http://www.bioinformatics.babraham.ac.uk/projects/hicup/',
info="(Hi-C User Pipeline) is a tool for mapping and performing "\
"quality control on Hi-C data.")
# Find and load any HiCUP summary reports
self.hicup_data = dict()
for f in self.find_log_files('hicup'):
self.parse_hicup_logs(f)
# Filter to strip out ignored sample names
#!/usr/bin/env python
""" MultiQC module to parse output from sequana"""
import logging
import os
import re
from multiqc import config
from multiqc.modules.base_module import BaseMultiqcModule
from multiqc.plots import linegraph, table, heatmap, bargraph
log = logging.getLogger('multiqc.sequana/quality_control')
class MultiqcModule(BaseMultiqcModule):
def __init__(self):
# Initialise the parent object
super(MultiqcModule, self).__init__(
name='Sequana/quality_control',
anchor='sequana_quality_control',
target='sequana_quality_control',
href='http://github.com/sequana/sequana/',
info="(sequana pipelines)")
self.data = {}
for myfile in self.find_log_files("sequana/quality_control"):
thisdata = self.parse_logs(myfile["f"])
name = thisdata["project"]
self.data[name] = self.parse_logs(myfile["f"])
""" MultiQC module to parse output from Samblaster """
from __future__ import print_function
import os
from collections import OrderedDict
import logging
import re
from multiqc.plots import bargraph
from multiqc.modules.base_module import BaseMultiqcModule
# Initialise the logger
log = logging.getLogger(__name__)
class MultiqcModule(BaseMultiqcModule):
""" Samblaster """
def __init__(self):
# Initialise the parent object
super(MultiqcModule, self).__init__(name='Samblaster', anchor='samblaster',
href="https://github.com/GregoryFaust/samblaster",
info="is a tool to mark duplicates and extract discordant and split reads from sam files.")
self.samblaster_data = dict()
for f in self.find_log_files('samblaster', filehandles=True):
self.parse_samblaster(f)
# Filter to strip out ignored sample names
self.samblaster_data = self.ignore_samples(self.samblaster_data)
if len(self.samblaster_data) == 0:
import logging
import os
import re
from collections import defaultdict
import yaml
from multiqc import config
from multiqc.modules.base_module import BaseMultiqcModule
from multiqc.plots import linegraph, table, heatmap, bargraph
#from multiqc_sequana import srna
# Initialise the logger
log = logging.getLogger('multiqc.sequana/pacbio_qc')
class MultiqcModule(BaseMultiqcModule):
def __init__(self):
# Initialise the parent object
super(MultiqcModule, self).__init__(
name='Sequana/pacbio', # name that appears at the top
anchor='sequana', # ??
target='sequana', # Name show that link to the following href
href='http://github.com/sequana/sequana/',
info="pipelines multi Summary")
self.sequana_data = {}
for myfile in self.find_log_files("sequana/pacbio_qc"):
#print( myfile['f'] ) # File contents
#print( myfile['s_name'] ) # Sample name (from cleaned filename)
#print( myfile['fn'] ) # Filename
else:
log.info("{}: Found {} samples ({})".format(module_id, len(mod['data']), mod['config'].get('plot_type')))
# Sort sections if we have a config option for order
mod_order = getattr(config, 'custom_content', {}).get('order', [])
sorted_modules = [parsed_mod for parsed_mod in parsed_modules if parsed_mod.anchor not in mod_order ]
sorted_modules.extend([parsed_mod for mod_id in mod_order for parsed_mod in parsed_modules if parsed_mod.anchor == mod_id ])
# If we only have General Stats columns then there are no module outputs
if len(sorted_modules) == 0:
raise UserWarning
return sorted_modules
class MultiqcModule(BaseMultiqcModule):
""" Module class, used for each custom content type """
def __init__(self, c_id, mod):
modname = mod['config'].get('section_name', c_id.replace('_', ' ').title())
if modname == '' or modname is None:
modname = 'Custom Content'
# Initialise the parent object
super(MultiqcModule, self).__init__(
name = modname,
anchor = mod['config'].get('section_anchor', c_id),
href = mod['config'].get('section_href'),
info = mod['config'].get('description')
)
#!/usr/bin/env python
""" MultiQC module to parse output from Preseq """
from __future__ import print_function
import logging
import numpy as np
from multiqc import config
from multiqc.plots import linegraph
from multiqc.modules.base_module import BaseMultiqcModule
# Initialise the logger
log = logging.getLogger(__name__)
class MultiqcModule(BaseMultiqcModule):
def __init__(self):
# Initialise the parent object
super(MultiqcModule, self).__init__(name='Preseq', anchor='preseq',
href='http://smithlabresearch.org/software/preseq/',
info="""estimates the complexity of a library, showing how many additional
unique reads are sequenced for increasing total read count.
A shallow curve indicates complexity saturation. The dashed line
shows a perfectly complex library where total reads = unique reads.""")
# Find and load any Preseq reports
self.preseq_data = dict()
self.axis_label = ''
self.counts_in_1x = None
for f in self.find_log_files('preseq'):
""" MultiQC module to parse output from HOMER """
from __future__ import print_function
from collections import OrderedDict
import logging
from multiqc.modules.base_module import BaseMultiqcModule
# Import the HOMER submodules
from .findpeaks import FindPeaksReportMixin
from .tagdirectory import TagDirReportMixin
# Initialise the logger
log = logging.getLogger(__name__)
class MultiqcModule(BaseMultiqcModule, FindPeaksReportMixin, TagDirReportMixin):
""" HOMER has a number of different commands and outputs.
This MultiQC module supports some but not all. The code for
each script is split into its own file and adds a section to
the module output if logs are found. """
def __init__(self):
# Initialise the parent object
super(MultiqcModule, self).__init__(name='HOMER', anchor='homer',
href='http://homer.ucsd.edu/homer/',
info="is a suite of tools for Motif Discovery and next-gen sequencing analysis.")
# Set up class objects to hold parsed data
self.general_stats_headers = OrderedDict()
self.general_stats_data = dict()