rnalysis.filtering.CountFilter.from_folder
- classmethod CountFilter.from_folder(folder_path: str, save_csv: bool = False, fname: str = None, input_format: str = '.txt') CountFilter
Iterates over count .txt files in a given folder and combines them into a single CountFilter table. Can also save the count data table and the uncounted data table to .csv files.
- Parameters:
folder_path – str or pathlib.Path. Full path of the folder that contains individual htcount .txt files.
save_csv – bool. If True, the joint DataFrame of count data and uncounted data will be saved to two separate .csv files. The files will be saved in ‘folder_path’, and named according to the parameters ‘counted_fname’ for the count data, and ‘uncounted_fname’ for the uncounted data (unaligned, alignment not unique, etc).
fname – str. Name under which to save the combined count data table. Does not need to include the ‘.csv’ suffix.
input_format – the file format of the input files. Default is ‘.txt’.
- Returns:
an CountFilter object containing the combined count data from all individual htcount .txt files in the specified folder.
- Examples:
>>> from rnalysis import filtering >>> c = filtering.CountFilter.from_folder('tests/test_files/test_count_from_folder')