Example #1
0
        '2-uninfected',
        '3-mock',
        '4-mock',
        '5-low',
        '6-low',
        '7-high',
        '8-high',
    ]

    print('Get counts from single samples')
    data = []
    cells = []
    n_cells = 0
    for sn in samplenames:
        print(sn)
        fn = get_count_filenames(expname, sn, fmt='dataframe')
        df = read_dataframe(fn)
        n_cells += df.shape[1]
        n_genes = df.shape[0]
        genes = df.index
        cells.extend([sn + '_' + bc for bc in df.columns])
        data.append(df.values)
        print('{:}, n. genes: {:}, n. cells: {:}'.format(
            sn,
            df.shape[0],
            df.shape[1],
        ))

    print('Merge into a single matrix')
    counts = np.zeros((n_genes, n_cells), float)
    i = 0
Example #2
0
 def from_10X(cls, expname, samplename):
     from mCMV.filenames import get_count_filenames
     fdict = get_count_filenames(expname, samplename, fmt='10X')
     return cls.from_10X_filenames(fdict)