Mercurial > repos > p.lucas > ssuisserotyping_pipeline
comparison Prepare_Ssuis_serotypingPipeline.py @ 7:07cf23fc69c8 draft default tip
Uploaded
| author | p.lucas |
|---|---|
| date | Thu, 08 Aug 2024 08:01:21 +0000 |
| parents | 8e5694208b79 |
| children |
comparison
equal
deleted
inserted
replaced
| 6:76c82b2a43d2 | 7:07cf23fc69c8 |
|---|---|
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 #-*- coding: utf-8 -*- | 2 #-*- coding: utf-8 -*- |
| 3 #Libraries: | 3 #Libraries: |
| 4 import os, os.path, argparse, sys, gzip, re | 4 import os, os.path, argparse, sys, gzip, re |
| 5 | 5 |
| 6 | |
| 7 | |
| 8 ##### MAIN | 6 ##### MAIN |
| 9 def __main__(): | 7 def __main__(): |
| 10 ### Arguments: | 8 ### Arguments: |
| 11 parser = argparse.ArgumentParser(description='''Launch Ssuis_serotypingPipeline.pl with correct argument''', epilog="""This script needs few options use -h to see it.""") | 9 parser = argparse.ArgumentParser(description='''Launch Ssuis_serotypingPipeline.pl with correct argument''', epilog="""This script needs few options use -h to see it.""") |
| 12 | |
| 13 parser.add_argument('--fastq_file', dest='ffile') | 10 parser.add_argument('--fastq_file', dest='ffile') |
| 11 parser.add_argument('--fastq_file2', dest='ffile2') | |
| 14 parser.add_argument('--scoreName', dest='sname') | 12 parser.add_argument('--scoreName', dest='sname') |
| 15 parser.add_argument('--output2', dest='o2') | 13 parser.add_argument('--output2', dest='o2') |
| 16 parser.add_argument('--output3', dest='o3') | 14 parser.add_argument('--output3', dest='o3') |
| 17 parser.add_argument('--output4', dest='o4') | 15 parser.add_argument('--output4', dest='o4') |
| 18 parser.add_argument('--output5', dest='o5') | 16 parser.add_argument('--output5', dest='o5') |
| 31 parser.add_argument('--reverse', dest='r') | 29 parser.add_argument('--reverse', dest='r') |
| 32 | 30 |
| 33 ### Get argument in variable: | 31 ### Get argument in variable: |
| 34 options = parser.parse_args() | 32 options = parser.parse_args() |
| 35 ffile = options.ffile | 33 ffile = options.ffile |
| 34 ffile2 = options.ffile2 | |
| 36 sname = options.sname | 35 sname = options.sname |
| 37 output2 = options.o2 | 36 output2 = options.o2 |
| 38 output3 = options.o3 | 37 output3 = options.o3 |
| 39 output4 = options.o4 | 38 output4 = options.o4 |
| 40 output5 = options.o5 | 39 output5 = options.o5 |
| 64 r = "SINGLE" | 63 r = "SINGLE" |
| 65 os.system("cp "+ffile+" "+input_path+"/file_test.fastq") | 64 os.system("cp "+ffile+" "+input_path+"/file_test.fastq") |
| 66 | 65 |
| 67 elif ends == "pe": | 66 elif ends == "pe": |
| 68 os.system("cp "+ffile+" "+input_path+"/file_test"+f+".fastq") | 67 os.system("cp "+ffile+" "+input_path+"/file_test"+f+".fastq") |
| 69 os.system("cp "+ffile+" "+input_path+"/file_test"+r+".fastq") | 68 os.system("cp "+ffile2+" "+input_path+"/file_test"+r+".fastq") |
| 70 | 69 |
| 71 if sd is None: | 70 if sd is None: |
| 72 os.system("perl "+way_pipeline+"/Ssuis_serotypingPipeline.pl --fastq_directory "+str(fdir)+" --scoreName "+output_path+"Results --ends "+str(ends)+" --forward "+str(f)+" --reverse "+str(r)) | 71 os.system("perl "+way_pipeline+"/Ssuis_serotypingPipeline.pl --fastq_directory "+str(fdir)+" --scoreName "+output_path+"Results --ends "+str(ends)+" --forward "+str(f)+" --reverse "+str(r)) |
| 73 else: | 72 else: |
| 74 os.system("perl "+way_pipeline+"/Ssuis_serotypingPipeline.pl --fastq_directory "+str(fdir)+" --scoreName "+output_path+"Results --serotype_db "+str(sd)+" --serotype_definitions "+str(sdef)+" --cps2K "+str(cps)+" --Virulence_db "+str(Vdb)+" --recN_db "+str(recdb)+" --MLST_definitions "+str(MLSTdef)+" --MLST_db "+str(MLSTdb)+" --ends "+str(ends)+" --forward "+str(f)+" --reverse "+str(r)) | 73 os.system("perl "+way_pipeline+"/Ssuis_serotypingPipeline.pl --fastq_directory "+str(fdir)+" --scoreName "+output_path+"Results --serotype_db "+str(sd)+" --serotype_definitions "+str(sdef)+" --cps2K "+str(cps)+" --Virulence_db "+str(Vdb)+" --recN_db "+str(recdb)+" --MLST_definitions "+str(MLSTdef)+" --MLST_db "+str(MLSTdb)+" --ends "+str(ends)+" --forward "+str(f)+" --reverse "+str(r)) |
