Skip to content

Commit

Permalink
Update format the output fastq read id: @{Cell barcode}_{UMI}#{read_i…
Browse files Browse the repository at this point in the history
…d}_{strand}\tCB:Z:{Cell barcode}\tUB:Z:{UMI}

The UMI and BC were repeated for backwards support
  • Loading branch information
youyupei committed Sep 29, 2024
1 parent be32668 commit b030bfc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions blaze/read_assignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def batch_barcode_to_fastq(r_batches_with_idx, assignment_df ,gz = True):
seq = r.seq[int(row.polyT_end):]
qscore = r.qscore[int(row.polyT_end):]

out_buffer += f"@{row.BC_corrected}_{row.putative_umi}#{row.read_id}_{row.strand}\n"
out_buffer += f"@{row.BC_corrected}_{row.putative_umi}#{row.read_id}_{row.strand}\tCB:Z:{row.BC_corrected}\tUB:Z:{row.putative_umi}\n"
out_buffer += str(seq) + '\n'
out_buffer += '+\n'
out_buffer += qscore + '\n'
Expand Down Expand Up @@ -231,7 +231,7 @@ def _assign_read_batches(r_batch, whitelist, max_ed, gz, minQ=0):
seq = r.seq[int(bc.polyT_end):]
qscore = r.qscore[int(bc.polyT_end):]

out_buffer += f"@{bc.BC_corrected}_{bc.putative_umi}#{bc.read_id}_{bc.strand}\n"
out_buffer += f"@{bc.BC_corrected}_{bc.putative_umi}#{bc.read_id}_{bc.strand}\tCB:Z:{bc.BC_corrected}\tUB:Z:{bc.putative_umi}\n"
out_buffer += str(seq) + '\n'
out_buffer += '+\n'
out_buffer += qscore + '\n'
Expand Down
6 changes: 4 additions & 2 deletions test/run_test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# run the following command to test the above commands
mkdir test_out
pip install ../.
# create test_out directory, delete it if it already exists
rm -rf test_out
blaze --expect-cells=500 --threads=12 --output-prefix test_out/test_ data/
blaze --expect-cells=1 --threads=12 --kit-version 5v3 --output-prefix test_out/test_5prim 5prim_test.fastq.gz
#blaze --expect-cells=1 --threads=12 --kit-version 5v3 --output-prefix test_out/test_5prim 5prim_test.fastq.gz

0 comments on commit b030bfc

Please sign in to comment.