changeset 2:c60511d9c6be draft default tip

planemo upload for repository https://github.com/jowong4/add_sample_name_as_first_line_of_file commit f3fe76f6cbf17b0ec4162065206483652a6519b7-dirty
author jowong
date Fri, 09 Nov 2018 12:13:19 -0500
parents 45be17ffad90
children
files add_sample_name_as_first_line.py add_sample_name_as_first_line.xml
diffstat 2 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/add_sample_name_as_first_line.py	Sun Oct 21 09:36:07 2018 -0400
+++ b/add_sample_name_as_first_line.py	Fri Nov 09 12:13:19 2018 -0500
@@ -6,7 +6,7 @@
   the_parser = argparse.ArgumentParser(description="add label to first line of file")
   the_parser.add_argument('--input', required=True, action="store", type=str, help="input file")
   the_parser.add_argument('--output', required=True,  action="store", type=str, help="output file path")
-  the_parser.add_argument('--label', required=True, action="store", type=str, help="label to add in the first line")
+  the_parser.add_argument('--sample', required=True, action="store", type=str, help="label to add in the first line")
   args = the_parser.parse_args()
   return args
 
@@ -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:
--- a/add_sample_name_as_first_line.xml	Sun Oct 21 09:36:07 2018 -0400
+++ b/add_sample_name_as_first_line.xml	Fri Nov 09 12:13:19 2018 -0500
@@ -1,4 +1,4 @@
-<tool id="my_addName" name="Add sample name as first line" version="0.1.0">
+<tool id="my_addName" name="Add sample name as first line" version="0.1.2">
   <description>to an existing tabular file</description>
   <command interpreter="python">add_sample_name_as_first_line.py 
     --input "$input" 
@@ -23,7 +23,7 @@
   <help>
 **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
   </help>
   <citations>