本文整理汇总了Python中multiqc.plots.linegraph.plot函数的典型用法代码示例。如果您正苦于以下问题:Python plot函数的具体用法?Python plot怎么用?Python plot使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了plot函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: threeprime_plot
def threeprime_plot(self):
"""Generate a 3' G>A linegraph plot"""
data = dict()
dict_to_add = dict()
# Create tuples out of entries
for key in self.threepGtoAfreq_data:
pos = list(range(1,len(self.threepGtoAfreq_data.get(key))))
#Multiply values by 100 to get %
tmp = [i * 100.0 for i in self.threepGtoAfreq_data.get(key)]
tuples = list(zip(pos,tmp))
# Get a dictionary out of it
data = dict((x, y) for x, y in tuples)
dict_to_add[key] = data
config = {
'id': 'threeprime_misinc_plot',
'title': 'DamageProfiler: 3P G>A misincorporation plot',
'ylab': '% G to A substituted',
'xlab': 'Nucleotide position from 3\'',
'tt_label': '{point.y:.2f} % G>A misincorporations at nucleotide position {point.x}',
'ymin': 0,
'xmin': 1
}
return linegraph.plot(dict_to_add,config)
开发者ID:vladsaveliev,项目名称:MultiQC,代码行数:26,代码来源:damageprofiler.py
示例2: coverage_lineplot
def coverage_lineplot (self):
""" Make HTML for coverage line plots """
# Add line graph to section
data = list()
data_labels = list()
if len(self.rna_seqc_norm_high_cov) > 0:
data.append(self.rna_seqc_norm_high_cov)
data_labels.append({'name': 'High Expressed'})
if len(self.rna_seqc_norm_medium_cov) > 0:
data.append(self.rna_seqc_norm_medium_cov)
data_labels.append({'name': 'Medium Expressed'})
if len(self.rna_seqc_norm_low_cov) > 0:
data.append(self.rna_seqc_norm_low_cov)
data_labels.append({'name': 'Low Expressed'})
pconfig = {
'id': 'rna_seqc_mean_coverage_plot',
'title': 'RNA-SeQC: Gene Body Coverage',
'ylab': '% Coverage',
'xlab': "Gene Body Percentile (5' -> 3')",
'xmin': 0,
'xmax': 100,
'tt_label': "<strong>{point.x}% from 5'</strong>: {point.y:.2f}",
'data_labels': data_labels
}
if len(data) > 0:
self.add_section (
name = 'Gene Body Coverage',
anchor = 'rseqc-rna_seqc_mean_coverage',
helptext = 'The metrics are calculated across the transcripts with tiered expression levels.',
plot = linegraph.plot(data, pconfig)
)
开发者ID:chapmanb,项目名称:MultiQC,代码行数:31,代码来源:rna_seqc.py
示例3: __init__
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')
)
pconfig = mod['config'].get('pconfig', {})
if pconfig.get('title') is None:
pconfig['title'] = modname
# Table
if mod['config'].get('plot_type') == 'table':
pconfig['sortRows'] = pconfig.get('sortRows', False)
headers = mod['config'].get('headers')
self.add_section( plot = table.plot(mod['data'], headers, pconfig) )
self.write_data_file( mod['data'], "multiqc_{}".format(modname.lower().replace(' ', '_')) )
# Bar plot
elif mod['config'].get('plot_type') == 'bargraph':
self.add_section( plot = bargraph.plot(mod['data'], mod['config'].get('categories'), pconfig) )
# Line plot
elif mod['config'].get('plot_type') == 'linegraph':
self.add_section( plot = linegraph.plot(mod['data'], pconfig) )
# Scatter plot
elif mod['config'].get('plot_type') == 'scatter':
self.add_section( plot = scatter.plot(mod['data'], pconfig) )
# Heatmap
elif mod['config'].get('plot_type') == 'heatmap':
self.add_section( plot = heatmap.plot(mod['data'], mod['config'].get('xcats'), mod['config'].get('ycats'), pconfig) )
# Beeswarm plot
elif mod['config'].get('plot_type') == 'beeswarm':
self.add_section( plot = beeswarm.plot(mod['data'], pconfig) )
# Raw HTML
elif mod['config'].get('plot_type') == 'html':
self.add_section( content = mod['data'] )
# Raw image file as html
elif mod['config'].get('plot_type') == 'image':
self.add_section( content = mod['data'] )
# Not supplied
elif mod['config'].get('plot_type') == None:
log.warning("Plot type not found for content ID '{}'".format(c_id))
# Not recognised
else:
log.warning("Error - custom content plot type '{}' not recognised for content ID {}".format(mod['config'].get('plot_type'), c_id))
开发者ID:vladsaveliev,项目名称:MultiQC,代码行数:60,代码来源:custom_content.py
示例4: frequencies_plot
def frequencies_plot(self, xmin=0, xmax=200):
""" Generate the qualities plot """
helptext = '''
A possible way to assess the complexity of a library even in
absence of a reference sequence is to look at the kmer profile of the reads.
The idea is to count all the kmers (_i.e._, sequence of length `k`) that occur
in the reads. In this way it is possible to know how many kmers occur
`1,2,.., N` times and represent this as a plot.
This plot tell us for each x, how many k-mers (y-axis) are present in the
dataset in exactly x-copies.
In an ideal world (no errors in sequencing, no bias, no repeated regions)
this plot should be as close as possible to a gaussian distribution.
In reality we will always see a peak for `x=1` (_i.e._, the errors)
and another peak close to the expected coverage. If the genome is highly
heterozygous a second peak at half of the coverage can be expected.'''
pconfig = {
'id': 'Jellyfish_kmer_plot',
'title': 'Jellyfish: K-mer plot',
'ylab': 'Counts',
'xlab': 'k-mer frequency',
'xDecimals': False,
'xmin': xmin,
'xmax': xmax
}
self.add_section(
anchor = 'jellyfish_kmer_plot',
description = 'The K-mer plot lets you estimate library complexity and coverage from k-mer content.',
helptext = helptext,
plot = linegraph.plot(self.jellyfish_data, pconfig)
)
开发者ID:avilella,项目名称:MultiQC,代码行数:34,代码来源:jellyfish.py
示例5: cutadapt_length_trimmed_plot
def cutadapt_length_trimmed_plot (self):
""" Generate the trimming length plot """
description = 'This plot shows the number of reads with certain lengths of adapter trimmed. \n\
Obs/Exp shows the raw counts divided by the number expected due to sequencing errors. A defined peak \n\
may be related to adapter length. See the \n\
<a href="http://cutadapt.readthedocs.org/en/latest/guide.html#how-to-read-the-report" target="_blank">cutadapt documentation</a> \n\
for more information on how these numbers are generated.'
pconfig = {
'id': 'cutadapt_plot',
'title': 'Cutadapt: Lengths of Trimmed Sequences',
'ylab': 'Counts',
'xlab': 'Length Trimmed (bp)',
'xDecimals': False,
'ymin': 0,
'tt_label': '<b>{point.x} bp trimmed</b>: {point.y:.0f}',
'data_labels': [{'name': 'Counts', 'ylab': 'Count'},
{'name': 'Obs/Exp', 'ylab': 'Observed / Expected'}]
}
self.add_section(
description = description,
plot = linegraph.plot([self.cutadapt_length_counts, self.cutadapt_length_obsexp], pconfig)
)
开发者ID:chapmanb,项目名称:MultiQC,代码行数:25,代码来源:cutadapt.py
示例6: plot_readlengths
def plot_readlengths(self):
pdata = [
{ s_name: d['All reads']['reads'] for s_name,d in self.minionqc_raw_data.items() },
{ s_name: d['All reads']['gigabases'] for s_name,d in self.minionqc_raw_data.items() }
]
pconfig = {
'id': 'minionqc_read_lengths',
'title': 'MinIONQC: Output versus read length',
'categories': True,
'data_labels': [
{'name': 'All reads: Num reads', 'ylab': '# reads'},
{'name': 'All reads: Num gigabases', 'ylab': '# gigabases'}
]
}
for qfilt in list(self.q_threshold_list):
try:
pdata.extend([
{ s_name: d[qfilt]['reads'] for s_name,d in self.minionqc_raw_data.items() },
{ s_name: d[qfilt]['gigabases'] for s_name,d in self.minionqc_raw_data.items() },
])
pconfig['data_labels'].extend([
{'name': '{}: Num reads'.format(qfilt), 'ylab': '# reads'},
{'name': '{}: Num gigabases'.format(qfilt), 'ylab': '# gigabases'},
])
except KeyError:
pass
self.add_section (
name = 'Read length output',
anchor = 'minionqc-read-length-output',
description = 'Number of reads / bp sequenced at given read length thresholds.',
plot = linegraph.plot(pdata, pconfig=pconfig)
)
开发者ID:vladsaveliev,项目名称:MultiQC,代码行数:32,代码来源:minionqc.py
示例7: chart_retention_dist
def chart_retention_dist(self):
## cytosine retention distribution
mdata_meth = self.mdata['retention_dist']
mdata = self.mdata['retention_dist_byread']
pd = [
mdata_meth,
dict([(sid, dd['CA']) for sid, dd in mdata.items()]),
dict([(sid, dd['CC']) for sid, dd in mdata.items()]),
dict([(sid, dd['CG']) for sid, dd in mdata.items()]),
dict([(sid, dd['CT']) for sid, dd in mdata.items()]),
]
self.add_section(
name = 'Number of Retention Distribution',
anchor = 'biscuit-retention-read',
description = "This plot shows the distribution of the number of retained cytosine in each read, up to 10.",
plot = linegraph.plot(pd, {
'id': 'biscuit_retention_read_cpa',
'xlab': 'Number of Retention within Read',
'title': 'BISCUIT: Retention Distribution',
'data_labels': [
{'name': 'CpG retention', 'ylab': 'Fraction of cytosine in CpG context', 'xlab': 'Retention Level (%)'},
{'name': 'Within-read CpA', 'ylab': 'Number of Reads'},
{'name': 'Within-read CpC', 'ylab': 'Number of Reads'},
{'name': 'Within-read CpG', 'ylab': 'Number of Reads'},
{'name': 'Within-read CpT', 'ylab': 'Number of Reads'},
]})
)
开发者ID:vladsaveliev,项目名称:MultiQC,代码行数:29,代码来源:biscuit.py
示例8: sequence_quality_plot
def sequence_quality_plot (self):
""" Create the HTML for the phred quality score plot """
data = dict()
for s_name in self.fastqc_data:
try:
data[s_name] = {self.avg_bp_from_range(d['base']): d['mean'] for d in self.fastqc_data[s_name]['per_base_sequence_quality']}
except KeyError:
pass
if len(data) == 0:
log.debug('sequence_quality not found in FastQC reports')
return None
pconfig = {
'id': 'fastqc_per_base_sequence_quality_plot',
'title': 'FastQC: Mean Quality Scores',
'ylab': 'Phred Score',
'xlab': 'Position (bp)',
'ymin': 0,
'xDecimals': False,
'tt_label': '<b>Base {point.x}</b>: {point.y:.2f}',
'colors': self.get_status_cols('per_base_sequence_quality'),
'yPlotBands': [
{'from': 28, 'to': 100, 'color': '#c3e6c3'},
{'from': 20, 'to': 28, 'color': '#e6dcc3'},
{'from': 0, 'to': 20, 'color': '#e6c3c3'},
]
}
self.add_section (
name = 'Sequence Quality Histograms',
anchor = 'fastqc_per_base_sequence_quality',
description = 'The mean quality value across each base position in the read. ' +
'See the <a href="http://www.bioinformatics.babraham.ac.uk/projects/fastqc/Help/3%20Analysis%20Modules/2%20Per%20Base%20Sequence%20Quality.html" target="_blank">FastQC help</a>.',
plot = linegraph.plot(data, pconfig)
)
开发者ID:avilella,项目名称:MultiQC,代码行数:35,代码来源:fastqc.py
示例9: mirtrace_complexity_plot
def mirtrace_complexity_plot(self):
""" Generate the miRTrace miRNA Complexity Plot"""
data = dict()
for s_name in self.complexity_data:
try:
data[s_name] = {int(self.complexity_data[s_name][d]) : int(d) for d in self.complexity_data[s_name]}
except KeyError:
pass
if len(data) == 0:
log.debug('No valid data for miRNA complexity')
return None
config = {
'id': 'mirtrace_complexity_plot',
'title': 'miRTrace: miRNA Complexity Plot',
'ylab': 'Distinct miRNA Count',
'xlab': 'Number of Sequencing Reads',
'ymin': 0,
'xmin': 1,
'xDecimals': False,
'tt_label': '<b>Number of Sequencing Reads {point.x}</b>: {point.y} Distinct miRNA Count',
}
return linegraph.plot(data, config)
开发者ID:vladsaveliev,项目名称:MultiQC,代码行数:25,代码来源:mirtrace.py
示例10: mirtrace_length_plot
def mirtrace_length_plot(self):
""" Generate the miRTrace Read Length Distribution"""
data = dict()
for s_name in self.length_data:
try:
data[s_name] = {int(d): int(self.length_data[s_name][d]) for d in self.length_data[s_name]}
except KeyError:
pass
if len(data) == 0:
log.debug('No valid data for read length distribution')
return None
config = {
'id': 'mirtrace_length_plot',
'title': 'miRTrace: Read Length Distribution',
'ylab': 'Read Count',
'xlab': 'Read Lenth (bp)',
'ymin': 0,
'xmin': 0,
'xDecimals': False,
'tt_label': '<b>Read Length (bp) {point.x}</b>: {point.y} Read Count',
'xPlotBands': [
{'from': 40, 'to': 50, 'color': '#ffebd1'},
{'from': 26, 'to': 40, 'color': '#e2f5ff'},
{'from': 18, 'to': 26, 'color': '#e5fce0'},
{'from': 0, 'to': 18, 'color': '#ffffe2'},
]
}
return linegraph.plot(data, config)
开发者ID:vladsaveliev,项目名称:MultiQC,代码行数:31,代码来源:mirtrace.py
示例11: parse_bamPEFragmentSizeDistribution
def parse_bamPEFragmentSizeDistribution(self):
"""Find bamPEFragmentSize output. Supports the --outRawFragmentLengths option"""
self.deeptools_bamPEFragmentSizeDistribution = dict()
for f in self.find_log_files('deeptools/bamPEFragmentSizeDistribution', filehandles=False):
parsed_data = self.parseBamPEFDistributionFile(f)
for k, v in parsed_data.items():
if k in self.deeptools_bamPEFragmentSizeDistribution:
log.warning("Replacing duplicate sample {}.".format(k))
self.deeptools_bamPEFragmentSizeDistribution[k] = v
if len(parsed_data) > 0:
self.add_data_source(f, section='bamPEFragmentSizeDistribution')
if len(self.deeptools_bamPEFragmentSizeDistribution) > 0:
config = {
'id': 'fragment_size_distribution_plot',
'title': 'deeptools: Fragment Size Distribution Plot',
'ylab': 'Occurrence',
'xlab': 'Fragment Size (bp)',
'smooth_points': 50,
'xmax': 1000,
'xDecimals': False,
'tt_label': '<b>Fragment Size (bp) {point.x}</b>: {point.y} Occurrence',
}
self.add_section (
name = 'Fragment size distribution',
anchor = 'fragment_size_distribution',
description="Distribution of paired-end fragment sizes",
plot=linegraph.plot(self.deeptools_bamPEFragmentSizeDistribution, config)
)
return len(self.deeptools_bamPEFragmentSizeDistribution)
开发者ID:vladsaveliev,项目名称:MultiQC,代码行数:32,代码来源:bamPEFragmentSizeDistribution.py
示例12: fiveprime_plot
def fiveprime_plot(self):
"""Generate a 5' C>T linegraph plot"""
data = dict()
dict_to_add = dict()
# Create tuples out of entries
for key in self.fivepCtoTfreq_data:
pos = list(range(1,len(self.fivepCtoTfreq_data.get(key))))
tmp = [i * 100.0 for i in self.fivepCtoTfreq_data.get(key)]
tuples = list(zip(pos,tmp))
# Get a dictionary out of it
data = dict((x, y) for x, y in tuples)
dict_to_add[key] = data
config = {
'id': 'fiveprime_misinc_plot',
'title': 'DamageProfiler: 5\' C>T misincorporation plot',
'ylab': '% C to T substituted',
'xlab': 'Nucleotide position from 5\'',
'tt_label': '{point.y:.2f} % C>T misincorporations at nucleotide position {point.x}',
'ymin': 0,
'xmin': 1
}
return linegraph.plot(dict_to_add,config)
开发者ID:vladsaveliev,项目名称:MultiQC,代码行数:25,代码来源:damageprofiler.py
示例13: bcbio_coverage_avg_chart_deprecated_in_1_0_6
def bcbio_coverage_avg_chart_deprecated_in_1_0_6(self, names):
""" Make the bcbio assignment rates plot
(from the old-style file before mosdepth integration,
deprectated since bcbio 1.0.6 """
x_threshold = 0
data = defaultdict(dict)
for f in self.find_log_files(names):
s_name = self.clean_s_name(f['fn'], root=None)
for line in f['f'].split("\n"):
if not line.startswith("percentage"):
continue
cutoff_reads, bases_pct, sample = line.split("\t")
y = float(bases_pct)
x = int(cutoff_reads.replace("percentage", ""))
data[s_name][x] = y
if y > 1.0:
x_threshold = max(x_threshold, x)
if s_name in data:
self.add_data_source(f)
if data:
return linegraph.plot(data, {
'xlab': 'Coverage (X)',
"ylab": '% bases in genome or rarget covered by least X reads',
'ymax': 100,
"xmax": x_threshold,
})
开发者ID:roryk,项目名称:MultiQC_bcbio,代码行数:29,代码来源:bcbio.py
示例14: _add_hs_penalty
def _add_hs_penalty(data):
subtitle = "The \"hybrid selection penalty\" incurred to get 80% of target bases to a given coverage. Can be used with the formula <code>required_aligned_bases = bait_size_bp * desired_coverage * hs_penalty</code>."
data_clean = defaultdict(dict)
any_non_zero = False
for s in data:
for h in data[s]:
if h.startswith("HS_PENALTY"):
data_clean[s][(h.replace("HS_PENALTY_", " ")[:-1])] = data[s][h]
if data[s][h] > 0:
any_non_zero = True
pconfig = { 'id': 'picard_hybrid_selection_penalty',
'title': 'Picard: Hybrid Selection Penalty',
'xlab': 'Fold Coverage',
'ylab': 'Pct of bases',
'ymax': 100,
'ymin': 0,
'xmin': 0,
'tt_label': '<b>{point.x}X</b>: {point.y:.2f}%',}
if any_non_zero:
return {
'name': 'HS penalty',
'anchor': 'picard_hsmetrics_hs_penalty',
'description': subtitle,
'plot': linegraph.plot(data_clean, pconfig)
}
开发者ID:juliangehring,项目名称:MultiQC,代码行数:27,代码来源:HsMetrics.py
示例15: _bcbio_umi_count_plot
def _bcbio_umi_count_plot(self, parsed_data):
plot_data = {}
for s, info in parsed_data.items():
plot_data[s] = info["umi_counts"]
config = {'xlab': "Reads per UMI", 'ylab': "Count",
"xDecimals": False}
return {'name': 'UMI count distribution',
'anchor': 'umi-stats-counts',
'plot': linegraph.plot([plot_data], config)}
开发者ID:roryk,项目名称:MultiQC_bcbio,代码行数:9,代码来源:bcbio.py
示例16: plot_bhist
def plot_bhist(samples, file_type, **plot_args):
""" Create line graph plot of histogram data for BBMap 'bhist' output.
The 'samples' parameter could be from the bbmap mod_data dictionary:
samples = bbmap.MultiqcModule.mod_data[file_type]
"""
all_x = set()
for item in sorted(chain(*[samples[sample]['data'].items()
for sample in samples])):
all_x.add(item[0])
columns_to_plot = {
'GC': {
1: 'C',
2: 'G',
},
'AT': {
0: 'A',
3: 'T',
},
'N': {
4: 'N'
},
}
nucleotide_data = []
for column_type in columns_to_plot:
nucleotide_data.append(
{
sample+'.'+column_name: {
x: samples[sample]['data'][x][column]*100 if x in samples[sample]['data'] else 0
for x in all_x
}
for sample in samples
for column, column_name in columns_to_plot[column_type].items()
}
)
plot_params = {
'id': 'bbmap-' + file_type + '_plot',
'title': 'BBTools: ' + plot_args['plot_title'],
'xlab': 'Read position',
'ymin': 0,
'ymax': 100,
'data_labels': [
{'name': 'Percentage of G+C bases'},
{'name': 'Percentage of A+T bases'},
{'name': 'Percentage of N bases'},
]
}
plot_params.update(plot_args['plot_params'])
plot = linegraph.plot(
nucleotide_data,
plot_params
)
return plot
开发者ID:chapmanb,项目名称:MultiQC,代码行数:57,代码来源:plot_bhist.py
示例17: parse_plotFingerprint
def parse_plotFingerprint(self):
"""Find plotFingerprint output. Both --outQualityMetrics and --outRawCounts"""
self.deeptools_plotFingerprintOutQualityMetrics = dict()
for f in self.find_log_files('deeptools/plotFingerprintOutQualityMetrics'):
parsed_data = self.parsePlotFingerprintOutQualityMetrics(f)
for k, v in parsed_data.items():
if k in self.deeptools_plotFingerprintOutQualityMetrics:
log.warning("Replacing duplicate sample {}.".format(k))
self.deeptools_plotFingerprintOutQualityMetrics[k] = v
if len(parsed_data) > 0:
self.add_data_source(f, section='plotFingerprint')
self.deeptools_plotFingerprintOutRawCounts= dict()
for f in self.find_log_files('deeptools/plotFingerprintOutRawCounts'):
parsed_data = self.parsePlotFingerprintOutRawCounts(f)
for k, v in parsed_data.items():
if k in self.deeptools_plotFingerprintOutRawCounts:
log.warning("Replacing duplicate sample {}.".format(k))
self.deeptools_plotFingerprintOutRawCounts[k] = v
if len(parsed_data) > 0:
self.add_data_source(f, section='plotFingerprint')
if len(self.deeptools_plotFingerprintOutQualityMetrics) > 0:
config = dict(ymin=0.0, ymax=1.0, ylab='Value', categories=True)
config['id'] = 'plotFingerprint_quality_metrics'
config['title'] = 'Fingerprint quality metrics'
self.add_section(name="Fingerprint quality metrics",
anchor="plotFingerprint",
description="Various quality metrics returned by plotFingerprint",
plot=linegraph.plot(self.deeptools_plotFingerprintOutQualityMetrics, config))
if len(self.deeptools_plotFingerprintOutRawCounts) > 0:
config = dict(xmin=0.0, xmax=1.0, ymin=0.0, ymax=1.0, xlab='rank', ylab='Fraction w.r.t. bin with highest coverage')
config['id'] = 'deeptools_fingerprint_plot'
config['title'] = 'Fingerprint'
self.add_section(name="Fingerprint",
anchor="deeptools_fingerprint",
description="Signal fingerprint according to plotFingerprint",
plot=linegraph.plot(self.deeptools_plotFingerprintOutRawCounts, config))
return len(self.deeptools_plotFingerprintOutQualityMetrics), len(self.deeptools_plotFingerprintOutRawCounts)
开发者ID:chapmanb,项目名称:MultiQC,代码行数:43,代码来源:plotFingerprint.py
示例18: chart_align_mapq
def chart_align_mapq(self):
# fraction of optimally mapped reads
pd = {}
for sid, dd in self.mdata['align_mapq'].items():
pd[sid] = {'OAligned':0, 'SAligned':0, 'UAligned':1}
for mapq, cnt in dd.items():
if mapq == 'unmapped':
pd[sid]['UAligned'] += int(cnt)
elif int(mapq) >= 40:
pd[sid]['OAligned'] += int(cnt)
else:
pd[sid]['SAligned'] += int(cnt)
self.add_section(
name = 'Mapping Summary',
anchor = 'biscuit-mapping',
description = 'This shows the fraction of optimally aligned reads, which is defined by mapQ >= 40.',
helptext = 'A good library should have high fraction of reads optimally aligned. Suboptimally aligned reads include both nonunique alignments and imperfect alignments.',
plot = bargraph.plot(pd, OrderedDict([
('OAligned', {'name':'Optimally Aligned Reads'}),
('SAligned', {'name':'Suboptimally Aligned Reads'}),
('UAligned', {'name':'Unaligned Reads'})
]), {'id':'biscuit_mapping_summary',
'title':'BISCUIT: Mapping Summary',
'ylab':'Number of Reads',
'cpswitch_counts_label': '# Reads'
})
)
# Mapping quality together in one plot
total = {}
for sid, dd in self.mdata['align_mapq'].items():
total[sid] = sum([int(cnt) for _, cnt in dd.items() if _ != "unmapped"])
pd_mapping = {}
for sid, dd in self.mdata['align_mapq'].items():
mapqcnts = []
for mapq in range(61):
if str(mapq) in dd:
mapqcnts.append(float(dd[str(mapq)])/total[sid]*100)
else:
mapqcnts.append(0)
pd_mapping[sid] = dict(zip(range(61), mapqcnts))
self.add_section(
name = 'Mapping Quality Distribution',
anchor = 'biscuit-mapq',
description = "This plot shows the distribution of primary mapping quality.",
plot = linegraph.plot(pd_mapping,
{'id':'biscuit_mapping',
'title': 'BISCUIT: Mapping Information',
'ymin': 0, 'yLabelFormat': '{value}%',
'tt_label': '<strong>Q{point.x}:</strong> {point.y:.2f}% of reads',
'name':'Mapping Quality', 'ylab': '% Primary Mapped Reads','xlab': 'Mapping Quality'}))
开发者ID:vladsaveliev,项目名称:MultiQC,代码行数:55,代码来源:biscuit.py
示例19: slamdunkTcPerUTRPosPlot
def slamdunkTcPerUTRPosPlot (self):
""" Generate the tc per UTR pos plots """
pconfig_nontc = {
'id': 'slamdunk_slamdunk_nontcperutrpos_plot',
'title': 'Slamdunk: Non-T>C mutations over 3\' UTR ends',
'ylab': 'Percent mismatches %',
'xlab': 'Position in the static last 250bp window of 3\' UTR',
'xDecimals': False,
'ymin': 0,
'tt_label': '<b>Pos {point.x}</b>: {point.y:.2f} %',
'data_labels': [{'name': 'UTRs on plus strand', 'ylab': 'Percent mismatches %'},
{'name': 'UTRs on minus strand', 'ylab': 'Percent mismatches %'}]
}
pconfig_tc = {
'id': 'slamdunk_slamdunk_tcperutrpos_plot',
'title': 'Slamdunk: T>C conversions over 3\' UTR ends',
'ylab': 'Percent converted %',
'xlab': 'Position in the static last 250bp window of 3\' UTR',
'xDecimals': False,
'ymin': 0,
'tt_label': '<b>Pos {point.x}</b>: {point.y:.2f} %',
'data_labels': [{'name': 'UTRs on plus strand', 'ylab': 'Percent converted %'},
{'name': 'UTRs on minus strand', 'ylab': 'Percent converted %'}]
}
self.add_section (
name = 'Non T>C mismatches over UTR positions',
anchor = 'slamdunk_nontcperutrpos',
description = """This plot shows the distribution of non T>C mismatches across UTR positions for the last 250 bp from the 3\' UTR end
(see the <a href="http://t-neumann.github.io/slamdunk/docs.html#tcperutrpos" target="_blank">slamdunk docs</a>).""",
plot = linegraph.plot([self.nontc_per_utrpos_plus, self.nontc_per_utrpos_minus], pconfig_nontc)
)
self.add_section (
name = 'T>C conversions over UTR positions',
anchor = 'tcperutrpos',
description = """This plot shows the distribution of T>C conversions across UTR positions for the last 250 bp from the 3\' UTR end
(see the <a href="http://t-neumann.github.io/slamdunk/docs.html#tcperutrpos" target="_blank">slamdunk docs</a>).""",
plot = linegraph.plot([self.tc_per_utrpos_plus, self.tc_per_utrpos_minus], pconfig_tc)
)
开发者ID:chapmanb,项目名称:MultiQC,代码行数:42,代码来源:slamdunk.py
示例20: slamdunkTcPerReadPosPlot
def slamdunkTcPerReadPosPlot (self):
""" Generate the tc per read pos plots """
pconfig_nontc = {
'id': 'slamdunk_nontcperreadpos_plot',
'title': 'Slamdunk: Non-T>C mismatches over reads',
'ylab': 'Percent mismatches %',
'xlab': 'Position in read',
'xDecimals': False,
'ymin': 0,
'tt_label': '<b>Pos {point.x}</b>: {point.y:.2f} %',
'data_labels': [{'name': 'Forward reads +', 'ylab': 'Percent mismatches %'},
{'name': 'Reverse reads -', 'ylab': 'Percent mismatches %'}]
}
pconfig_tc = {
'id': 'slamdunk_tcperreadpos_plot',
'title': 'Slamdunk: T>C conversions over reads',
'ylab': 'Percent converted %',
'xlab': 'Position in read',
'xDecimals': False,
'ymin': 0,
'tt_label': '<b>Pos {point.x}</b>: {point.y:.2f} %',
'data_labels': [{'name': 'Forward reads +', 'ylab': 'Percent converted %'},
{'name': 'Reverse reads -', 'ylab': 'Percent converted %'}]
}
self.add_section (
name = 'Non T>C mismatches over read positions',
anchor = 'slamdunk_nontcperreadpos',
description = """This plot shows the distribution of non T>C mismatches across read positions
(see the <a href="http://t-neumann.github.io/slamdunk/docs.html#tcperreadpos" target="_blank">slamdunk docs</a>).""",
plot = linegraph.plot([self.nontc_per_readpos_plus, self.nontc_per_readpos_minus], pconfig_nontc)
)
self.add_section (
name = 'T>C conversions over read positions',
anchor = 'slamdunk_tcperreadpos',
description = """This plot shows the distribution of T>C conversions across read positions
(see the <a href="http://t-neumann.github.io/slamdunk/docs.html#tcperreadpos" target="_blank">slamdunk docs</a>).""",
plot = linegraph.plot([self.tc_per_readpos_plus, self.tc_per_readpos_minus], pconfig_tc)
)
开发者ID:chapmanb,项目名称:MultiQC,代码行数:42,代码来源:slamdunk.py
注:本文中的multiqc.plots.linegraph.plot函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论