Beispiel #1
0
def merge_metrics(hmmcopy_metrics, alignment_metrics, merged_output):
    csvutils.merge_csv(
        [hmmcopy_metrics, alignment_metrics],
        merged_output,
        'outer',
        ['cell_id'],
        write_header=False,
    )
Beispiel #2
0
    def test_merge_csv(self, tmpdir, n_rows):
        """
        test merge_csv
        """
        dtypes1 = {v: "int" for v in 'ABCD'}
        dtypes2 = {v: "int" for v in 'AEFGH'}
        how = "outer"
        on = ["A"]
        suffs = ["", ""]
        merged = os.path.join(tmpdir, "merged.csv.gz")

        dfs, csvs, ref = self.base_merge_test(n_rows, how, on, suffs,
                                              [dtypes1, dtypes2],
                                              write=True, dir=tmpdir)

        csvutils.merge_csv(csvs, merged, how=how, on=on)

        assert os.path.exists(merged)

        assert self.dfs_exact_match(ref, merged)
Beispiel #3
0
def merge_het_positions(input_csvs, output):
    csvutils.merge_csv(
        input_csvs, output, how="outer", on=[
            "chromosome", "position"], sep="\t")
Beispiel #4
0
def merge_all_metrics(infiles, outfile):
    csvutils.merge_csv(infiles, outfile, "outer", "cell_id")