The final program that you will have to write is expected to do the following things:
In the regular expression below ([^"]+) the parentheses are used to capture a motif (here, a succession of characters that are different from ‘"’. The found motif can be recovered using the group() method.
import re
a_string = 'cds_id "cds1"; transcript_id "tx1"; gene_id "g1";'
hit = re.search('transcript_id "([^"]+)"', a_string)
if hit:
print(hit.group(1))
## tx1
The argument parser can be used
# Declare an argument parser
import argparse
DESCRIPTION = "The program description."
parser = argparse.ArgumentParser(add_help=True, description=DESCRIPTION)
parser.add_argument('-i', '--inputfile',
help="The input file.",
default=None,
type=argparse.FileType('r'),
required=True)
parser.add_argument('-o', '--outputfile',
help="The outputfile.",
default=None,
type=argparse.FileType('r'),
required=True)
parser.add_argument('-c', '--color',
help="The color of the diagram.",
default="magenta",
type=str,
required=False)
args = parser.parse_args()
args = dict(args.__dict__)