Skip to content

Commit

Permalink
option to provide a fake tuple counts file for analyze_gene_frequenci…
Browse files Browse the repository at this point in the history
…es.py
  • Loading branch information
phbradley committed Dec 6, 2019
1 parent 9c47343 commit 025902e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 6 additions & 1 deletion analyze_gene_frequencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#p.str('args').unspecified_default().multiple().required()
p.str('clones_file').required()
p.str('organism').required()
p.str('fake_tuple_counts_file')


summary_tsvfile = clones_file[:-4] + '_JS_divergence.tsv'
Expand Down Expand Up @@ -113,7 +114,11 @@ def get_jsd_normed( P, Q ):
## read the background gene-tuple counts
all_background_tuple_counts = {}

tuplecountsfile = path_to_current_db_files()+'/nextgen_tuple_counts_v2_{}_max10M.log'.format(organism)
if fake_tuple_counts_file:
tuplecountsfile = fake_tuple_counts_file
assert exists(fake_tuple_counts_file)
else:
tuplecountsfile = path_to_current_db_files()+'/nextgen_tuple_counts_v2_{}_max10M.log'.format(organism)

if exists( tuplecountsfile ):
Log('reading {}'.format( tuplecountsfile ))
Expand Down
1 change: 0 additions & 1 deletion make_10x_clones_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ def make_clones_file( organism, outfile, clonotype2tcrs, clonotype2barcodes ):
outmap = open(bc_mapfile,'w')
outmap.write('clone_id\tbarcodes\n')

out = open(tmpfile,'w')
outfields = 'clone_id subject clone_size va_gene ja_gene vb_gene jb_gene cdr3a cdr3a_nucseq cdr3b cdr3b_nucseq'\
.split()
extra_fields = 'alpha_umi beta_umi num_alphas num_betas'.split()
Expand Down

0 comments on commit 025902e

Please sign in to comment.