Mercurial > repos > devteam > fastqc
comparison rgFastQC.py @ 12:919cf12bb71c draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/fastqc commit 4a3c9f195ba5d899b1a1ce5e80281cdf230f456a
| author | iuc |
|---|---|
| date | Mon, 23 Oct 2017 13:23:42 -0400 |
| parents | 0a7c65540937 |
| children |
comparison
equal
deleted
inserted
replaced
| 11:f5a25a56ab9d | 12:919cf12bb71c |
|---|---|
| 56 if linf.endswith('.gz') or linf.endswith('.gzip') or ftype[-1] == "gzip" or informat.endswith('.gz'): | 56 if linf.endswith('.gz') or linf.endswith('.gzip') or ftype[-1] == "gzip" or informat.endswith('.gz'): |
| 57 f = gzip.open(self.opts.input) | 57 f = gzip.open(self.opts.input) |
| 58 try: | 58 try: |
| 59 f.readline() | 59 f.readline() |
| 60 ftype = ['gzip'] | 60 ftype = ['gzip'] |
| 61 except: | 61 except Exception: |
| 62 trimext = True | 62 trimext = True |
| 63 f.close() | 63 f.close() |
| 64 elif linf.endswith('bz2') or informat.endswith('.bz2'): | 64 elif linf.endswith('bz2') or informat.endswith('.bz2'): |
| 65 f = bz2.BZ2File(self.opts.input, 'r') | 65 f = bz2.BZ2File(self.opts.input, 'r') |
| 66 try: | 66 try: |
| 67 ftype = ['bzip2'] | 67 ftype = ['bzip2'] |
| 68 f.readline() | 68 f.readline() |
| 69 except: | 69 except Exception: |
| 70 trimext = True | 70 trimext = True |
| 71 f.close() | 71 f.close() |
| 72 elif linf.endswith('.zip'): | 72 elif linf.endswith('.zip'): |
| 73 if not zipfile.is_zipfile(self.opts.input): | 73 if not zipfile.is_zipfile(self.opts.input): |
| 74 trimext = True | 74 trimext = True |
| 75 if trimext: | 75 if trimext: |
| 76 f = open(self.opts.input) | 76 f = open(self.opts.input) |
| 77 try: | 77 try: |
| 78 f.readline() | 78 f.readline() |
| 79 except: | 79 except Exception: |
| 80 raise Exception("Input file corruption, could not identify the filetype") | 80 raise Exception("Input file corruption, could not identify the filetype") |
| 81 infname = os.path.splitext(infname)[0] | 81 infname = os.path.splitext(infname)[0] |
| 82 | 82 |
| 83 # Replace unwanted or problematic charaters in the input file name | 83 # Replace unwanted or problematic charaters in the input file name |
| 84 self.fastqinfilename = re.sub(r'[^a-zA-Z0-9_\-\.]', '_', os.path.basename(infname)) | 84 self.fastqinfilename = re.sub(r'[^a-zA-Z0-9_\-\.]', '_', os.path.basename(infname)) |
