Skip to content

Commit 7598de6

Browse files
authored
Merge pull request #77 from mskcc/new_picard
New Picard and qc fix
2 parents 7eab844 + ae27143 commit 7598de6

File tree

3 files changed

+20
-8
lines changed

3 files changed

+20
-8
lines changed

bin/cmo_picard

+15-5
Original file line numberDiff line numberDiff line change
@@ -76,17 +76,20 @@ class Picard:
7676
#look for 1 or 2 occurrences of WORD_THINGY=THINGY and the following help and return them as a dictified
7777
#list of tuples
7878
valid_args = []
79-
new_short_option = None;
79+
new_short_option = None
8080
new_long_option= None
81-
new_description = '';
82-
81+
new_description = ''
82+
R_parameter = False
83+
#print picard_help
8384
for line in picard_help.split("\n"):
8485
m= re.search("(?:^([\S_]+)=\S+\n?)(?:\s+([\S\s]+))?$", line)
8586

8687
if(m):
8788
#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):
8990
valid_args.append((new_short_option, new_long_option, new_description.lstrip()))
91+
if new_short_option == 'R':
92+
R_parameter = True
9093
new_short_option=None
9194
new_long_option=None
9295
new_description=''
@@ -99,8 +102,11 @@ class Picard:
99102
new_description = m.group(2)
100103
elif new_short_option or new_long_option:
101104
new_description+=line
102-
103105
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'))
104110
# for (short, longa, desc) in valid_args:
105111
# print "%s, %s, %s" % (short, longa, desc[0:50])
106112
# sys.exit(1)
@@ -109,12 +115,16 @@ class Picard:
109115

110116

111117
if __name__ =='__main__':
118+
#list_of_args = sys.argv
112119
#partially parse options to get versin/subcommand and add more options
113120
preparser = argparse.ArgumentParser(description="run picard", add_help=False)
114121
preparser.add_argument("--version", choices=cmo.util.programs['picard'].keys(), default="default")
115122
preparser.add_argument("--java-version", choices=cmo.util.programs['java'].keys(), default="default")
116123
preparser.add_argument("--cmd",required=True)
117124
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]
118128
#time for monkey business
119129
picard_helper = Picard(java_version=options.java_version, version=options.version)
120130
(sub_command_options, error_msg) = picard_helper.find_sub_command_options(options.cmd)

bin/cmo_qcpdf

+4-2
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,15 @@ if __name__ == "__main__":
6060
if isinstance(value, list):
6161
cmd = cmd + value
6262
else:
63-
cmd = cmd + [value]
63+
cmd = cmd + [str(value)]
6464
try:
65+
# print cmd
6566
cmo.util.call_cmd(" ".join(cmd))
6667
except:
6768
#don't kill the pipeline if we died bc qc can be rerun later
6869
print >>sys.stderr, "QC PDF Fail but continue anyway"
69-
sys.exit(0)
70+
raise
71+
#sys.exit(0)
7072

7173

7274

cmo/_version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44

55

66

7-
__version__ = '1.9.3'
7+
__version__ = '1.9.4'
88

0 commit comments

Comments
 (0)