File: autodoc_source.rst

package info (click to toggle)
python-pybedtools 0.10.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 16,620 kB
  • sloc: python: 10,030; cpp: 899; makefile: 142; sh: 57
file content (360 lines) | stat: -rw-r--r-- 10,830 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360

.. _autodoc:

.. _pybedtools reference:

.. currentmodule:: pybedtools

:mod:`pybedtools` Reference
===========================
The following tables summarize the methods and functions; click on a method or
function name to see the complete documentation.

.. contents::

:class:`BedTool` creation
-------------------------
The main :class:`BedTool` documentation, with a list of all methods in
alphabetical order at the bottom.  For more details, please see :ref:`creating
a BedTool`.

.. autosummary::
    :toctree: autodocs

    pybedtools.bedtool.BedTool

`BEDTools` wrappers
-------------------
These methods wrap `BEDTools` programs for easy use with Python; you can then
use the other :mod:`pybedtools` functionality for further manipulation and
analysis.

The documentation of each of these methods starts with
:mod:`pybedtools`-specific documentation, possibly followed by an example.
Finally, the `BEDTools` help is copied verbatim from whatever version was
installed when generating these docs.

In general the `BEDTool` wrapper methods adhere to the :ref:`Design principles`:

    * :ref:`temp principle`
    * :ref:`similarity principle`
    * :ref:`version principle`
    * :ref:`default args principle`


.. autosummary::
    :toctree: autodocs

    pybedtools.bedtool.BedTool.intersect
    pybedtools.bedtool.BedTool.window
    pybedtools.bedtool.BedTool.closest
    pybedtools.bedtool.BedTool.coverage
    pybedtools.bedtool.BedTool.map
    pybedtools.bedtool.BedTool.genome_coverage
    pybedtools.bedtool.BedTool.merge
    pybedtools.bedtool.BedTool.cluster
    pybedtools.bedtool.BedTool.complement
    pybedtools.bedtool.BedTool.subtract
    pybedtools.bedtool.BedTool.slop
    pybedtools.bedtool.BedTool.flank
    pybedtools.bedtool.BedTool.sort
    pybedtools.bedtool.BedTool.random
    pybedtools.bedtool.BedTool.shuffle
    pybedtools.bedtool.BedTool.annotate
    pybedtools.bedtool.BedTool.multi_intersect
    pybedtools.bedtool.BedTool.union_bedgraphs
    pybedtools.bedtool.BedTool.pair_to_bed
    pybedtools.bedtool.BedTool.pair_to_pair
    pybedtools.bedtool.BedTool.bam_to_bed
    pybedtools.bedtool.BedTool.to_bam
    pybedtools.bedtool.BedTool.bedpe_to_bam
    pybedtools.bedtool.BedTool.bed6
    pybedtools.bedtool.BedTool.bam_to_fastq
    pybedtools.bedtool.BedTool.sequence
    pybedtools.bedtool.BedTool.mask_fasta
    pybedtools.bedtool.BedTool.nucleotide_content
    pybedtools.bedtool.BedTool.multi_bam_coverage
    pybedtools.bedtool.BedTool.tag_bam
    pybedtools.bedtool.BedTool.jaccard
    pybedtools.bedtool.BedTool.reldist
    pybedtools.bedtool.BedTool.overlap
    pybedtools.bedtool.BedTool.links
    pybedtools.bedtool.BedTool.igv
    pybedtools.bedtool.BedTool.window_maker
    pybedtools.bedtool.BedTool.groupby
    pybedtools.bedtool.BedTool.expand

Other :class:`BedTool` methods
------------------------------
These methods are some of the ways in which :mod:`pybedtools` extend the
BEDTools suite.


Feature-by-feature operations
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Methods that operate on a feature-by-feature basis to modify or filter features
on the fly.

.. autosummary::
    :toctree: autodocs

    pybedtools.bedtool.BedTool.each
    pybedtools.bedtool.BedTool.filter
    pybedtools.bedtool.BedTool.split
    pybedtools.bedtool.BedTool.truncate_to_chrom
    pybedtools.bedtool.BedTool.remove_invalid

The :mod:`pybedtools.featurefuncs` module contains some commonly-used functions
that can be passed to :meth:`BedTool.each`:

.. currentmodule:: pybedtools

.. autosummary::
    :toctree:

    pybedtools.featurefuncs.three_prime
    pybedtools.featurefuncs.five_prime
    pybedtools.featurefuncs.TSS
    pybedtools.featurefuncs.extend_fields
    pybedtools.featurefuncs.center
    pybedtools.featurefuncs.midpoint
    pybedtools.featurefuncs.normalized_to_length
    pybedtools.featurefuncs.rename
    pybedtools.featurefuncs.greater_than
    pybedtools.featurefuncs.less_than
    pybedtools.featurefuncs.normalized_to_length
    pybedtools.featurefuncs.rename
    pybedtools.featurefuncs.bedgraph_scale
    pybedtools.featurefuncs.add_color
    pybedtools.featurefuncs.gff2bed
    pybedtools.featurefuncs.bed2gff



Searching for features
~~~~~~~~~~~~~~~~~~~~~~
These methods take a single interval as input and return the intervals of the
BedTool that overlap.

This can be useful when searching across many BED files for a particular
coordinate range -- for example, they can be used identify all binding sites,
stored in many different BED files, that fall within a gene's coordinates.

.. autosummary::
    :toctree: autodocs

    pybedtools.bedtool.BedTool.all_hits
    pybedtools.bedtool.BedTool.any_hits
    pybedtools.bedtool.BedTool.count_hits
    pybedtools.bedtool.BedTool.tabix_intervals
    pybedtools.bedtool.BedTool.tabix
    pybedtools.bedtool.BedTool.bgzip


:class:`BedTool` introspection
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
These methods provide information on the :class:`BedTool` object.

If using :meth:`BedTool.head`, don't forget that you can index into
:class:`BedTool` objects, too.

.. autosummary::
    :toctree: autodocs

    pybedtools.bedtool.BedTool.head
    pybedtools.bedtool.BedTool.count
    pybedtools.bedtool.BedTool.field_count
    pybedtools.bedtool.BedTool.file_type


Randomization helpers
~~~~~~~~~~~~~~~~~~~~~
Helper methods useful for assessing empirical instersection
distributions between interval files.

.. autosummary::
    :toctree: autodocs

    pybedtools.bedtool.BedTool.parallel_apply
    pybedtools.bedtool.BedTool.randomstats
    pybedtools.bedtool.BedTool.randomintersection
    pybedtools.bedtool.BedTool.randomintersection_bp
    pybedtools.bedtool.BedTool.random_subset
    pybedtools.bedtool.BedTool.random_jaccard
    pybedtools.bedtool.BedTool.random_op

Managing :class:`BedTool` objects on disk
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
These methods are used to specify where to save results from :class:`BedTool`
operations.

.. autosummary::
    :toctree: autodocs

    pybedtools.bedtool.BedTool.saveas
    pybedtools.bedtool.BedTool.moveto


Misc operations
~~~~~~~~~~~~~~~
Methods that can't quite be categorized into the above sections.

.. autosummary::
    :toctree: autodocs

    pybedtools.bedtool.BedTool.cat
    pybedtools.bedtool.BedTool.at
    pybedtools.bedtool.BedTool.absolute_distance
    pybedtools.bedtool.BedTool.cut
    pybedtools.bedtool.BedTool.total_coverage
    pybedtools.bedtool.BedTool.with_attrs
    pybedtools.bedtool.BedTool.as_intervalfile
    pybedtools.bedtool.BedTool.introns
    pybedtools.bedtool.BedTool.set_chromsizes
    pybedtools.bedtool.BedTool.print_sequence
    pybedtools.bedtool.BedTool.save_seqs
    pybedtools.bedtool.BedTool.seq
    pybedtools.bedtool.BedTool.liftover
    pybedtools.bedtool.BedTool.colormap_normalize
    pybedtools.bedtool.BedTool.relative_distance

Module-level functions
----------------------

Working with example files
~~~~~~~~~~~~~~~~~~~~~~~~~~
:mod:`pybedtools` comes with many example files.  Here are some useful
functions for accessing them.

.. autosummary::
    :toctree: autodocs

    pybedtools.bedtool.example_bedtool
    pybedtools.filenames.list_example_files
    pybedtools.filenames.example_filename

Creating :class:`Interval` objects from scratch
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:class:`Interval` objects are the core object in :mod:`pybedtools` to represent
a genomic interval, written in Cython for speed.

.. autosummary::
    :toctree: autodocs

    pybedtools.cbedtools.Interval
    pybedtools.cbedtools.create_interval_from_list

:mod:`pybedtools` setup and config
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use these functions right after importing in order to use custom paths or to
clean up the temp directory.

.. autosummary::
    :toctree: autodocs

    pybedtools.helpers.set_bedtools_path
    pybedtools.helpers.get_tempdir
    pybedtools.helpers.set_tempdir
    pybedtools.helpers.cleanup
    pybedtools.debug_mode


Working with "chromsizes" or assembly coordinate files
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Many `BEDTools` programs need "genome files" or "chromsizes" files so as to
remain within the coordinates of the assembly you're working on.  These
functions help manage these files.

.. autosummary::
    :toctree: autodocs

    pybedtools.helpers.get_chromsizes_from_ucsc
    pybedtools.helpers.chromsizes
    pybedtools.helpers.chromsizes_to_file


Performing operations in parallel (multiprocessing)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. autosummary::
    :toctree: autodocs

    pybedtools.parallel.parallel_apply

:mod:`pybedtools.contrib`
-------------------------
The :mod:`pybedtools.contrib` module contains higher-level code that leverages
:class:`BedTool` objects for common analyses.


Plotting
~~~~~~~~
Plotting results from BEDTools/pybedtools operations is very useful for
exploring and understanding the tools as well as for teaching purposes.

.. autosummary::
    :toctree: autodocs

    pybedtools.contrib.plotting.Track
    pybedtools.contrib.plotting.TrackCollection
    pybedtools.contrib.plotting.binary_heatmap
    pybedtools.contrib.plotting.binary_summary
    pybedtools.contrib.plotting.BedToolsDemo
    pybedtools.contrib.plotting.ConfiguredBedToolsDemo




Working with bigWig files
~~~~~~~~~~~~~~~~~~~~~~~~~
At this time, :mod:`pybedtools` does not support reading bigWig files, only
creating them via UCSC utilities.

.. autosummary::
    :toctree: autodocs

    pybedtools.contrib.bigwig.bam_to_bigwig
    pybedtools.contrib.bigwig.bedgraph_to_bigwig
    pybedtools.contrib.bigwig.wig_to_bigwig

Working with bigBed files
~~~~~~~~~~~~~~~~~~~~~~~~~
.. autosummary::
    :toctree: autodocs

    pybedtools.contrib.bigbed.bigbed
    pybedtools.contrib.bigbed.bigbed_to_bed


:class:`IntersectionMatrix`
~~~~~~~~~~~~~~~~~~~~~~~~~~~
The :class:`IntersectionMatrix` class makes it easy to intersect a large number
of interval files with each other.

.. autosummary::
    :toctree: autodocs

    pybedtools.contrib.IntersectionMatrix

:mod:`contrib.venn_maker`
~~~~~~~~~~~~~~~~~~~~~~~~~
The :mod:`venn_maker` module helps you make Venn diagrams using the R package
`VennDiagram <http://www.biomedcentral.com/1471-2105/12/35>`_.

Note that Venn diagrams are not good for when you have nested intersections.
See the docs for :func:`pybedtools.contrib.venn_maker.cleaned_intersect` and
its source for more details.

.. autosummary::
    :toctree: autodocs

    pybedtools.contrib.venn_maker
    pybedtools.contrib.venn_maker.venn_maker
    pybedtools.contrib.venn_maker.cleaned_intersect

:mod:`contrib.long_range_interaction`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. autosummary::
    :toctree: autodocs

    pybedtools.contrib.long_range_interaction.tag_bedpe
    pybedtools.contrib.long_range_interaction.cis_trans_interactions