Skip to content

Commit

Permalink
docs on genome_cov warning about non-BED format
Browse files Browse the repository at this point in the history
xref #113
  • Loading branch information
daler committed May 9, 2017
1 parent 7dfa162 commit e83c621
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pybedtools/bedtool.py
Original file line number Diff line number Diff line change
Expand Up @@ -1973,6 +1973,14 @@ def genome_coverage(self):
"""
Wraps `bedtools genomecov`.
Note that some invocations of `bedtools genomecov` do not result in
a properly-formatted BED file. For example, the default behavior is to
report a histogram of coverage. Iterating over the resulting,
non-BED-format file will raise exceptions in pybedtools' parser.
Consider using the `BedTool.to_dataframe` method to convert these
non-BED files into a pandas DataFrame for further use.
Example usage:
BAM file input does not require a genome:
Expand All @@ -1993,6 +2001,10 @@ def genome_coverage(self):
chr2L 10212 10248 1
chr2L 10255 10291 1
Non-BED format results:
>>> a = pybedtools.example_bedtool('x.bed')
>>> b = a.genome_coverage(genome='dm3')
>>> df = b.to_dataframe(names=['chrom', 'depth', 'n', 'chromsize', 'fraction'])
"""
Expand Down

0 comments on commit e83c621

Please sign in to comment.