DavidsonGroup / flexiplex

The Flexible Demultiplexer
https://davidsongroup.github.io/flexiplex/
MIT License
23 stars 2 forks source link

Explicit NA for empty columns in output file #3

Closed ghar1821 closed 1 year ago

ghar1821 commented 1 year ago

Hi guys,

Is it possible to use explicit NaN value for any empty cells in the output file?

So have something like:

Read\tCellBarcode\tFlankEditDist\tBarcodeEditDist\tUMI
READ1\tACGGAAGGATGTCTGT\t0\t3\tNaN

Instead of:

Read\tCellBarcode\tFlankEditDist\tBarcodeEditDist\tUMI
READ1\tACGGAAGGATGTCTGT\t0\t3\t\t

When reading in the current result file, what happen is that, functions like read.table or fread in R, or read.csv in Python's pandas will treat the file as having 6 columns rather than 5 due to the extra \t at the end. I can somehow get around this with Python read.csv by specifying index_col=False, but otherwise, I will have to explicitly rename the table header, which is easily doable, but just inconvenient.

Or perhaps provide the option to export the result file as csv? I think most functions will treat ",," as empty cell.

Thanks!