Skip to content

Commit

Permalink
Expand docstring for fetch_summaries
Browse files Browse the repository at this point in the history
  • Loading branch information
nvictus committed Apr 14, 2024
1 parent 065a50e commit 195d66a
Showing 1 changed file with 28 additions and 4 deletions.
32 changes: 28 additions & 4 deletions bbi/cbbi.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -712,16 +712,41 @@ cdef class BBIFile:
df = pd.DataFrame(list(it), columns=self.schema['columns'])
for col, dtype in self.schema['dtypes'].items():
try:
df[col] = df[col].astype(dtype)
df.loc[:, col] = df[col].astype(dtype)
except:
pass

return df

def fetch_summaries(self, str chrom, int start, int end, int zoom=0):
"""
Return a DataFrame of complete summary statistic bins at a specific
zoom level overlapping a genomic query interval.
Return a DataFrame of complete summary statistic bins overlapping a
genomic query interval at a specific zoom level.
Parameters
----------
chrom : str
Chromosome name.
start : int
Start coordinate.
end : int
End coordinate. If end is less than zero, the end is set to the
chromosome size.
zoom : int, optional
Zoom level. Default is 0.
Returns
-------
pandas.DataFrame
Notes
-----
The summary fields are 'validCount', 'min', 'max', 'sum', 'sumSquares'.
See Also
--------
fetch : Fetch the signal track of a single interval
fetch_intervals : Fetch feature intervals overlapping a genomic interval
"""
if self.bbi == NULL:
raise OSError("File closed")
Expand Down Expand Up @@ -762,7 +787,6 @@ cdef class BBIFile:
return i



cdef class BigWigIntervalIterator:

cdef str chrom
Expand Down

0 comments on commit 195d66a

Please sign in to comment.