milaboratory / mixcr

MiXCR is an ultimate software platform for analysis of Next-Generation Sequencing (NGS) data for immune profiling.
https://mixcr.com
Other
322 stars 78 forks source link

TotalReads count not set #1633

Closed Januaryyiyue closed 4 months ago

Januaryyiyue commented 4 months ago

Hello,

While running MiXCR4.1.2 I ran in an issue with 2 of my files where the .clns file was produced but the rest of the steps stop working. Here's the output

Assembling initial clonotypes: progress unknown
============== Assemble Report ==============
Analysis time: 2.1s
picocli.CommandLine$ExecutionException: Error while running command assemble java.lang.IllegalStateException: TotalReads count not set.
    at com.milaboratory.mixcr.cli.Main.mkCmd$lambda-21(Main.kt:323)
    at picocli.CommandLine.execute(CommandLine.java:2088)
    at com.milaboratory.mixcr.cli.Main.main(Main.kt:76)
Caused by: java.lang.IllegalStateException: TotalReads count not set.
    at com.milaboratory.mixcr.cli.CloneAssemblerReport.writeReport(CloneAssemblerReport.java:164)
    at com.milaboratory.util.ReportUtil.writeReportToStdout(ReportUtil.java:35)
    at com.milaboratory.mixcr.cli.CommandAssemble$Cmd.run0(CommandAssemble.kt:421)
    at com.milaboratory.mixcr.cli.MiXCRCommand.run(MiXCRCommand.kt:42)
    at com.milaboratory.mixcr.cli.MiXCRCommandWithOutputs.run(MiXCRCommandWithOutputs.kt:67)
    at picocli.CommandLine.executeUserObject(CommandLine.java:1939)
    at picocli.CommandLine.access$1300(CommandLine.java:145)
    at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2358)
    at picocli.CommandLine$RunLast.handle(CommandLine.java:2352)
    at picocli.CommandLine$RunLast.handle(CommandLine.java:2314)
    at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
    at picocli.CommandLine$RunLast.execute(CommandLine.java:2316)
    at picocli.CommandLine.execute(CommandLine.java:2078)
    ... 1 more

Thank you!

Januaryyiyue commented 4 months ago

To clarify, alignment worked but the LOG file for the assembly did not work

mizraelson commented 4 months ago

Hi, can you share the commands you used and the environment setting (server, SLURM, etc)?

Januaryyiyue commented 4 months ago

Sure! I used sbatch on a .sh script with -t 5-00:00:00 --mem=89G. The script is pasted below. I ran 26 samples; only 2 of them had this problem. The log align and .clns files were successfully generated, but the log assemble and clones files were absent. I am using capTCR-seq data.

#!/bin/bash
#
#$ -cwd
module load java/8
module load mixcr/4.1.2
java -jar /cluster/path/to/mixcr/4.1.2/mixcr.jar align -p rnaseq-cdr3 --verbose -s hsa -OallowPartialAlignments=true -OvParameters.geneFeatureToAlign=VGeneWithP -r /cluster/path/to/mixcr4/log/LOG_ALIGN_file.txt /cluster/path/to/data/file_R1.fastq /cluster/path/to/data/file_R2.fastq /cluster/path/to/mixcr4/alignments/alignments_file.vdjca
java -jar /cluster/path/to/mixcr/4.1.2/mixcr.jar assemblePartial /cluster/path/to/mixcr4/alignments/alignments_file.vdjca /cluster/path/to/mixcr4/assemble/rescue1_file.vdjca
java -jar /cluster/path/to/mixcr/4.1.2/mixcr.jar assemblePartial /cluster/path/to/mixcr4/assemble/rescue1_file.vdjca /cluster/path/to/mixcr4/assemble/rescue2_file.vdjca
java -jar /cluster/path/to/mixcr/4.1.2/mixcr.jar extend /cluster/path/to/mixcr4/assemble/rescue2_file.vdjca /cluster/path/to/mixcr4/assemble/extended_file.vdjca
java -jar /cluster/path/to/mixcr/4.1.2/mixcr.jar assemble -r /cluster/path/to/mixcr4/log/LOG_ASSEMBLE_file.txt /cluster/path/to/mixcr4/assemble/extended_file.vdjca /cluster/path/to/mixcr4/assemble/file.clns
java -jar /cluster/path/to/mixcr/4.1.2/mixcr.jar exportClones --chains TRA /cluster/path/to/mixcr4/assemble/file.clns /cluster/path/to/mixcr4/clones/CLONES_TRAfile.tsv
java -jar /cluster/path/to/mixcr/4.1.2/mixcr.jar exportClones --chains TRB /cluster/path/to/mixcr4/assemble/file.clns /cluster/path/to/mixcr4/clones/CLONES_TRBfile.tsv

Here's the result for the last few lines of the log align file:

Analysis time: 1128.7m
Total sequencing reads: 43390557
Successfully aligned reads: 38195684 (88.03%)
Chimeras: 5 (0%)
Paired-end alignment conflicts eliminated: 93125 (0.21%)
Alignment failed, no hits (not TCR/IG?): 1233379 (2.84%)
Alignment failed because of absence of CDR3 parts: 2129356 (4.91%)
Alignment failed because of low total score: 1832138 (4.22%)
Overlapped: 28612588 (65.94%)
Overlapped and aligned: 26198878 (60.38%)
Alignment-aided overlaps: 1127455 (4.3%)
Overlapped and not aligned: 2413710 (5.56%)
No CDR3 parts alignments, percent of successfully aligned: 44345 (0.12%)
Partial aligned reads, percent of successfully aligned: 21613444 (56.59%)
V gene chimeras: 12995 (0.03%)
J gene chimeras: 429656 (0.99%)
TRA chains: 14828702 (38.82%)
TRA non-functional: 5688903 (38.36%)
TRB chains: 4440587 (11.63%)
TRB non-functional: 570282 (12.84%)
TRD chains: 333584 (0.87%)
TRD non-functional: 59217 (17.75%)
TRG chains: 4814406 (12.6%)
TRG non-functional: 2683093 (55.73%)
TRAD chains: 13778400 (36.07%)
TRAD non-functional: 0 (0%)
Realigned with forced non-floating bound: 31810848 (73.31%)
Realigned with forced non-floating right bound in left read: 167045 (0.38%)
Realigned with forced non-floating left bound in right read: 167045 (0.38%)
mizraelson commented 4 months ago

Can you please run it with the latest MiXCR v4.6 and confirm the issue persists?

Januaryyiyue commented 4 months ago

Hi, we don't have MiXCR v4.6 on our cluster, and I don't have control over that, sorry about that..

Januaryyiyue commented 4 months ago

Could it be related to the input file size? For the ones that had this error the input file_R1.fastq.gz and file_R2.fastq.gz are both >3G each

mizraelson commented 4 months ago

It looks like an issue that has been fixed in a later version. Shouldn't have anything to do with the size.

mizraelson commented 4 months ago

I wanted to follow up and ask if you could share the problematic sample. That way, I can test whether the latest MiXCR version throws the error or not.

Januaryyiyue commented 4 months ago

Hi! Thank you for the follow up. I ran the analysis again with the exact same command, also with v4.1.2, and the error disappeared. This happens sometimes with the licensing error issue as well. Everything is good now, thank you!

mizraelson commented 4 months ago

Great!