Mercurial > repos > portiahollyoak > fastuniq
annotate create_input_list.py @ 0:816cb55b5a2d draft default tip
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
| author | portiahollyoak | 
|---|---|
| date | Thu, 02 Jun 2016 11:34:51 -0400 | 
| parents | |
| children | 
| rev | line source | 
|---|---|
| 
0
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
1 import argparse | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
2 | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
3 | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
4 description = ("This script will create a input list file for input into FastUniq") | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
5 | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
6 parser = argparse.ArgumentParser() | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
7 parser.add_argument("--fastq_R1", nargs="*", help="Path to Fastq file containing R1 reads") | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
8 parser.add_argument("--fastq_R2", nargs="*", help="Path to Fastq file containing R2 reads") | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
9 parser.add_argument("--output_list", help="List containing file paths") | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
10 args = parser.parse_args() | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
11 | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
12 template = "{fastq_R1}\n{fastq_R2}\n" | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
13 with open(args.output_list, "w") as output: | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
14 for fastq_R1, fastq_R2 in zip(args.fastq_R1, args.fastq_R2): | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
15 list_line = template.format(fastq_R1=fastq_R1, fastq_R2=fastq_R2) | 
| 
 
816cb55b5a2d
planemo upload for repository https://github.com/portiahollyoak/Tools commit c4769fd68ad9583d4b9dbdf212e4ecb5968cef1c-dirty
 
portiahollyoak 
parents:  
diff
changeset
 | 
16 output.write(list_line) | 
