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

Merge branch 'feature_max' into 'main'

Set up cli parser to take energy cutoff

See merge request !19
parents 44df8433 a99b62e4
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
@author: baerma
"""
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.')
parser.add_argument('integers', metavar='N', type=int, nargs='+',
help='an integer for the accumulator')
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))
def letsgo():
energy_cutoff = create_parser()
print(f"Your energy cutoff is {energy_cutoff}")
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(
packages = ['primingsitepredictor'],
entry_points = {
'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