Skip to content

Commit

Permalink
Merge pull request kapsakcj#1 from theiagen/ajp-version
Browse files Browse the repository at this point in the history
Output version
  • Loading branch information
kapsakcj authored May 18, 2023
2 parents 6cda171 + 0149513 commit 4b12889
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion centroid.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"""
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 4b12889

Please sign in to comment.