Skip to content

Commit

Permalink
Remove requirement for Pandas 1.1.4
Browse files Browse the repository at this point in the history
Fix usage of to_csv() with a binary stream. Luigi does not provide a text
stream that Pandas expect.
  • Loading branch information
arteymix committed May 5, 2022
1 parent 8de5506 commit f3267e0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions rnaseq_pipeline/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,12 +346,13 @@ def run(self):
# FIXME: find a better way to obtain the sample identifier
# Each DownloadSample-like tasks have a sample_id property! Use that!
keys = [os.path.basename(f.path).replace(f'.{self.scope}.results', '') for f in self.input()]
counts_df = pd.concat([pd.read_csv(f.path, sep='\t', index_col=0).expected_count for f in self.input()], keys=keys, axis=1)
fpkm_df = pd.concat([pd.read_csv(f.path, sep='\t', index_col=0).FPKM for f in self.input()], keys=keys, axis=1)

counts_buffer = pd.concat([pd.read_csv(f.path, sep='\t', index_col=0).expected_count for f in self.input()], keys=keys, axis=1).to_csv(sep='\t')
fpkm_buffer = pd.concat([pd.read_csv(f.path, sep='\t', index_col=0).FPKM for f in self.input()], keys=keys, axis=1).to_csv(sep='\t')

with self.output()[0].open('w') as counts_out, self.output()[1].open('w') as fpkm_out:
counts_df.to_csv(counts_out, sep='\t')
fpkm_df.to_csv(fpkm_out, sep='\t')
counts_out.write(counts_buffer)
fpkm_out.write(fpkm_buffer)

def output(self):
destdir = join(cfg.OUTPUT_DIR, cfg.QUANTDIR, self.reference_id)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
author_email='[email protected]',
classifiers=['License :: Public Domain'],
packages=find_packages(),
install_requires=['luigi', 'bioluigi', 'requests', 'pandas==1.1.4'],
install_requires=['luigi', 'bioluigi', 'requests', 'pandas'],
extras_require={
'gsheet': ['google-api-python-client', 'google-auth-httplib2', 'google-auth-oauthlib', 'pyxdg'],
'webviewer': ['Flask']},
Expand Down

0 comments on commit f3267e0

Please sign in to comment.