qbed_df_to_pyranges
Convert a qbed dataframe to a pyranges dataframe.
:param df: The qbed dataframe. :type df: pd.DataFrame :return: The pyranges dataframe. :rtype: pd.DataFrame
:Example:
import pandas as pd df = pd.DataFrame({‘chr’: [‘chr1’, ‘chr1’], … ‘start’: [1, 2], … ‘end’: [2, 3], … ‘strand’: [‘+’, ‘-‘], … ‘depth’: [1, 2]}) pyranges_df = qbed_df_to_pyranges(df) list(pyranges_df.columns) == [‘Chromosome’, ‘Start’, ‘End’, ‘Strand’, ‘depth’] True
Source code in callingcardstools/PeakCalling/yeast/read_in_data.py
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 |
|