Skip to content

Commit cbe2596

Browse files
committed
Added a new way to handle paired data.
1 parent f821484 commit cbe2596

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

4Pipe4.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,15 @@
4141
The arguments can be given in any order.",
4242
prog="4Pipe4",
4343
formatter_class=RawTextHelpFormatter)
44-
parser.add_argument("-i", dest="infile", nargs=1, required=True,
44+
45+
group = parser.add_mutually_exclusive_group(required=True)
46+
group.add_argument("-i", dest="infile", nargs=1, required=False,
4547
help="Provide the full path to your target input file\n",
4648
metavar="input_file")
49+
group.add_argument("-p", dest="infile", nargs=2, required=False,
50+
help="Provide the full path to your target input pair files\n",
51+
metavar="input_pair")
52+
4753
parser.add_argument("-o", dest="outfile", nargs=1, required=True,
4854
help="Provide the full path to your results directory, \
4955
plus the name you want to give your results\n",
@@ -66,9 +72,9 @@
6672
parser.add_argument("-d", dest="datatype", nargs=1, help="Declare the type of \
6773
data being used. Currentlly suported are 454 (454) and Illumina (solexa). \
6874
Default is 454.", required=False, metavar="454/solexa", default="454")
69-
parser.add_argument("-p", dest="paired", nargs="?", default=False, type=bool,
70-
help="Is the data paired end? True/False, default is \
71-
False.", required=False, metavar="True/False")
75+
# parser.add_argument("-p", dest="paired", nargs="?", default=False, type=bool,
76+
# help="Is the data paired end? True/False, default is \
77+
# False.", required=False, metavar="True/False")
7278
arg = parser.parse_args()
7379

7480

@@ -96,7 +102,7 @@ def StartUp():
96102
if arg.datatype == "solexa":
97103
if "1" in arg.run_list or "2" in arg.run_list:
98104
quit("Please skip steps 1 and 2 for illumina data. They are not required.")
99-
if arg.infile.endswith("fastq") is False or arg.infile.endswith("fasq.gz") is False:
105+
if arg.infile.endswith("fastq") is False or arg.infile.endswith("fastq.gz") is False:
100106
quit("Infile must be in 'fastq' format for illumina data.")
101107
if os.path.isfile(basefile + ".fastq"):
102108
if basefile + ".fastq" == input_file:
@@ -452,4 +458,5 @@ def RunMe(arguments):
452458

453459
basefile, sff, config = StartUp()
454460
miraproject = SysPrep(basefile)
461+
print(arg.infile)
455462
RunMe(arg.run_list)

0 commit comments

Comments
 (0)