# HG changeset patch # User jowong # Date 1541784477 18000 # Node ID 98f9da980bf5ad2f1c044b96c5a3fa73ec198e04 # Parent 74a9f37e2bc91e8f318701ca052d24470e0be75e planemo upload for repository https://github.com/jowong4/add_sample_name_as_first_line_of_file commit f3fe76f6cbf17b0ec4162065206483652a6519b7-dirty diff -r 74a9f37e2bc9 -r 98f9da980bf5 add_sample_name_as_first_line.py --- a/add_sample_name_as_first_line.py Fri Oct 26 17:52:33 2018 -0400 +++ b/add_sample_name_as_first_line.py Fri Nov 09 12:27:57 2018 -0500 @@ -17,7 +17,7 @@ #print >> output, args.label #print >> output, input -sample_name = re.sub('(_1.fastq(.gz)*|_2.fastq(.gz)*|.fastq(.gz)*)', '', args.label.rstrip().lstrip()) +sample_name = re.sub('(_1.fastq(.gz)*|_2.fastq(.gz)*|.fastq(.gz)*)', '', args.sample.rstrip().lstrip()) with open(args.input) as input: with open(args.output, 'w') as output: diff -r 74a9f37e2bc9 -r 98f9da980bf5 add_sample_name_as_first_line.xml --- a/add_sample_name_as_first_line.xml Fri Oct 26 17:52:33 2018 -0400 +++ b/add_sample_name_as_first_line.xml Fri Nov 09 12:27:57 2018 -0500 @@ -1,4 +1,4 @@ - + to an existing tabular file add_sample_name_as_first_line.py --input "$input" @@ -23,7 +23,7 @@ **What it does** -Adds a new line with the name of the sample file and removing [_12].fastq.gz from the name if there is match to the pattern. +Adds a new line with the name of the sample file and removing [(_1|_2)]*.fastq(.gz)* from the name if there is match to the pattern. Written by Johnathan Kwan Long Wong, johnathanwong4@gmail.com