Codebase list python-pauvre / 3423d14
Update upstream source from tag 'upstream/0.2.2' Update to upstream version '0.2.2' with Debian dir 32779528b613632d498a9901a1ab8d0fe1df32a2 Andreas Tille 3 years ago
5 changed file(s) with 60 addition(s) and 69 deletion(s). Raw diff Collapse all Expand all
00 Metadata-Version: 1.2
11 Name: pauvre
2 Version: 0.2.1
2 Version: 0.2.2
33 Summary: Tools for plotting Oxford Nanopore and other long-read data.
44 Home-page: https://github.com/conchoecia/pauvre
55 Author: Darrin Schultz
00 [![travis-ci](https://travis-ci.org/conchoecia/pauvre.svg?branch=master)](https://travis-ci.org/conchoecia/pauvre) [![DOI](https://zenodo.org/badge/112774670.svg)](https://zenodo.org/badge/latestdoi/112774670)
11
2 ## <a name="started"></a>Getting Started
23
3 ## pauvre: a plotting package designed for nanopore and PacBio long reads
4 ```
5 pauvre custommargin -i custom.tsv --ycol length --xcol qual # Custom tsv input
6 ```
47
5 This package currently hosts four scripts for plotting and/or printing stats.
8 ## Table of Contents
9
10 - [Getting Started](#started)
11 - [Users' Guide](#uguide)
12 - [Installation](#installation)
13 - [Requirements](#reqs)
14 - [Install Instructions](#install)
15 - [Usage](#usage)
16 - [pauvre stats](#stats)
17 - [pauvre marginplot](#marginplot)
18 - [Basic Usage](#marginbasic)
19 - [Plot Adjustments](#marginadjustments)
20 - [Specialized Options](#marginspecialized)
21 - [Contributors](#contributors)
22
23 ## <a name="uguide"></a>Users' Guide
24
25 Pauvre is a plotting package originally designed to help QC the length and
26 quality distribution of Oxford Nanopore or PacBio reads. The main outputs
27 are marginplots. Now, `pauvre` also hosts other additional data plotting
28 scripts.
29
30 This package currently hosts five scripts for plotting and/or printing stats.
631
732 - `pauvre marginplot`
833 - takes a fastq file as input and outputs a marginal histogram with a heatmap.
34 - `pauvre custommargin`
35 - takes a tsv as input and outputs a marginal histogram with custom columns of your choice.
936 - `pauvre stats`
1037 - Takes a fastq file as input and prints out a table of stats, including how many basepairs/reads there are for a length/mean quality cutoff.
1138 - This is also automagically called when using `pauvre marginplot`
2350 genomes with the fewest crossings-over. Input is one `.gff` file
2451 per circular genome and one directory of gene alignments.
2552
26 # Requirements
53
54 ## <a name="installation"></a>Installation
55
56 ### <a name="reqs"></a>Requirements
2757
2858 - You must have the following installed on your system to install this software:
2959 - python 3.x
3262 - pandas
3363 - pillow
3464
35 # Installation
36
65 ### <a name="install">Install Instructions
3766 - Instructions to install on your mac or linux system. Not sure on
3867 Windows! Make sure *python 3* is the active environment before
3968 installing.
4372 - Or, install with pip
4473 - `pip3 install pauvre`
4574
46 # Usage
75 ## <a name="usage"><a/>Usage
4776
48 ## `stats`
77 ### <a name="stats"></a>`stats`
4978 - generate basic statistics about the fastq file. For example, if I
5079 want to know the number of bases and reads with AT LEAST a PHRED
5180 score of 5 and AT LEAST a read length of 500, run the program as below
77106 et cetera...
78107 ```
79108
80 ## `marginplot`
109 ### <a name="marginplot"></a>`marginplot`
81110
82 ### Basic usage
111 #### <a name="marginbasic"></a>Basic Usage
83112 - automatically calls `pauvre stats` for each fastq file
84113 - Make the default plot showing the 99th percentile of longest reads
85114 - `pauvre marginplot --fastq miniDSMN15.fastq`
89118 - `pauvre marginplot --maxlen 4000 --maxqual 25 --lengthbin 50 --fileform pdf png --qualbin 0.5 --fastq miniDSMN15.fastq`
90119 - ![example1](files/miniDSMN15.png)
91120
92 ### Filter reads and adjust viewing window
121 #### <a name="marginadjustments"></a>Plot Adjustments
122
93123 - Filter out reads with a mean quality less than 5, and a length
94124 less than 800. Zoom in to plot only mean quality of at least 4 and
95125 read length at least 500bp.
96126 - `pauvre marginplot -f miniDSMN15.fastq --filt_minqual 5 --filt_minlen 800 -y --plot_minlen 500 --plot_minqual 4`
97127 - ![test4](files/test4.png)
98128
99 ### Specialized Options
129 #### <a name="marginspecialized"></a>Specialized Options
100130
101131 - Plot ONT 1D data with a large tail
102132 - `pauvre marginplot --maxlen 100000 --maxqual 15 --lengthbin 500 <myfile>.fastq`
103133 - Get more resolution on lengths
104134 - `pauvre marginplot --maxlen 100000 --lengthbin 5 <myfile>.fastq`
105135
106 ### Transparency
107
108136 - Turn off transparency if you just want a white background
109137 - `pauvre marginplot --transparent False <myfile>.fastq`
110138 - Note: transparency is the default behavior
111139 - ![transparency](files/transparency.001.jpeg)
112140
113 # Contributors
141 ## <a name="contributors"></a>Contributors
114142
115143 @conchoecia (Darrin Schultz)
116144 @mebbert (Mark Ebbert)
2929 import os.path as opath
3030 from sys import stderr
3131 from pauvre.functions import print_images
32 from pauvre.marginplot import generate_panel
3233 from pauvre.stats import stats
3334 import pauvre.rcparams as rc
3435 import sys
3637
3738 # logging
3839 logger = logging.getLogger('pauvre')
39
40
41 def generate_panel(panel_left, panel_bottom, panel_width, panel_height,
42 axis_tick_param='both', which_tick_param='both',
43 bottom_tick_param='on', label_bottom_tick_param='on',
44 left_tick_param='on', label_left_tick_param='on',
45 right_tick_param='off', label_right_tick_param='off',
46 top_tick_param='off', label_top_tick_param='off'):
47 """
48 Setting default panel tick parameters. Some of these are the defaults
49 for matplotlib anyway, but specifying them for readability. Here are
50 options and defaults for the parameters used below:
51
52 axis : {'x', 'y', 'both'}; which axis to modify; default = 'both'
53 which : {'major', 'minor', 'both'}; which ticks to modify;
54 default = 'major'
55 bottom, top, left, right : bool or {'on', 'off'}; ticks on or off;
56 labelbottom, labeltop, labelleft, labelright : bool or {'on', 'off'}
57 """
58
59 # create the panel
60 panel_rectangle = [panel_left, panel_bottom, panel_width, panel_height]
61 panel = plt.axes(panel_rectangle)
62
63 # Set tick parameters
64 panel.tick_params(axis=axis_tick_param,
65 which=which_tick_param,
66 bottom=bottom_tick_param,
67 labelbottom=label_bottom_tick_param,
68 left=left_tick_param,
69 labelleft=label_left_tick_param,
70 right=right_tick_param,
71 labelright=label_right_tick_param,
72 top=top_tick_param,
73 labeltop=label_top_tick_param)
74
75 return panel
76
7740
7841 def _generate_histogram_bin_patches(panel, bins, bin_values, horizontal=True):
7942 """This helper method generates the histogram that is added to the panel.
270233 print(" - Setting panel options.", file = sys.stderr)
271234 if kwargs["Y_AXES"]:
272235 y_bottom_spine = True
273 y_bottom_tick = 'on'
274 y_bottom_label = 'on'
236 y_bottom_tick = True
237 y_bottom_label = True
275238 x_left_spine = True
276 x_left_tick = 'on'
277 x_left_label = 'on'
239 x_left_tick = True
240 x_left_label = True
278241 x_y_label = 'Count'
279242 else:
280243 y_bottom_spine = False
281 y_bottom_tick = 'off'
282 y_bottom_label = 'off'
244 y_bottom_tick = False
245 y_bottom_label = False
283246 x_left_spine = False
284 x_left_tick = 'off'
285 x_left_label = 'off'
247 x_left_tick = False
248 x_left_label = False
286249 x_y_label = None
287250
288251 panels = []
335298 legend_panel_height = heat_map_panel_height / fig_height
336299 legend_panel = generate_panel(legend_panel_left, legend_panel_bottom,
337300 legend_panel_width, legend_panel_height,
338 bottom_tick_param='off',
339 label_bottom_tick_param='off',
340 left_tick_param='off',
341 label_left_tick_param='off',
342 right_tick_param='on',
343 label_right_tick_param='on')
301 bottom_tick_param=False,
302 label_bottom_tick_param=False,
303 left_tick_param=False,
304 label_left_tick_param=False,
305 right_tick_param=True,
306 label_right_tick_param=True)
344307 panels.append(legend_panel)
345308
346309 #
00 # -*- coding: utf-8 -*-
11
2 __version__ = "0.2.1"
2 __version__ = "0.2.2"
33
00 Metadata-Version: 1.2
11 Name: pauvre
2 Version: 0.2.1
2 Version: 0.2.2
33 Summary: Tools for plotting Oxford Nanopore and other long-read data.
44 Home-page: https://github.com/conchoecia/pauvre
55 Author: Darrin Schultz