You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This function parses the regions specification and returns a dataframe with the first three columns ['Chromosome', 'Start', 'End']
@@ -381,7 +381,7 @@ def regionparser(
381
381
If None, the width will be the same as the input regions, and would be 1000bp when regions are specified by gene names.
382
382
header: bool
383
383
Only when you input a file path. If True, the first row of the regions dataframe is considered as the header. If False, the first row is considered as data.
384
-
This is useful when the regions are specified by a file that has a header.
384
+
This is useful when the regions are specified by a file that has a header. If None, if the filename ends with '.bed' or '.bed.gz' , it will be considered as True, otherwise False.
385
385
Returns
386
386
-------
387
387
regions: pd.DataFrame
@@ -408,6 +408,9 @@ def regionparser(
408
408
eliftype(regions) ispd.core.series.Series:
409
409
regions=pd.DataFrame(regions.values[None])
410
410
eliftype(regions) isstr:
411
+
if (regions.endswith(".bed")) or (regions.endswith(".bed.gz")):
412
+
header=TrueifheaderisNoneelseheader
413
+
411
414
if":"inregionsand"-"inregions:
412
415
# regions = pd.DataFrame([re.split(':|-', regions)], columns=['Chromosome', 'Start', 'End'])
0 commit comments