Skip to content

Commit

Permalink
Update HeatCluster.py
Browse files Browse the repository at this point in the history
  • Loading branch information
DrB-S authored Oct 20, 2023
1 parent 5794311 commit d8cfa0a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions HeatCluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
import matplotlib.pyplot as plt
from pathlib import Path


parser = argparse.ArgumentParser()
parser.add_argument('-i', '--input', type=str, help='input SNP matrix', default='snp-dists.txt')
parser.add_argument('-i', '--input', type=str, help='input SNP matrix file name', default='snp-dists.txt')
parser.add_argument('-o', '--out', type=str, help='final file name', default='SNP_matrix')
parser.add_argument('-t', '--type', type=str, help='file extension for final image', default = 'pdf')
parser.add_argument('-v', '--version', help='print version and exit', action='version', version='%(prog)s ' + '0.4.10')
Expand All @@ -25,9 +26,9 @@ def read_snp_matrix(file):
tabs = pd.read_csv(file, nrows=1, sep='\t').shape[1]
commas = pd.read_csv(file, nrows=1, sep=',').shape[1]
if tabs > commas:
df = pd.read_csv(file, sep='\t', index_col= False)
df = pd.read_csv(file, sep='\t', index_col= False)
else:
df = pd.read_csv(file, sep=',', index_col= False)
df = pd.read_csv(file, sep=',', index_col= False)

return df

Expand Down Expand Up @@ -64,8 +65,8 @@ def main():
path.resolve(strict=True)
except FileNotFoundError:
path = Path('./snp_matrix.txt')
print("Using file path:", path)

print("Using file path:", path)
lines = read_snp_matrix(path)
numSamples = len(lines) - 1

Expand Down

0 comments on commit d8cfa0a

Please sign in to comment.