methylcheck.load_both

methylcheck.load_both(filepath='.', format='beta_value', file_stem='', verbose=False, silent=False, column_names=None, rename_samples=False, sample_names='Sample_Name')

Creates and returns TWO objects (data and meta_data) from the given filepath. Confirms sample names match.

Returns TWO objects (data, meta) as dataframes for analysis. If meta_data files are found in multiple folders, it will read them all and try to match to the samples in the beta_values pickles by sample ID.
Arguments:
filepath:
Where to look for all the pickle files of processed data.
format:
‘beta_values’, ‘m_value’, or some other custom file pattern.
file_stem (string):
By default, methylprep process with batch_size creates a bunch of generically named files, such as ‘beta_values_1.pkl’, ‘beta_values_2.pkl’, ‘beta_values_3.pkl’, and so on. IF you rename these or provide a custom name during processing, provide that name here. (i.e. if your pickle file is called ‘GSE150999_beta_values_X.pkl’, then your file_stem is ‘GSE150999_’)
column_names:
if your processed csv files contain column names that differ from those expected, you can specify them as a list of strings by default it looks for [‘noob_meth’, ‘noob_unmeth’] or [‘meth’, ‘unmeth’] or [‘beta_value’] or [‘m_value’] Note: if you csv data has probe names in a column that is not the FIRST column, or is not named “IlmnID”, you should specify it with column_names and put it first in the list, like [‘illumina_id’, ‘noob_meth’, ‘noob_umeth’].
rename_samples:
if your meta_data contains a ‘Sample_Name’ column, the returned data and meta_data will have index and columns renamed to Sample_Names instead of Sample_IDs, respectively.
sample_name (string):
the column name to use in meta dataframe for sample names. Assumes ‘Sample_Name’ if unspecified.
verbose:
outputs more processing messages.
silent:
suppresses all processing messages, even warnings.