Skip to content

Commit

Permalink
Update heatcluster.py
Browse files Browse the repository at this point in the history
Line 102: #df.columns = df.columns.map(str) #df.columns.map doesn't work in Polars, so see it line 112 will work without it
  • Loading branch information
DrB-S authored Feb 1, 2024
1 parent cb4624a commit ad679b8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions heatcluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ def read_snp_matrix(file):
commas = pl.scan_csv(file, n_rows=1, separator=',')
if len(tabs.columns) > len(commas.columns):
logging.debug('The file is tab-delimited')
df = pl.scan_csv(file, separator='\t', row_index_name=None)
df = pl.scan_csv(file, separator='\t', row_index_name=None, has_header=True)
else:
logging.debug('The file is comma-delimited')
df = pl.scan_csv(file, separator=',', row_index_name=None)
df = pl.scan_csv(file, separator=',', row_index_name=None, has_header=True)
return df

def clean_and_read_df(df):
Expand All @@ -99,7 +99,7 @@ def clean_and_read_df(df):
"""
Convert column names to strings
"""
df.columns = df.columns.map(str)
#df.columns = df.columns.map(str) #df.columns.map doesn't work in Polars, so see it line 112 will work without it

"""
Define consensus patterns
Expand Down

0 comments on commit ad679b8

Please sign in to comment.