This method parses a line containing a lib_seq string and adds it to
        the lib_seq key in the self.params dictionary

def libseq_parse(self, line):
        """This method parses a line containing a lib_seq string and adds it to
        the lib_seq key in the self.params dictionary"""
        count = line.count(',')
        if count > 1:
            raise ValueError("""ERROR: There are too many commas in your
            lib_seq line. There should only be one, between the two filepath
            globs.""")
        if count == 0:
            raise ValueError("""ERROR: There are no commas in your
            lib_seq line. There should be one, between the two filepath
            globs.""")
        line = [x.strip() for x in line.split() if x]
        #print(line)

        #This block tries to fix user input if there is an inappropriate
        # number of commas or spaces associated with commas
        if len(line) > 13:
            commas = [x for x in line if "," in x]
            if commas:
                #this handles the case if there was an extra space added on
                # both sides of the comma
                if (len(commas) == 1) and (commas[0] != ','):
                    if (commas[0][-1] == ',') or (commas[0][0] == ','):
                        line = [line[0]] + ["".join(line[1:3])] + line[3:]
                #This handles the case where there is an extra space on either
                #side of the comma
                elif line[2] == ',':
                    line = [line[0]] + ["".join(line[1:4])] + line[4::]

        #make sure there is an appropriate numer of elements in list
        if (len(line) ) != 13:
            raise ValueError("""ERROR: There are {0} values in the lib_seq line when
                             there should be 12. Check your input meraculous
                             config file for errors and make sure that it matches
                             the specification for the Meraculous manual.""".format(
                                 len(line)))

        for index in self.indices:
            if index == 1:
                globs = [os.path.abspath(x.strip()) for x in line[1].split(',') if x]
                #make sure there are only two filepaths to search for globs
                if len(globs) != 2:
                    raise ValueError("""ERROR: remember to split your glob
                    filepaths in lib_seq with a comma. This error occured because
                    the program was looking for two glob filepaths, but instead
                    found {}: {}""".format(len(globs), globs))
                self.data["globs"] = globs
                #Note that glob.glob returns an empty list if the file or glob
                # filepath does not exist.
                forwards = glob.glob(os.path.abspath(globs[0]))
                reverses = glob.glob(os.path.abspath(globs[1]))
                # print(os.path.abspath(globs[0]))
                # print("globs: ", globs)
                # print("forwards: ", forwards)
                # print("reverses: ", reverses)
                #At this point the
                if (len(forwards) < 1) or (len(reverses) < 1):
                    # print("forwards: ", forwards)
                    # print("reverses: ", reverses)

                    report = []
                    if len(forwards) < 1:
                        report.append(globs[0])
                    if len(reverses) < 1:
                        report.append(globs[1])
                    raise ValueError("""ERROR: no read files were found for the glob strings,
                    {}.

                    Please check the glob string and/or use absolute
                    file paths. A common source of this error is using
                    relative filepaths from the incorrect directory, or
                    referring to files that do not exist.""".format(report))
                if len(forwards) != len(reverses):
                    raise ValueError("""ERROR: the number of reverse read files does not
                    match the number of forward read files""")
                #zip the pairs together into tuples, not lists
                self.data["pairs"] = [x for x in zip(sorted(forwards), sorted(reverses))]

            self.data[self.indices.get(index)] = line[index]