Mercurial > repos > cstrittmatter > test_eurl_vtec_wgs_pt
comparison scripts/rgFastQC.py @ 3:0cbed1c0a762 draft default tip
planemo upload commit 15239f1674081ab51ab8dd75a9a40cf1bfaa93e8
author | cstrittmatter |
---|---|
date | Tue, 28 Jan 2020 10:42:31 -0500 |
parents | 965517909457 |
children |
comparison
equal
deleted
inserted
replaced
2:6837f733b4aa | 3:0cbed1c0a762 |
---|---|
68 f.close() | 68 f.close() |
69 elif linf.endswith('.zip'): | 69 elif linf.endswith('.zip'): |
70 if not zipfile.is_zipfile(self.opts.input): | 70 if not zipfile.is_zipfile(self.opts.input): |
71 trimext = True | 71 trimext = True |
72 if trimext: | 72 if trimext: |
73 f = open(self.opts.input) | 73 f = open(self.opts.input) |
74 try: | 74 try: |
75 f.readline() | 75 f.readline() |
76 except: | 76 except: |
77 raise Exception("Input file corruption, could not identify the filetype") | 77 raise Exception("Input file corruption, could not identify the filetype") |
78 infname = os.path.splitext(infname)[0] | 78 infname = os.path.splitext(infname)[0] |
79 | 79 |
80 # Replace unwanted or problematic charaters in the input file name | 80 # Replace unwanted or problematic charaters in the input file name |
81 self.fastqinfilename = re.sub(ur'[^a-zA-Z0-9_\-\.]', '_', os.path.basename(infname)) | 81 self.fastqinfilename = re.sub(r'[^a-zA-Z0-9_\-\.]', '_', os.path.basename(infname)) |
82 # check that the symbolic link gets a proper ending, fastqc seems to ignore the given format otherwise | 82 # check that the symbolic link gets a proper ending, fastqc seems to ignore the given format otherwise |
83 if 'fastq' in opts.informat: | 83 if 'fastq' in opts.informat: |
84 # with fastq the .ext is ignored, but when a format is actually passed it must comply with fastqc's | 84 # with fastq the .ext is ignored, but when a format is actually passed it must comply with fastqc's |
85 # accepted formats.. | 85 # accepted formats.. |
86 opts.informat = 'fastq' | 86 opts.informat = 'fastq' |
90 # Build the Commandline from the given parameters | 90 # Build the Commandline from the given parameters |
91 command_line = [opts.executable, '--outdir %s' % opts.outputdir] | 91 command_line = [opts.executable, '--outdir %s' % opts.outputdir] |
92 if opts.contaminants != None: | 92 if opts.contaminants != None: |
93 command_line.append('--contaminants %s' % opts.contaminants) | 93 command_line.append('--contaminants %s' % opts.contaminants) |
94 if opts.limits != None: | 94 if opts.limits != None: |
95 command_line.append('--limits %s' % opts.limits) | 95 command_line.append('--limits %s' % opts.limits) |
96 command_line.append('--quiet') | 96 command_line.append('--quiet') |
97 command_line.append('--extract') # to access the output text file | 97 command_line.append('--extract') # to access the output text file |
98 command_line.append(self.fastqinfilename) | 98 command_line.append(self.fastqinfilename) |
99 command_line.append('-f %s' % opts.informat) | 99 command_line.append('-f %s' % opts.informat) |
100 self.command_line = ' '.join(command_line) | 100 self.command_line = ' '.join(command_line) |