Exemple #1
0
    def __init__(self, trigger_file, outdir):
        """

        :param trigger_file:
        """
        self._trigger_file = trigger_file
        self._outdir = outdir

        self._trigger_file_parser = tp(self._trigger_file)

        # Should be like Merck_ImmunoSELECT_Unmatched_Report_Template.xlsx
        self._template_file = self._trigger_file_parser.getTemplateFilePath()

        self._outfile = self._trigger_file_parser.getFinalReportPath(
        ) + self._trigger_file_parser.getFinalReportName() + '.xlsx'

        self._copy_number_file_parser = cnp(
            self._trigger_file_parser.getCopyNumberFile())
        self._summarysheet_file_parser = ssp(
            self._trigger_file_parser.getSummarysheetFile())
        self._combined_coverage_file_parser = ccp(
            self._trigger_file_parser.getCombinedCoverageFile())
def main(trigger_file, verbose, outdir):
    """

    TRIGGER_FILE: The input file to be processed.

    :return: None


    """
    assert isinstance(trigger_file, str)

    if not os.path.isfile(trigger_file):
        print("'%s' is not a file" % trigger_file)
        sys.exit(1)

    if verbose:
        print("The input file is %s" % trigger_file)

    if not outdir == './':
        pathlib.Path(outdir).mkdir(parents=True, exist_ok=True)
        if verbose:
            print("output directory '%s' was created" % outdir)

    trigger_file_parser = tp(trigger_file)

    report_type = trigger_file_parser.getReportType()

    repgen = None

    if report_type == 'Merck_ImmunoSELECT_Matched' or report_type == 'Merck ImmunoSELECT Matched':

        repgen = mimRepGen(trigger_file, outdir)

    elif report_type == 'Merck_ImmunoSELECT_Unmatched' or report_type == 'Merck ImmunoSELECT Unmatched':

        repgen = miumRepGen(trigger_file, outdir)

    elif report_type == 'Victor ImmunoSELECT Matched' or report_type == 'Victor_ImmunoSELECT_Matched':

        repgen = vimRepGen(trigger_file, outdir)

    elif report_type == 'Victor ImmunoSELECT Unmatched' or report_type == 'Victor_ImmunoSELECT_Unmatched':

        repgen = viumRepGen(trigger_file, outdir)

    elif report_type == 'ImmunoSELECT Matched' or report_type == 'ImmunoSELECT_Matched':

        repgen = imRepGen(trigger_file, outdir)

    elif report_type == 'ImmunoSELECT Unmatched' or report_type == 'ImmunoSELECT_Unmatched':

        repgen = iumRepGen(trigger_file, outdir)

    elif report_type == 'CancerXOME Matched' or report_type == 'CancerXOME_Matched':

        repgen = cxmRepGen(trigger_file, outdir)

    elif report_type == 'CancerXOME Unmatched' or report_type == 'CancerXOME_Unmatched':

        repgen = cxumRepGen(trigger_file, outdir)

    elif report_type == 'Victor CancerXOME Matched' or report_type == 'Victor_CancerXOME_Matched':

        repgen = vcxmRepGen(trigger_file, outdir)

    elif report_type == 'Victor CancerXOME Unmatched' or report_type == 'Victor_CancerXOME_Unmatched':

        repgen = vcxumRepGen(trigger_file, outdir)

    else:
        print("report type '%s' is not supported" % report_type)
        sys.exit(1)

    repgen.generateReport()