Skip to content
Snippets Groups Projects
Commit a99b62e4 authored by Max Bär's avatar Max Bär
Browse files

set up cli parser to take energy cutoff

parent 65561a6b
No related branches found
No related tags found
1 merge request!19Set up cli parser to take energy cutoff
...@@ -5,17 +5,29 @@ Created on Mon Nov 14 14:49:50 2022 ...@@ -5,17 +5,29 @@ Created on Mon Nov 14 14:49:50 2022
@author: baerma @author: baerma
""" """
import argparse import argparse
import logging
def create_parser():
parser = argparse.ArgumentParser(
prog = 'Priming site predictor',
description = 'Takes a cutoff energy and the predicts location of priming sites of transcripts',
epilog = 'To predict or not to predict')
parser.add_argument('energycutoff', type=float, help='a float as energy Cutoff')
#parser.add_argument('transcripts', help='fastafile containing transcripts') #What type is that? fasta? Actually doesn't make sense here
args = parser.parse_args()
energy_cutoff = args.energycutoff
return energy_cutoff
#possibly make a class out of this although I think it's an overkill
parser = argparse.ArgumentParser(description='Process some integers.') def letsgo():
parser.add_argument('integers', metavar='N', type=int, nargs='+', energy_cutoff = create_parser()
help='an integer for the accumulator') print(f"Your energy cutoff is {energy_cutoff}")
parser.add_argument('--sum', dest='accumulate', action='store_const',
const=sum, default=max,
help='sum the integers (default: find the max)')
args = parser.parse_args()
print(args.accumulate(args.integers))
if __name__ == '__main__':
logging.basicConfig(
format='[%(asctime)s: %(levelname)s] %(message)s (module "%(module)s")',
level=logging.INFO,
)
LOG = logging.getLogger(__name__)
letsgo()
#here we would point to the main module and parse the energy cutoff
...@@ -10,6 +10,6 @@ setup( ...@@ -10,6 +10,6 @@ setup(
packages = ['primingsitepredictor'], packages = ['primingsitepredictor'],
entry_points = { entry_points = {
'console_scripts': [ 'console_scripts': [
'psp = primingsitepredictor.main:main' 'primingsitepredictor = primingsitepredictor.cli:letsgo'
] ]
}) })
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment