@@ -76,17 +76,20 @@ class Picard:
76
76
#look for 1 or 2 occurrences of WORD_THINGY=THINGY and the following help and return them as a dictified
77
77
#list of tuples
78
78
valid_args = []
79
- new_short_option = None ;
79
+ new_short_option = None
80
80
new_long_option = None
81
- new_description = '' ;
82
-
81
+ new_description = ''
82
+ R_parameter = False
83
+ #print picard_help
83
84
for line in picard_help .split ("\n " ):
84
85
m = re .search ("(?:^([\S_]+)=\S+\n ?)(?:\s+([\S\s]+))?$" , line )
85
86
86
87
if (m ):
87
88
#some args have only long
88
- if (new_short_option or new_long_option ) and new_description != '' :
89
+ if (new_short_option or new_long_option ) and new_description != '' and ( new_short_option != 'R' or R_parameter != True ) :
89
90
valid_args .append ((new_short_option , new_long_option , new_description .lstrip ()))
91
+ if new_short_option == 'R' :
92
+ R_parameter = True
90
93
new_short_option = None
91
94
new_long_option = None
92
95
new_description = ''
@@ -99,8 +102,11 @@ class Picard:
99
102
new_description = m .group (2 )
100
103
elif new_short_option or new_long_option :
101
104
new_description += line
102
-
103
105
valid_args .append ((new_short_option , new_long_option , new_description ))
106
+ if new_short_option == 'R' :
107
+ R_parameter = True
108
+ if 'R=reference_sequence.fasta' in picard_help and R_parameter == False :
109
+ valid_args .append (('R' ,'genome' ,'It does not matter becuase this will get overwritten anyway' ))
104
110
# for (short, longa, desc) in valid_args:
105
111
# print "%s, %s, %s" % (short, longa, desc[0:50])
106
112
# sys.exit(1)
@@ -109,12 +115,16 @@ class Picard:
109
115
110
116
111
117
if __name__ == '__main__' :
118
+ #list_of_args = sys.argv
112
119
#partially parse options to get versin/subcommand and add more options
113
120
preparser = argparse .ArgumentParser (description = "run picard" , add_help = False )
114
121
preparser .add_argument ("--version" , choices = cmo .util .programs ['picard' ].keys (), default = "default" )
115
122
preparser .add_argument ("--java-version" , choices = cmo .util .programs ['java' ].keys (), default = "default" )
116
123
preparser .add_argument ("--cmd" ,required = True )
117
124
options , _ = preparser .parse_known_args ()
125
+ #if '--generate_cwl_tool' in list_of_args:
126
+ # base_command = ' '.join([sys.argv[0],'--version',options.version,'--java-version',options.java_version,'--cmd',options.cmd])
127
+ # sys.argv = [sys.argv[0], sys.argv[-1],'-b',base_command]
118
128
#time for monkey business
119
129
picard_helper = Picard (java_version = options .java_version , version = options .version )
120
130
(sub_command_options , error_msg ) = picard_helper .find_sub_command_options (options .cmd )
0 commit comments