Skip to content

Commit 0175ca6

Browse files
committed
Bugfix to CellRangerVDJ
1 parent b5e6e5c commit 0175ca6

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

tcrdb/src/org/labkey/tcrdb/pipeline/CellRangerVDJUtils.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,13 @@ else if (discordantBarcodes.contains(barcode))
369369
}
370370
knownBarcodes.add(barcode);
371371

372+
String chainType = extractField(line, headerToIdx.get(HEADER_FIELD.CHAIN_TYPE));
372373
String rawClonotypeId = extractField(line, headerToIdx.get(HEADER_FIELD.RAW_CLONOTYPE_ID));
374+
if (rawClonotypeId != null)
375+
{
376+
rawClonotypeId = chainType + "<>" + rawClonotypeId;
377+
}
378+
373379
if (rawClonotypeId == null && "TRUE".equalsIgnoreCase(line[headerToIdx.get(HEADER_FIELD.FULL_LENGTH)]))
374380
{
375381
fullLengthNoClonotype++;
@@ -383,7 +389,6 @@ else if (discordantBarcodes.contains(barcode))
383389
}
384390

385391
//Preferentially use raw_consensus_id, but fall back to contig_id
386-
String chainType = extractField(line, headerToIdx.get(HEADER_FIELD.CHAIN_TYPE));
387392
String coalescedContigName = extractField(line, headerToIdx.get(HEADER_FIELD.RAW_CONSENSUS_ID)) == null ? extractField(line, headerToIdx.get(HEADER_FIELD.CONTIG_ID)) : extractField(line, headerToIdx.get(HEADER_FIELD.RAW_CONSENSUS_ID));
388393
if (coalescedContigName != null)
389394
{
@@ -479,18 +484,22 @@ else if (discordantBarcodes.contains(barcode))
479484
try (FastaDataLoader loader = new FastaDataLoader(f, false))
480485
{
481486
loader.setCharacterFilter(new FastaLoader.UpperAndLowercaseCharacterFilter());
487+
int j = 0;
482488
try (CloseableIterator<Map<String, Object>> i = loader.iterator())
483489
{
484490
while (i.hasNext())
485491
{
486492
Map<String, Object> fastaRecord = i.next();
487493
String header = (String) fastaRecord.get("header");
494+
j++;
488495
if (uniqueContigNames.contains(header))
489496
{
490497
sequenceMap.put("vdj_t<>" + header, (String) fastaRecord.get("sequence"));
491498
}
492499
}
493500
}
501+
502+
_log.info("total FASTQ records: " + j);
494503
}
495504
catch (IOException e)
496505
{
@@ -506,18 +515,22 @@ else if (discordantBarcodes.contains(barcode))
506515
try (FastaDataLoader loader = new FastaDataLoader(f, false))
507516
{
508517
loader.setCharacterFilter(new FastaLoader.UpperAndLowercaseCharacterFilter());
518+
int j = 0;
509519
try (CloseableIterator<Map<String, Object>> i = loader.iterator())
510520
{
511521
while (i.hasNext())
512522
{
513523
Map<String, Object> fastaRecord = i.next();
514524
String header = (String) fastaRecord.get("header");
525+
j++;
515526
if (uniqueContigNames.contains(header))
516527
{
517528
sequenceMap.put("vdj_t_gd<>" + header, (String) fastaRecord.get("sequence"));
518529
}
519530
}
520531
}
532+
533+
_log.info("total FASTQ records: " + j);
521534
}
522535
catch (IOException e)
523536
{

0 commit comments

Comments
 (0)