colomemaria / epiScanpy

Episcanpy: Epigenomics Single Cell Analysis in Python
BSD 3-Clause "New" or "Revised" License
139 stars 33 forks source link

build_mtx_fly missing shutil import #55

Closed le-ander closed 4 years ago

le-ander commented 4 years ago

Hi Anna,

there seems to be a very small bug in build_mtx_fly():

I get:

loading the barcodes

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-6-1ca708327c27> in <module>
----> 1 epi.ct.bld_mtx_fly(paths['rawdir']+'fragments.tsv.gz', paths['rawdir']+'fragments.tsv.gz.tbi', paths['writedir']+'../../data_other/atac_geneid_features.bed')

~/.local/lib/python3.7/site-packages/episcanpy/count_matrix/_bld_atac_mtx.py in bld_mtx_fly(tsv_file, tbi_file, annotation, csv_file, genome, DATADIR, save)
    135         with gzip.open(tsv_file, 'rb') as f_in:
    136             with open(tsv_file.rstrip('.gz'), 'wb') as f_out:
--> 137                 shutil.copyfileobj(f_in, f_out)
    138         df = pd.read_csv(tsv_file.rstrip('.gz'), sep='\t', header=None)
    139         barcodes = list(sorted(set(df.loc[:,3].tolist())))

NameError: name 'shutil' is not defined

I guess there is just an import statement missing

DaneseAnna commented 4 years ago

Hi Leander,

Thank you for reporting the bug. I just fixed it.