반응형

python multi-level argparse

 

 

parser = argparse.ArgumentParser()

subparser = parser.add_subparsers(help='Desired action to perform', dest='action')

parent_parser = argparse.ArgumentParser(add_help=False)

parser_ReDemulti = subparser.add_parser("ReDemulti", parents=[parent_parser], help='Re Demultiplexing')
parser_ReDemulti.add_argument("RunID", help='Only require one run ID which have Samplesheet_gpcd.csv')

parser_MultiAnal = subparser.add_parser("MultiAnal", parents=[parent_parser], help='Multiple Analysis from One Customer')
parser_MultiAnal.add_argument("SampleFile", help='A file with one sample ID per line')

parser_NoData = subparser.add_parser("NoDataSamples", parents=[parent_parser], help='Re Run No-Data Samples')
parser_NoData.add_argument("SampleFile", help='A file with one sample ID per line')

parser_RunFastQC = subparser.add_parser("RunFastQC", parents=[parent_parser], help='Run from FastQC Step')
parser_RunFastQC.add_argument("SampleID", help='Only require one sample ID')

parser_RmDenovo = subparser.add_parser("RmDenovoFiles", parents=[parent_parser], help='Remove Database Files in denovo01')
parser_RmDenovo.add_argument("SampleID", help='Only require one sample ID')

args = parser.parse_args()
반응형

'Computer Science > python' 카테고리의 다른 글

Primer 서열 분석을 위한 python 코드  (0) 2021.08.17
String Format으로 길이 고정하기  (0) 2020.06.24
python 파일 입출력  (0) 2019.07.12
Python 설치 및 실행하기  (0) 2017.08.16
cannot mkdir R_TempDir 에러  (0) 2016.09.07

+ Recent posts