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

SAM/BAM/CRAM file has 1 before 10, but VCF/BCF file has 1 after 10 #102

Open
WernaUVenema opened this issue Apr 24, 2023 · 7 comments
Open

Comments

@WernaUVenema
Copy link

Dear all,

Although I already sorted the VCF file according to the chromosome order of the BAM file AND adjusted the header of the VCF file, I still get this error:
" [E:int32_t cmdCramDemuxlet(int32_t, char**)] Your VCF/BCF files and SAM/BAM/CRAM files have different ordering of chromosomes. SAM/BAM/CRAM file has 1 before 10, but VCF/BCF file has 1 after 10 "

What could be the problem? Is there a bug?

Could anyone help me out here?

Thanks!

@hyunminkang
Copy link
Contributor

I doubt that this is a bug. If you can compare the results from

samtools view -H [in.bam] | grep ^@SQ | head -n 30 and

tabix -H [in.vcf.gz] | grep contig | head -n 30

that would clarify the difference.

@WernaUVenema
Copy link
Author

WernaUVenema commented Apr 24, 2023

Schermafbeelding 2023-04-24 om 16 06 42

thats the vcf through grep

@WernaUVenema
Copy link
Author

Schermafbeelding 2023-04-24 om 16 06 35

and therethe BAM

@hyunminkang
Copy link
Contributor

hyunminkang commented Apr 24, 2023

Did you reorder the VCF header too?

@WernaUVenema
Copy link
Author

WernaUVenema commented Apr 24, 2023

Yes, I did that manually using nano
Schermafbeelding 2023-04-24 om 16 57 33

@hyunminkang
Copy link
Contributor

I don't know what the problem is exactly here. I didn't run into this problem before. Is it possible that you can use demuxlet in popscle (which is recommended anyways) and see if the problem persists?

@iaradsouza1
Copy link

You can use picard to sort your VCF based on your bam file and update the dictionary: statgen/popscle#42

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants