Mercurial > repos > jowong > add_sample_as_first_line
comparison add_sample_name_as_first_line.py @ 3:98f9da980bf5 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:27:57 -0500 |
parents | 74a9f37e2bc9 |
children |
comparison
equal
deleted
inserted
replaced
2:74a9f37e2bc9 | 3:98f9da980bf5 |
---|---|
15 #output=open(args.output, 'w') | 15 #output=open(args.output, 'w') |
16 | 16 |
17 #print >> output, args.label | 17 #print >> output, args.label |
18 #print >> output, input | 18 #print >> output, input |
19 | 19 |
20 sample_name = re.sub('(_1.fastq(.gz)*|_2.fastq(.gz)*|.fastq(.gz)*)', '', args.label.rstrip().lstrip()) | 20 sample_name = re.sub('(_1.fastq(.gz)*|_2.fastq(.gz)*|.fastq(.gz)*)', '', args.sample.rstrip().lstrip()) |
21 | 21 |
22 with open(args.input) as input: | 22 with open(args.input) as input: |
23 with open(args.output, 'w') as output: | 23 with open(args.output, 'w') as output: |
24 output.write(sample_name+"\n") | 24 output.write(sample_name+"\n") |
25 for line in input: | 25 for line in input: |