def load_data(self, filename, transpose=True,<EOL>save_sparse_file='<STR_LIT>', sep='<STR_LIT:U+002C>', **kwargs):
if filename.split('<STR_LIT:.>')[-<NUM_LIT:1>] == '<STR_LIT:p>':<EOL><INDENT>raw_data, all_cell_names, all_gene_names = (<EOL>pickle.load(open(filename, '<STR_LIT:rb>')))<EOL>if(transpose):                <EOL><INDENT>raw_data = raw_data.T<EOL>if raw_data.getformat()=='<STR_LIT>':<EOL><INDENT>print("<STR_LIT>")<EOL>raw_data=raw_data.tocsr()<EOL><DEDENT><DEDENT>save_sparse_file = None<EOL><DEDENT>elif filename.split('<STR_LIT:.>')[-<NUM_LIT:1>] != '<STR_LIT>':<EOL><INDENT>df = pd.read_csv(filename, sep=sep, index_col=<NUM_LIT:0>)<EOL>if(transpose):<EOL><INDENT>dataset = df.T<EOL><DEDENT>else:<EOL><INDENT>dataset = df<EOL><DEDENT>raw_data = sp.csr_matrix(dataset.values)<EOL>all_cell_names = np.array(list(dataset.index.values))<EOL>all_gene_names = np.array(list(dataset.columns.values))<EOL><DEDENT>if filename.split('<STR_LIT:.>')[-<NUM_LIT:1>] != '<STR_LIT>':<EOL><INDENT>self.adata_raw = AnnData(X=raw_data, obs={'<STR_LIT>': all_cell_names},<EOL>var={'<STR_LIT>': all_gene_names})<EOL>if(np.unique(all_gene_names).size != all_gene_names.size):<EOL><INDENT>self.adata_raw.var_names_make_unique()<EOL><DEDENT>if(np.unique(all_cell_names).size != all_cell_names.size):<EOL><INDENT>self.adata_raw.obs_names_make_unique()<EOL><DEDENT>self.adata = self.adata_raw.copy()<EOL>self.adata.layers['<STR_LIT>'] = raw_data<EOL><DEDENT>else:<EOL><INDENT>self.adata_raw = anndata.read_h5ad(filename, **kwargs)<EOL>self.adata = self.adata_raw.copy()<EOL>if '<STR_LIT>' not in list(self.adata.layers.keys()):<EOL><INDENT>self.adata.layers['<STR_LIT>'] = self.adata.X<EOL><DEDENT>save_sparse_file = None<EOL><DEDENT>if(save_sparse_file == '<STR_LIT:p>'):<EOL><INDENT>new_sparse_file = '<STR_LIT:.>'.join(filename.split('<STR_LIT:/>')[-<NUM_LIT:1>].split('<STR_LIT:.>')[:-<NUM_LIT:1>])<EOL>path = filename[:filename.find(filename.split('<STR_LIT:/>')[-<NUM_LIT:1>])]<EOL>self.save_sparse_data(path + new_sparse_file + '<STR_LIT>')<EOL><DEDENT>elif(save_sparse_file == '<STR_LIT>'):<EOL><INDENT>new_sparse_file = '<STR_LIT:.>'.join(filename.split('<STR_LIT:/>')[-<NUM_LIT:1>].split('<STR_LIT:.>')[:-<NUM_LIT:1>])<EOL>path = filename[:filename.find(filename.split('<STR_LIT:/>')[-<NUM_LIT:1>])]<EOL>self.save_anndata(path + new_sparse_file + '<STR_LIT>')<EOL><DEDENT>
Loads the specified data file. The file can be a table of
        read counts (i.e. '.csv' or '.txt'), with genes as rows and cells
        as columns by default. The file can also be a pickle file (output from
        'save_sparse_data') or an h5ad file (output from 'save_anndata').

        This function that loads the file specified by 'filename'.

        Parameters
        ----------
        filename - string
            The path to the tabular raw expression counts file.

        sep - string, optional, default ','
            The delimeter used to read the input data table. By default
            assumes the input table is delimited by commas.

        save_sparse_file - str, optional, default 'h5ad'
            If 'h5ad', writes the SAM 'adata_raw' object to a h5ad file
            (the native AnnData file format) to the same folder as the original
            data for faster loading in the future. If 'p', pickles the sparse
            data structure, cell names, and gene names in the same folder as
            the original data for faster loading in the future.

        transpose - bool, optional, default True
            By default, assumes file is (genes x cells). Set this to False if
            the file has dimensions (cells x genes).