From 01495132e3d0272be326582cba6bdd78d19ff8fc Mon Sep 17 00:00:00 2001 From: Andrew Page Date: Thu, 18 May 2023 15:56:09 +0000 Subject: [PATCH] output version --- centroid.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/centroid.py b/centroid.py index e307fcb..07859b8 100644 --- a/centroid.py +++ b/centroid.py @@ -8,12 +8,14 @@ #Requires: mash #Usage: python centroid.py /path/to/assemblies/ +VERSION = "0.1.0" import sys import glob import numpy import operator from operator import itemgetter import subprocess +import argparse def Mash_List(Mash_Index): """Takes in an index of Mash files and makes a list of the info from each""" @@ -75,7 +77,18 @@ def Mash_Centroid(input_assembly_list): Best = Averages[0][0] return Best -Folder = sys.argv[1] + +parser = argparse.ArgumentParser( + description = '''Selects optimal reference genome given a set of fasta files''', + usage = 'centroid.py [options] /path/to/fasta_files/', + formatter_class=argparse.ArgumentDefaultsHelpFormatter) + +parser.add_argument('folder', help='Folder containing *.fasta files', type=str) +parser.add_argument('--version', action='version', version=str(VERSION)) +options = parser.parse_args() + + +Folder = options.folder Assembly_List = glob.glob(Folder + '/*.fasta') Centroid = Mash_Centroid(Assembly_List) print(Centroid)