code: def filter_N_top(self, inst_rc, N_top, rank_type='sum'):
      '''
      Filter the matrix rows or columns based on sum/variance, and only keep the top
      N.
      '''
      inst_df = self.dat_to_df()
  
      inst_df = run_filter.filter_N_top(inst_rc, inst_df, N_top, rank_type)
  
      self.df_to_dat(inst_dff filter_N_top(self, inst_rc, N_top, rank_type='sum'):
      '''
      Filter the matrix rows or columns based on sum/variance, and only keep the top
      N.
      '''
      inst_df = self.dat_to_df()
  
      inst_df = run_filter.filter_N_top(inst_rc, inst_df, N_top, rank_type)
  
      self.df_to_dat(inst_df)
docs: Filter the matrix rows or columns based on sum/variance, and only keep the top
      N.