comparison biohansel.xml @ 1:1f8eccf9d15d draft

planemo upload for repository https://github.com/phac-nml/biohansel commit b0060acc515bac2a79f60bb3c9d1f3243a5769f3
author nml
date Mon, 05 Nov 2018 16:18:22 -0500
parents c6e29bb1ab31
children aaab9b598c9e
comparison
equal deleted inserted replaced
0:c6e29bb1ab31 1:1f8eccf9d15d
8 8
9 #import re 9 #import re
10 10
11 ## Illumina FASTQ naming regular expression (https://github.com/phac-nml/biohansel/issues/38) 11 ## Illumina FASTQ naming regular expression (https://github.com/phac-nml/biohansel/issues/38)
12 #set global $ILLUMINA_REGEX = $re.compile(r'^([\w\-\_]+)_S\d+_L\d{3}_R(\d)_001\.fastq(\.gz)?$') 12 #set global $ILLUMINA_REGEX = $re.compile(r'^([\w\-\_]+)_S\d+_L\d{3}_R(\d)_001\.fastq(\.gz)?$')
13 #set global $FASTQ_DUMP_REGEX = $re.compile(r'^(\w+|\d+):((forward|reverse)(_\d+)?)\.fastq(\.gz|sanger)?$')
13 14
14 #def is_gzipped_fastq($data_input) 15 #def is_gzipped_fastq($data_input)
15 ## Is FASTQ data param gzipped type? i.e. either 'fastq.gz' or 'fastqsanger.gz'? 16 ## Is FASTQ data param gzipped type? i.e. either 'fastq.gz' or 'fastqsanger.gz'?
16 #return $data_input.is_of_type('fastqsanger.gz') or $data_input.is_of_type('fastq.gz') 17 #return $data_input.is_of_type('fastqsanger.gz') or $data_input.is_of_type('fastq.gz')
17 #end def 18 #end def
22 #end def 23 #end def
23 24
24 #def base_sample_name($name) 25 #def base_sample_name($name)
25 ## Get the base sample name and append 1/2 depending on if forward/reverse read 26 ## Get the base sample name and append 1/2 depending on if forward/reverse read
26 #set $illumina_match = $ILLUMINA_REGEX.match($name) 27 #set $illumina_match = $ILLUMINA_REGEX.match($name)
28 #set $fastq_dump_match = $FASTQ_DUMP_REGEX.match($name)
29
27 #if $illumina_match 30 #if $illumina_match
28 #return $illumina_match.group(1) 31 #return $illumina_match.group(1)
29 #elif $re.search(r'_R(1|2)', $name): 32 #elif $re.search(r'_R(1|2)', $name):
30 #return $re.sub(r'(.+)_R(1|2)([^\.]*)(\..+)', r'\1\3', $name) 33 #return $re.sub(r'(.+)_R(1|2)([^\.]*)(\..+)', r'\1\3', $name)
31 #elif $re.match(r'.+_\d\.', $name): 34 #elif $re.match(r'.+_\d\.', $name):
32 #return $re.sub(r'(.+)_(\d)(\..+)', r'\1', $name) 35 #return $re.sub(r'(.+)_(\d)(\..+)', r'\1', $name)
33 #else 36 #elif $fastq_dump_match
37 #return $fastq_dump_match.group(1)
38 #else
34 #return $name 39 #return $name
35 #end if 40 #end if
36 #end def 41 #end def
37 42
38 #def get_paired_fastq_filename($data_input, $name=None, $is_forward=True) 43 #def get_paired_fastq_filename($data_input, $name=None, $is_forward=True)