Closed vincentwalter closed 2 months ago
Hi, thank you for reporting this! Can you please try the latest develop version and compare the outputs. We have identified and fixed one bug that have potentially caused the issue. Let me know if it helped!
It's better but not completely solved.
I reran with the release (c9fafa41fe
) and the develop version (b0900b576f
):
vwalter@work:~/projects/playground$ R1=path/to/R1.fastq.gz
vwalter@work:~/projects/playground$ R2=path/to/R2.fastq.gz
vwalter@work:~/projects/playground$ OUT=path/to/output
vwalter@work:~/projects/playground$ samtools import -i -1 $R1 -2 $R2 --order ro -O bam,level=0 | \
samtools sort -@10 -M -o "${OUT}.bam" -
vwalter@work:~/projects/playground$ mixcr analyze cellecta-human-rna-xcr-umi-drivermap-air -Xmx100g $R1 $R2 "${OUT}_fastq_c9fafa41fe"
vwalter@work:~/projects/playground$ ./mixcr analyze cellecta-human-rna-xcr-umi-drivermap-air -Xmx100g $R1 $R2 "${OUT}_fastq_b0900b576f"
vwalter@work:~/projects/playground$ mixcr analyze cellecta-human-rna-xcr-umi-drivermap-air -Xmx100g "${OUT}.bam" "${OUT}_bam_c9fafa41fe"
vwalter@work:~/projects/playground$ ./mixcr analyze cellecta-human-rna-xcr-umi-drivermap-air -Xmx100g "${OUT}.bam" "${OUT}_bam_b0900b576f"
The differences get smaller:
vwalter@work:~/projects/playground$ ./mixcr clonesDiff -c "${OUT}_fastq_c9fafa41fe.clns" "${OUT}_bam_c9fafa41fe.clns"
Unique clones in cloneset 1: 439 (0.19%)
Reads in unique clones in cloneset 1: 2584 (0.05%)
Unique clones in cloneset 2: 131 (0.06%)
Reads in unique clones in cloneset 2: 1025 (0.02%)
vwalter@work:~/projects/playground$ ./mixcr clonesDiff -c "${OUT}_fastq_b0900b576f.clns" "${OUT}_bam_b0900b576f.clns"
Unique clones in cloneset 1: 155 (0.07%)
Reads in unique clones in cloneset 1: 962 (0.02%)
Unique clones in cloneset 2: 111 (0.05%)
Reads in unique clones in cloneset 2: 721 (0.01%)
However, is it expected, that the clns files differ this drastically between versions ?
vwalter@work:~/projects/playground$ ./mixcr clonesDiff -c "${OUT}_fastq_c9fafa41fe.clns" "${OUT}_fastq_b0900b576f.clns"
Unique clones in cloneset 1: 226519 (99.98%)
Reads in unique clones in cloneset 1: 4817261 (99.99%)
Unique clones in cloneset 2: 226488 (99.98%)
Reads in unique clones in cloneset 2: 4817734 (99.99%)
vwalter@work:~/projects/playground$ ./mixcr clonesDiff -c "${OUT}_bam_c9fafa41fe.clns" "${OUT}_bam_b0900b576f.clns"
Unique clones in cloneset 1: 226222 (99.99%)
Reads in unique clones in cloneset 1: 4798599 (99.99%)
Unique clones in cloneset 2: 226455 (99.99%)
Reads in unique clones in cloneset 2: 4817078 (99.99%)
Hi,
If you could share the input files, I can investigate further. Generally, for reads that have low similarity to the reference, the randomized part of the alignment algorithm can play a bigger role. There is a seed that is calculated from the ID and the header of every read; this seed will differ in BAM and FASTQ formats. For reads that align well with the reference, this does not affect the outcome.
Regarding the difference between the two versions, some algorithms have improved, and the output results can slightly differ and be more reliable. From the numbers you have shared, the difference is less than 0.5%.
I sent a link to the files to support@milaboratories.com.
About the difference in clonesets between the two versions. Where do you get the less than 0.5%?
The output says Unique clones in cloneset 1: 226222 (99.99%)
so I was under the impression that almost no overlap exists between the clonesets generated with the different versions.
Hi, thank you for sharing the data. We have identified the reason for the remaining difference between BAM and FASTQ. It is due to the way nucleotide wildcards are resolved. This algorithm requires randomization which comes from different seeds in bam and fastq files. We will fix this issue in the upcoming release but it only affects a very small fraction of reads.
As for the difference between the versions, the clonesDiff
function relies on full sets of gene hits. For example:
1) IGHD2-2*00(40),IGHD3-22*00(36),IGHD4-11*00(35)
2) IGHD2-2*00(40),IGHD3-22*00(36),IGHD1-26*00(35)
The clones above will be considered different because of the last D gene hit. But if you compare the samples using the best hit for every gene (IGHD2-2*00
in the example above), all clones will be identical.
Thank you for looking into it!
Expected Result
Starting an analysis from FASTQ files and a BAM file generated from these FASTQ files should produce the same result.
Actual Result
A small fraction of reads is displayed to be unique to either the FASTQ or BAM input.
Exact MiXCR commands
Software Versions