Skip to content

Commit

Permalink
don't shift
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob Patro committed Jul 18, 2020
1 parent ec2966e commit bae6ac6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/SalmonAlevin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -691,8 +691,10 @@ void process_reads_sc_align(paired_parser* parser, ReadExperimentT& readExp, Rea
alevin::types::AlevinCellBarcodeKmer bck;
bool ok = bck.fromChars(*barcode);
if (ok) {
//alevinOpts.jointLog->info("BARCODE : {} \t ENC : {} ", *barcode, bck.word(0));
if (alevinOpts.protocol.barcodeLength <= 16) { // can use 32-bit int
uint32_t shortbck = static_cast<uint32_t>(((0xFFFFFFFF00000000 & bck.word(0)) >> 32));
uint32_t shortbck = static_cast<uint32_t>(0x00000000FFFFFFFF & bck.word(0));
//alevinOpts.jointLog->info("shortbck : {} ", shortbck);
bw << shortbck;
} else { // must use 64-bit int
bw << bck.word(0);
Expand All @@ -705,7 +707,7 @@ void process_reads_sc_align(paired_parser* parser, ReadExperimentT& readExp, Rea
// umi
if ( alevinOpts.protocol.barcodeLength <= 16 ) { // if we can use 32-bit int
uint64_t umiint = jointHitGroup.umi();
uint32_t shortumi = static_cast<uint32_t>(((0xFFFFFFFF00000000 & umiint) >> 32));
uint32_t shortumi = static_cast<uint32_t>(0x00000000FFFFFFFF & umiint);
bw << shortumi;
} else if ( alevinOpts.protocol.barcodeLength <= 32 ) { // if we can use 64-bit int
uint64_t umiint = jointHitGroup.umi();
Expand Down

0 comments on commit bae6ac6

Please sign in to comment.