# HG changeset patch # User greg # Date 1609689276 0 # Node ID fb3defef50e575c1150eb5622f4e961232115a1b # Parent a56648c94fd3aec55e34c3f4c83ecc43722a83af Uploaded diff -r a56648c94fd3 -r fb3defef50e5 macros.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/macros.xml Sun Jan 03 15:54:36 2021 +0000 @@ -0,0 +1,24 @@ + + + 1.0 + 19.09 + + + + + + + + + + @misc{None, + journal = {None}, + author = {1. Stuber T}, + title = {Manuscript in preparation}, + year = {None}, + url = {https://github.com/USDA-VS/vSNP},} + + + + + diff -r a56648c94fd3 -r fb3defef50e5 vsnp_sample_names.xml --- a/vsnp_sample_names.xml Tue Oct 27 18:26:58 2020 +0000 +++ b/vsnp_sample_names.xml Sun Jan 03 15:54:36 2021 +0000 @@ -1,91 +1,100 @@ - + + + macros.xml + 0: - #set sample_name = $sample_name.split(".")[0] - #end if - #if $sample_name.find("_") > 0: - #set sample_name = $sample_name.split("_")[0] + +#set sample_name_read2 = None + +#if $input_type_cond.input_type in ['single', 'pair']: + #set read1 = $input_type_cond.read1 + #set sample_name = re.sub('[^\s\w\-]', '_', str($read1.element_identifier)) +#else: + #set read1_filename = $input_type_cond.reads_collection['forward'].name + #set sample_name = re.sub('[^\s\w\-]', '_', str($read1_filename)) +#end if + +#if $sample_name.find('_R1') >0: + ## Something like CMC_20E1_R1.fastq.gz + #set sample_name = $sample_name.split('_R1')[0] +#else if $sample_name.find(".") > 0: + #if $read1.is_of_type('fastqsanger.gz'): + ## Something like my_sample.fastq.gz + #set sample_name = '.'.join($sample_name.split('.')[0:-2]) + #else: + ## Something like my_sample.fastq + #set sample_name = $os.path.splitext($sample_name)[0] #end if - && echo '$sample_name' > '$output' -#else: - #for $i in $input_type_cond.reads_collection: - #set sample_name = $os.path.basename($i.element_identifier) - #if $sample_name.find(".") > 0: - #set sample_name = $sample_name.split(".")[0] - #end if - #set output_file = $os.path.join($output_dir, $sample_name) - && echo '$sample_name' > '$output_file' - #end for +#else if $sample_name.find("_") > 0: + #if $read1.is_of_type('fastqsanger.gz'): + ## Something like my_sample_fastq_gz + #set sample_name = '_'.join($sample_name.split('_')[0:-2]) + #else: + ## Something like my_sample_fastq + #set sample_name = "_".join($sample_name.split("_")[0:-1]) + #end if #end if +echo '$sample_name' > '$output' ]]> - - + + + - + - - + + + + + + - - input_type_cond['input_type'] == 'single' - - - - input_type_cond['input_type'] == 'collection' - + + - + + + + + + + - - - - + + + - - - - - + + + + + + + + **What it does** -Accepts one or more sample files and extracts a unique portion of the file name as the content of the output file(s). These -text files are then used as workflow parameter values for the Read Group Identifier parameter in the bwa-mem tool. - -**Required Options** - - * **Choose the category of the files to be analyzed** - select "Single files" or "Collections of files", then select the appropriate history items (single or paired fastqsanger reads or collections of fastqsanger reads) based on the selected option. +Accepts fastqsanger sample files, extracts a unique portion of the file name as the sample name, and writes it to +the output. The output text file can be consumed by the **Parse parameter value** expression tool to provide workflow +parameter values to the **Read group identifier (ID)** and the **Sample name identifier (SM)** parameters in the +**Map with BWA-MEM** tool. - - - @misc{None, - journal = {None}, - author = {1. Stuber T}, - title = {Manuscript in preparation}, - year = {None}, - url = {https://github.com/USDA-VS/vSNP},} - - +