# HG changeset patch # User greg # Date 1631561710 0 # Node ID 4f43f163c4084f18df611134c8bd15e9a546cea7 # Parent e1cb13d6a82c393e897e0e16703e1c067509d47d "planemo upload for repository https://github.com/gregvonkuster/galaxy_tools/tree/master/tools/sequence_analysis/vsnp/vsnp_sample_names commit 9f80907d5bebf572ecd34e1171751c9091cb8697" diff -r e1cb13d6a82c -r 4f43f163c408 test-data/sample_names.txt --- a/test-data/sample_names.txt Fri Sep 03 17:21:52 2021 +0000 +++ b/test-data/sample_names.txt Mon Sep 13 19:35:10 2021 +0000 @@ -1,1 +1,1 @@ -CMC_20E1 +CMC_20E1_R1_fastq_gz diff -r e1cb13d6a82c -r 4f43f163c408 test-data/sample_names2.txt --- a/test-data/sample_names2.txt Fri Sep 03 17:21:52 2021 +0000 +++ b/test-data/sample_names2.txt Mon Sep 13 19:35:10 2021 +0000 @@ -1,1 +1,1 @@ -SRR14085881 +CMC_20E1_R diff -r e1cb13d6a82c -r 4f43f163c408 test-data/sample_names3.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/sample_names3.txt Mon Sep 13 19:35:10 2021 +0000 @@ -0,0 +1,1 @@ +CMC_20E1_R diff -r e1cb13d6a82c -r 4f43f163c408 test-data/sample_names4.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/sample_names4.txt Mon Sep 13 19:35:10 2021 +0000 @@ -0,0 +1,1 @@ +SRR14085881_ diff -r e1cb13d6a82c -r 4f43f163c408 vsnp_sample_names.xml --- a/vsnp_sample_names.xml Fri Sep 03 17:21:52 2021 +0000 +++ b/vsnp_sample_names.xml Mon Sep 13 19:35:10 2021 +0000 @@ -5,12 +5,11 @@ 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') and $sample_name.endswith('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 -#else if $sample_name.find("_") > 0: - #if $read1.is_of_type('fastqsanger.gz') and $sample_name.endswith('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 + #set read1_name = $input_type_cond.reads_collection['forward'].name + #set read1_identifier = re.sub('[^\s\w\-]', '_', str($read1_name)) + #set read2_name = $input_type_cond.reads_collection['reverse'].name + #set read2_identifier = re.sub('[^\s\w\-]', '_', str($read2_name)) + #set matches = difflib.SequenceMatcher(None, read1_identifier, read2_identifier).get_matching_blocks() + #set match = $matches[0] + #set sample_name = re.sub('[^\s\w\-]', '_', str($read1_identifier[match.a:match.a + match.size])) #end if echo '$sample_name' > '$output' @@ -82,7 +64,7 @@ - + @@ -93,7 +75,7 @@ - + @@ -104,7 +86,7 @@ - +