Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RUST error when phasing with SV VCF file #7

Closed
Audald opened this issue May 11, 2023 · 7 comments
Closed

RUST error when phasing with SV VCF file #7

Audald opened this issue May 11, 2023 · 7 comments
Labels
question Further information is requested wontfix This will not be worked on

Comments

@Audald
Copy link

Audald commented May 11, 2023

I am facing a RUST problem when providing HiPhase with a Structural Variants (SV) VCF file to improve the phasing. Phasing works fine when only a Single Nucleotide Variants (SNV) VCF file is provided. This is the command I am using:

/path/hiphase-v0.8.0-x86_64-unknown-linux-gnu/hiphase -t 16 -r /path/ref.fa -b /path/sample.bam -p sample.haplotagged.bam -c /path/SNV.vcf.gz -o sample.SNV.phased.vcf.gz -c /path/SV.vcf.gz -o sample.SV.phased.vcf.gz -s sample

And this is the error:

thread '<unnamed>' panicked at 'assertion failed: `(left == right)`
  left: `[78]`,
 right: `[71]`', src/phaser.rs:222:25
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[2023-05-11T09:18:04.236Z ERROR hiphase] Panic detected in ThreadPool, check above for details.

The SV VCF file has been generated with [Sniffles2](https://github.com/fritzsedlazeck/Sniffles). We thought it might be related to Breakends (BND) variants but the error also appears when these are filtered out.

Thanks in advance for looking into this :)

@holtjma
Copy link
Collaborator

holtjma commented May 11, 2023

Hello,

Before touching on the error, I do want to mention that we're only officially supporting pbsv and DeepVariant for variant callers at this time (largely because of weird errors like this one).

As for the error itself, it appears to be failing a sanity check we have built into the tool. In particular, this sanity check compares the reference allele in the VCF (left: [78] here, which translates to "N") to the actual base in the reference genome (right: [71] here, which translates to "G"). I'm not too familiar with the sniffles output, but I would guess that it is not putting the reference allele into the VCF file and instead just placing an "N" placeholder sequence there as a short-cut (seems to be related to this sniffles issue: fritzsedlazeck/Sniffles#396). Assuming that behavior is correct, a workaround would be to fix the VCF file and replace these "N" sequences with the actual reference base.

Matt

@holtjma
Copy link
Collaborator

holtjma commented May 24, 2023

I'm going to close this for now, feel free to re-open if something changes with respect to the issue.

@hangsuUNC
Copy link

Hi Matt,

I saw a similar error when running the hiphase with a joint pbsv, pav and sniffles call. Here is the error:

thread '' panicked at 'assertion failed: (left == right)
left: [116, 99, 116, 99, 97, 103, 99, 97, 103, 99, 116, 99, 97, 99, 103, 103, 116, 103, 116, 103, 103, 97, 97, 97, 99, 116, 103, 99, 103, 97, 99, 97, 99, 116, 99, 97, 99, 97, 99, 103, 103, 103, 116, 103, 99, 99, 97, 116, 99, 116, 99, 97, 103, 99, 97, 103, 99, 116, 99, 97, 99, 103, 103, 116, 103, 116, 103, 103, 97, 97, 97, 99, 116, 103, 99, 103, 97, 99, 97, 99, 116, 99, 97, 99, 97, 99, 103, 103, 103, 116, 103, 99, 99, 97, 116, 99, 116, 99, 97, 103, 99, 97, 103, 99, 116, 99, 97, 99, 103, 103, 116, 103, 116, 103, 103, 97, 97, 97, 99, 116, 103, 99, 103, 97, 99, 97, 99, 116, 99, 97, 99, 97, 99, 103, 103, 103, 116, 103, 99, 99, 97, 116, 99, 116, 99, 97, 103, 99, 97, 103, 99, 116, 99, 97, 99, 103, 103, 116, 103, 116, 103, 103, 97, 97, 97, 99, 116, 103, 99, 103, 97, 99, 97, 99, 116, 99, 97, 99, 97, 116, 103, 103, 103, 116, 103, 99, 99, 97, 116, 99, 116, 99, 97, 103, 99, 97, 103, 99, 116, 99, 97, 99, 103, 103, 116, 103, 116, 103, 103, 97, 97, 97, 99, 116, 103, 99, 103, 97, 99, 97, 99, 116, 99, 97, 99, 103, 99, 103, 103, 103, 116, 103, 99, 99, 97, 116, 99, 116, 99, 97, 103, 99, 97, 103, 99, 116, 99, 97, 99, 103, 103, 116, 103, 116, 97, 103, 97, 97, 97, 99, 116, 103, 99, 103, 97, 99, 97, 99, 116, 99, 97, 99, 97, 116, 103, 103, 103, 116, 103, 99, 99, 97, 116, 99, 116, 99, 97, 103, 99, 97, 103, 99, 116, 99, 97, 99, 103, 103, 116, 103, 116, 103, 103, 97, 97, 97, 99, 116, 103, 99, 103, 97, 99, 97, 99, 116, 99, 97, 99, 97, 116, 103, 103, 103, 116, 103, 99, 99, 97, 116, 99, 116, 99, 97, 103, 99, 97, 103, 99, 116, 99, 97, 99, 103, 103, 116, 103, 116, 103, 103, 97, 97, 97, 99, 116, 103, 99, 103, 97, 99, 97, 99, 116, 99, 97, 99, 103, 99, 103, 103, 103, 116, 103, 99, 99, 103, 116, 99, 116, 99, 97, 103, 99, 97, 103, 99, 116, 99, 97, 99, 103, 103, 116, 103, 116, 103, 103, 97, 97, 97, 99, 116, 103, 99, 103, 97, 99, 97, 99, 116, 99, 97, 99, 103, 116, 103, 103, 103, 116, 103, 99, 99, 97, 116, 99, 116, 99, 97, 103, 99, 97, 103, 99, 116, 99, 97, 99, 103, 103, 116, 103, 116, 103, 103, 97, 97, 97, 99, 116, 103, 99, 103, 97, 99, 97, 99, 116, 99, 97, 99, 103, 116, 103, 71, 71, 84, 71, 67, 67, 65, 84, 67, 84, 99, 103, 103, 99, 97, 103, 99, 116, 99, 97, 99, 103, 103, 116, 103, 116, 103, 103, 97, 97, 97, 99, 116, 103, 99, 103, 97, 99, 97, 99, 116, 99, 97, 99, 97, 99, 71, 71, 71, 84, 71, 67, 67, 65, 84, 67, 84, 99, 103, 103, 99, 97, 103, 99, 116, 99, 97, 99, 103, 103, 116, 103, 116, 103, 103, 97, 97, 97, 99, 116, 103, 99, 103, 97, 99, 97, 99, 116, 99, 97, 99, 97, 99, 103, 103, 103, 116, 103, 99, 99, 97, 116, 99, 116, 99, 97, 103, 99, 97, 103, 99, 116, 99, 97, 99, 103, 103, 116, 103, 116, 97, 103, 97, 97, 97, 99, 116, 103, 99, 103, 97, 99, 97, 99, 116, 99, 97, 99, 103, 116, 103, 103, 103, 116, 103, 99, 99, 97, 116, 99, 116, 99, 97, 103, 99, 97, 103, 99, 116, 99, 97, 99, 103, 103, 116, 103, 116, 103, 103, 97, 97, 97, 99, 116, 103, 99, 103, 97, 99, 97, 99, 116, 99, 97, 99, 103, 116, 103, 103, 103, 116, 103, 99, 99, 97, 116, 99, 116, 99, 97, 103, 99, 97, 103, 99, 116, 99, 97, 99, 103, 103, 116, 103, 116, 103, 103, 97, 97, 97, 99, 116, 103, 99, 103, 97, 99, 97, 99, 116, 99, 97, 99, 103, 116, 103, 71, 71, 84, 71, 67, 67, 65, 84, 67, 84, 99, 103, 103, 99, 97, 103, 99, 116, 99, 97, 99, 103, 103, 116, 103, 116, 103, 103, 97, 97, 97, 99, 116, 103, 99, 103, 97, 99, 97, 99, 116, 99, 97, 99, 97, 99, 103, 103, 103, 116, 103, 99, 99, 97, 116, 99, 116, 99, 97, 103, 99, 97, 103, 99, 116, 99, 97, 99, 103, 103, 116, 103, 116, 97, 103, 97, 97, 97, 99, 116, 103, 99, 103, 97, 99, 97, 99, 116, 99, 97, 99, 97, 99, 103, 103, 103, 116, 103, 99, 99, 97, 116, 99, 116, 99, 97, 103, 99, 97, 103, 99, 116, 99, 97, 99, 103, 103, 116, 103, 116, 103, 103, 97, 97, 97, 99, 116, 103, 99, 103, 97, 99, 97, 99, 116, 99, 97, 99, 97, 99, 103, 103, 103, 116, 103, 99, 99, 97, 116, 99, 116, 99, 97, 103, 99, 97, 103, 99, 116, 99, 97, 99, 103, 103, 116, 103, 116, 103, 103, 97, 97, 97, 99, 116, 103, 99, 103, 97, 99, 97, 99, 116, 99, 97, 99, 97, 99, 103, 103, 103, 116, 103, 99, 99, 97, 116, 99, 116, 99, 97, 103, 99, 97, 103, 99, 116, 99, 97, 99, 103, 103, 116, 103, 116, 103, 103, 97, 97, 97, 99, 116, 103, 99, 103, 97, 99, 97, 99, 116, 99, 97, 99, 97, 99, 103, 103, 103, 116, 103, 99, 99, 103, 116, 99, 116, 99, 97, 103, 99, 97, 103, 99, 116, 99, 97, 99, 103, 103, 116, 103, 116, 103, 103, 97, 97, 97, 99, 116, 103, 99, 103, 97, 99, 97, 99, 116, 99, 97, 99, 103, 99, 103, 103, 103, 116, 103, 99, 99, 97, 116, 99, 116, 99, 97, 103, 99, 97, 103, 99, 116, 99, 97, 99, 103, 103, 116, 103, 116, 103, 103, 97, 97, 97, 99, 116, 103, 99, 103, 97, 99, 97, 99, 116, 99, 97, 99, 97, 99, 103, 103, 103, 116, 103, 99, 99, 97, 116, 99, 116, 99, 97, 103, 99, 97, 103, 99, 116, 99, 97, 99, 103, 103, 116, 103, 116, 103, 103, 97, 97, 97, 99, 116, 103, 99, 103, 97, 99, 97, 99, 116, 99, 97, 99, 103, 99, 103, 103, 103, 116, 103, 99, 99, 103, 116],
right: [84, 67, 84, 67, 65, 71, 67, 65, 71, 67, 84, 67, 65, 67, 71, 71, 84, 71, 84, 71, 71, 65, 65, 65, 67, 84, 71, 67, 71, 65, 67, 65, 67, 84, 67, 65, 67, 65, 67, 71, 71, 71, 84, 71, 67, 67, 65, 84, 67, 84, 67, 65, 71, 67, 65, 71, 67, 84, 67, 65, 67, 71, 71, 84, 71, 84, 71, 71, 65, 65, 65, 67, 84, 71, 67, 71, 65, 67, 65, 67, 84, 67, 65, 67, 65, 67, 71, 71, 71, 84, 71, 67, 67, 65, 84, 67, 84, 67, 65, 71, 67, 65, 71, 67, 84, 67, 65, 67, 71, 71, 84, 71, 84, 71, 71, 65, 65, 65, 67, 84, 71, 67, 71, 65, 67, 65, 67, 84, 67, 65, 67, 65, 67, 71, 71, 71, 84, 71, 67, 67, 65, 84, 67, 84, 67, 65, 71, 67, 65, 71, 67, 84, 67, 65, 67, 71, 71, 84, 71, 84, 71, 71, 65, 65, 65, 67, 84, 71, 67, 71, 65, 67, 65, 67, 84, 67, 65, 67, 65, 84, 71, 71, 71, 84, 71, 67, 67, 65, 84, 67, 84, 67, 65, 71, 67, 65, 71, 67, 84, 67, 65, 67, 71, 71, 84, 71, 84, 71, 71, 65, 65, 65, 67, 84, 71, 67, 71, 65, 67, 65, 67, 84, 67, 65, 67, 71, 67, 71, 71, 71, 84, 71, 67, 67, 65, 84, 67, 84, 67, 65, 71, 67, 65, 71, 67, 84, 67, 65, 67, 71, 71, 84, 71, 84, 65, 71, 65, 65, 65, 67, 84, 71, 67, 71, 65, 67, 65, 67, 84, 67, 65, 67, 65, 84, 71, 71, 71, 84, 71, 67, 67, 65, 84, 67, 84, 67, 65, 71, 67, 65, 71, 67, 84, 67, 65, 67, 71, 71, 84, 71, 84, 71, 71, 65, 65, 65, 67, 84, 71, 67, 71, 65, 67, 65, 67, 84, 67, 65, 67, 65, 84, 71, 71, 71, 84, 71, 67, 67, 65, 84, 67, 84, 67, 65, 71, 67, 65, 71, 67, 84, 67, 65, 67, 71, 71, 84, 71, 84, 71, 71, 65, 65, 65, 67, 84, 71, 67, 71, 65, 67, 65, 67, 84, 67, 65, 67, 71, 67, 71, 71, 71, 84, 71, 67, 67, 71, 84, 67, 84, 67, 65, 71, 67, 65, 71, 67, 84, 67, 65, 67, 71, 71, 84, 71, 84, 71, 71, 65, 65, 65, 67, 84, 71, 67, 71, 65, 67, 65, 67, 84, 67, 65, 67, 71, 84, 71, 71, 71, 84, 71, 67, 67, 65, 84, 67, 84, 67, 65, 71, 67, 65, 71, 67, 84, 67, 65, 67, 71, 71, 84, 71, 84, 71, 71, 65, 65, 65, 67, 84, 71, 67, 71, 65, 67, 65, 67, 84, 67, 65, 67, 71, 84, 71, 71, 71, 84, 71, 67, 67, 65, 84, 67, 84, 67, 71, 71, 67, 65, 71, 67, 84, 67, 65, 67, 71, 71, 84, 71, 84, 71, 71, 65, 65, 65, 67, 84, 71, 67, 71, 65, 67, 65, 67, 84, 67, 65, 67, 65, 67, 71, 71, 71, 84, 71, 67, 67, 65, 84, 67, 84, 67, 71, 71, 67, 65, 71, 67, 84, 67, 65, 67, 71, 71, 84, 71, 84, 71, 71, 65, 65, 65, 67, 84, 71, 67, 71, 65, 67, 65, 67, 84, 67, 65, 67, 65, 67, 71, 71, 71, 84, 71, 67, 67, 65, 84, 67, 84, 67, 65, 71, 67, 65, 71, 67, 84, 67, 65, 67, 71, 71, 84, 71, 84, 65, 71, 65, 65, 65, 67, 84, 71, 67, 71, 65, 67, 65, 67, 84, 67, 65, 67, 71, 84, 71, 71, 71, 84, 71, 67, 67, 65, 84, 67, 84, 67, 65, 71, 67, 65, 71, 67, 84, 67, 65, 67, 71, 71, 84, 71, 84, 71, 71, 65, 65, 65, 67, 84, 71, 67, 71, 65, 67, 65, 67, 84, 67, 65, 67, 71, 84, 71, 71, 71, 84, 71, 67, 67, 65, 84, 67, 84, 67, 65, 71, 67, 65, 71, 67, 84, 67, 65, 67, 71, 71, 84, 71, 84, 71, 71, 65, 65, 65, 67, 84, 71, 67, 71, 65, 67, 65, 67, 84, 67, 65, 67, 71, 84, 71, 71, 71, 84, 71, 67, 67, 65, 84, 67, 84, 67, 71, 71, 67, 65, 71, 67, 84, 67, 65, 67, 71, 71, 84, 71, 84, 71, 71, 65, 65, 65, 67, 84, 71, 67, 71, 65, 67, 65, 67, 84, 67, 65, 67, 65, 67, 71, 71, 71, 84, 71, 67, 67, 65, 84, 67, 84, 67, 65, 71, 67, 65, 71, 67, 84, 67, 65, 67, 71, 71, 84, 71, 84, 65, 71, 65, 65, 65, 67, 84, 71, 67, 71, 65, 67, 65, 67, 84, 67, 65, 67, 65, 67, 71, 71, 71, 84, 71, 67, 67, 65, 84, 67, 84, 67, 65, 71, 67, 65, 71, 67, 84, 67, 65, 67, 71, 71, 84, 71, 84, 71, 71, 65, 65, 65, 67, 84, 71, 67, 71, 65, 67, 65, 67, 84, 67, 65, 67, 65, 67, 71, 71, 71, 84, 71, 67, 67, 65, 84, 67, 84, 67, 65, 71, 67, 65, 71, 67, 84, 67, 65, 67, 71, 71, 84, 71, 84, 71, 71, 65, 65, 65, 67, 84, 71, 67, 71, 65, 67, 65, 67, 84, 67, 65, 67, 65, 67, 71, 71, 71, 84, 71, 67, 67, 65, 84, 67, 84, 67, 65, 71, 67, 65, 71, 67, 84, 67, 65, 67, 71, 71, 84, 71, 84, 71, 71, 65, 65, 65, 67, 84, 71, 67, 71, 65, 67, 65, 67, 84, 67, 65, 67, 65, 67, 71, 71, 71, 84, 71, 67, 67, 71, 84, 67, 84, 67, 65, 71, 67, 65, 71, 67, 84, 67, 65, 67, 71, 71, 84, 71, 84, 71, 71, 65, 65, 65, 67, 84, 71, 67, 71, 65, 67, 65, 67, 84, 67, 65, 67, 71, 67, 71, 71, 71, 84, 71, 67, 67, 65, 84, 67, 84, 67, 65, 71, 67, 65, 71, 67, 84, 67, 65, 67, 71, 71, 84, 71, 84, 71, 71, 65, 65, 65, 67, 84, 71, 67, 71, 65, 67, 65, 67, 84, 67, 65, 67, 65, 67, 71, 71, 71, 84, 71, 67, 67, 65, 84, 67, 84, 67, 65, 71, 67, 65, 71, 67, 84, 67, 65, 67, 71, 71, 84, 71, 84, 71, 71, 65, 65, 65, 67, 84, 71, 67, 71, 65, 67, 65, 67, 84, 67, 65, 67, 71, 67, 71, 71, 71, 84, 71, 67, 67, 71, 84]', src/phaser.rs:222:25
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
[2024-01-26T21:28:34.715Z ERROR hiphase] Panic detected in ThreadPool, check above for details.

Is this because the hiphase doesn't support the sniffles or pav output?

Thanks,

Hang Su

@holtjma
Copy link
Collaborator

holtjma commented Jan 27, 2024

I suspect the answer to your question is yes. If you update to the latest version of HiPhase, this error should become clearer.

Regardless, we do not currently support sniffles or pav due to some incomplete SV calls.

@hangsuUNC
Copy link

hangsuUNC commented Jan 30, 2024

I suspect the answer to your question is yes. If you update to the latest version of HiPhase, this error should become clearer.

Regardless, we do not currently support sniffles or pav due to some incomplete SV calls.

Thanks for your reply Matt! If the assertion is checking the left reference allele is identical to the right reference sequence in the fasta file, does it require everything in the reference allele be upper case? We are trying to clean up the vcf files to fit into the Hiphase pipeline. Your help is much appreciated!

Thanks,

Hang

@holtjma
Copy link
Collaborator

holtjma commented Jan 30, 2024

The reference genome sequences from the reference FASTA file will get converted to upper-case.

I don't think we've seen an example where the VCF file did contained lower-case characters, so I suspect you will need to make those conversions yourself for the moment. I recommend doing both the reference and alternate alleles, otherwise you will likely get undefined behavior.

@hangsuUNC
Copy link

hangsuUNC commented Jan 30, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants