Skip to content

Commit

Permalink
os cwd
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Kofman committed Nov 21, 2024
1 parent 74e4734 commit ac3a8d9
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions tests/integration_tests_auto_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,14 +290,21 @@
print("\n\t ~~~ {} FAILED! ~~~\n".format(test_name))
failures += 1

import os
from glob import glob

tests_dir = sys.argv[1]
print('tests dir is {}'.format(tests_dir))
# Single-cell vs bulk processing check for same single-cell dataset
sc_folder = 'only_5_cells_test'
bulk_folder = 'only_5_cells_bulk_mode_test'
sc_5_cells = pd.read_csv('{}/singlecell_tests/{}/final_filtered_site_info.tsv'.format(tests_dir, sc_folder), sep='\t').sort_values(['position', 'strand_conversion'])
bulk_5_cells = pd.read_csv('{}/singlecell_tests/{}/final_filtered_site_info.tsv'.format(tests_dir, bulk_folder), sep='\t').sort_values(['position', 'strand_conversion'])
sc_5_cells_path = "singlecell_tests/only_5_cells_test/final_filtered_site_info.tsv"
bulk_5_cells_path = "singlecell_tests/only_5_cells_bulk_mode_test/final_filtered_site_info.tsv"

print("Current directory: {}".format(os.getcwd()))
print("\tMatching files: {}".format(glob('singlecell_tests/only_5*/*final_filtered_site_info.tsv')))

sc_5_cells = pd.read_csv(sc_5_cells_path, sep='\t').sort_values(['position', 'strand_conversion'])
bulk_5_cells = pd.read_csv(bulk_5_cells_path, sep='\t').sort_values(['position', 'strand_conversion'])

print("Checking that analyzing a single-cell dataset in 'bulk' mode (i.e. not specificying the 'CB' barcode) yields the exact same positions and base changes, but with counts and coverages aggregated rather than at a single-cell resolution")
grouped_sc = pd.DataFrame(sc_5_cells.groupby(['contig', 'position', 'strand_conversion']).agg({'count': sum, 'strand_conversion': 'unique'}))
grouped_sc.index.names = ['contig', 'position', 'c']
Expand Down

0 comments on commit ac3a8d9

Please sign in to comment.