import vcf in populations

743 views
Skip to first unread message

Matthew Olson

unread,
Feb 8, 2019, 4:56:17 PM2/8/19
to Stacks
I am trying to import a vcf developed in gatk from sequence capture data from 47 individuals so that I can calculate Fis for each locus using "populations".

My command line is: 
populations -V MyVcfName.vcf --out-path ./stacksOut -M popmap.txt -t 8

the popmap is read, the vcf is opened, and batch processing begins, but I get the following error:

At src/PopSum.cc:96 This should never happen.
Aborted.

I am using stacks version 2.3.

Has anyone else had a similar problem? Any advice on how to move past this error message would be very much appreciated. 

Nicolas Rochette

unread,
Feb 8, 2019, 5:08:38 PM2/8/19
to stacks...@googlegroups.com

Hello Matthew,

The "this should never happen" errors are just guards to make sure all the code runs in exactly the way we think it should. In this case this seems to be a crash I introduced in v2.3 and has to do with the handling of SNPs that have more than two alleles.

We'll eventually fix it; in the meantime if you're fine ignoring SNPs that have 3 or 4 alleles, you can remove them from your VCF like so:

awk '/^#/ || $4 !~ /,/' mysnps.vcf > mysnps.2alleles.vcf

Best,

Nicolas

--
Stacks website: http://catchenlab.life.illinois.edu/stacks/
---
You received this message because you are subscribed to the Google Groups "Stacks" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stacks-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/stacks-users/18160dfe-9b29-422b-bf55-35c74e525dc8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Matthew Olson

unread,
Feb 8, 2019, 11:25:02 PM2/8/19
to Stacks
Hello Nicolas, 

Thanks so much! 

I actually found that the code you posted was slightly off for my VCF and should be:
awk '/^#/ || $5 !~ /,/' mysnps.vcf > mysnps.2alleles.vcf

But after I figured that out, it ran through 'populations' with no errors.

Your answer got me going again.

best regards, 

matt

julia....@googlemail.com

unread,
Mar 7, 2019, 6:01:53 AM3/7/19
to Stacks
Hey,

I just downloaded stacks v 2.3d as I would like to use the treemix outfile. Everything went well during the installation.
Gstacks is working but when I wanna run populations with the gstacks output, I will get the same Error:

Processing data in batches:
  * load a batch of catalog loci and apply filters
  * compute SNP- and haplotype-wise per-population statistics
  * write the above statistics in the output files
  * export the genotypes/haplotypes in specified format(s)
More details in 'gstacks_alces_gpet/populations.log.distribs'.
Now processing...

At src/PopSum.cc:96 This should never happen.

The result files are empty.

This is my command:

populations -P gstacks/ -M popMap.txt -r 0.33 -R 0.33 -p 5 --treemix --min_maf 0.05

The command worked with stacks 2.2.
Do you have any suggestions what went wrong?

Thanks a lot.
Julia

María José Frugone Wielandt

unread,
Jun 14, 2019, 1:11:03 PM6/14/19
to Stacks
Dear Nicolas,

Sorry for bothering you with the same issue, but i am having the same error, following the complete stacks pipeline (not using another software) and I still dont have a vcf file (as i was going to obtain it from populations). In gstacks I used marukihigh model using ddRad data. In populations I used the following command line:

populations -P ustacks/ -O ustacks/output/ -M popmap_numbers_2.txt -r 0.7 --min-maf 0.05

And this is the error

Processing data in batches:
  * load a batch of catalog loci and apply filters
  * compute SNP- and haplotype-wise per-population statistics
  * write the above statistics in the output files
  * export the genotypes/haplotypes in specified format(s)
More details in 'ustacks/output/populations.log.distribs'.
Now processing...
At src/PopSum.cc:96 This should never happen.
Aborted.

could you please help me?
Thanks,

María José

El viernes, 8 de febrero de 2019, 19:08:38 (UTC-3), Nicolas Rochette escribió:

Hello Matthew,

The "this should never happen" errors are just guards to make sure all the code runs in exactly the way we think it should. In this case this seems to be a crash I introduced in v2.3 and has to do with the handling of SNPs that have more than two alleles.

We'll eventually fix it; in the meantime if you're fine ignoring SNPs that have 3 or 4 alleles, you can remove them from your VCF like so:

awk '/^#/ || $4 !~ /,/' mysnps.vcf > mysnps.2alleles.vcf

Best,

Nicolas

Le 2/8/2019 à 1:56 PM, Matthew Olson a écrit :
I am trying to import a vcf developed in gatk from sequence capture data from 47 individuals so that I can calculate Fis for each locus using "populations".

My command line is: 
populations -V MyVcfName.vcf --out-path ./stacksOut -M popmap.txt -t 8

the popmap is read, the vcf is opened, and batch processing begins, but I get the following error:

At src/PopSum.cc:96 This should never happen.
Aborted.

I am using stacks version 2.3.

Has anyone else had a similar problem? Any advice on how to move past this error message would be very much appreciated. 

--
Stacks website: http://catchenlab.life.illinois.edu/stacks/
---
You received this message because you are subscribed to the Google Groups "Stacks" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stacks...@googlegroups.com.

Garret Strickland

unread,
Dec 5, 2019, 11:42:37 AM12/5/19
to Stacks
I am getting the same issue. When I use the snp or marukihigh model in gstacks in version 2.3 I get the src error and no VCF file is availiable to filter. Has anyone  been able to rectify this?
Reply all
Reply to author
Forward
0 new messages