problem loading vcf from ipyrad into populations

332 views
Skip to first unread message

Martin Schwentner

unread,
Feb 18, 2020, 8:36:06 AM2/18/20
to Stacks
Dear STACKS community,

I have some ipyrad runs whose output files I would like to import and analyse with the populations option in STACKS. The ipyrad output is in vcf format. Although the overall format seems identical among my various vcf files outputted from ipyrad, not all appear to work in STACKS. While some are read and processed as expected, others terminate with an error. I attached the vcf file of one of the runs that terminated with an error.

The most basic command that I used (populations version 2.1):

populations -V Neo_red.vcf -O TEST3_STACKS_popgen -t 16 --hwe


The error message was:

Aborted. (basic_string::compare: __pos (which is 18446744073709551614) > this->size() (which is 11))


The repective outfile read:
Logging to 'TEST3_STACKS_popgen/Neo_red.p.log'.
Locus/sample distributions will be written to 'TEST3_STACKS_popgen/Neo_red.p.log.distribs'.
populations parameters selected:
  Input mode: VCF
  Percent samples limit per population: 0
  Locus Population limit: 1
  Log liklihood filtering: off; threshold: 0
  Minor allele frequency cutoff: 0
  Maximum observed heterozygosity cutoff: 1
  Applying Fst correction: none.
  Pi/Fis kernel smoothing: off
  Fstats kernel smoothing: off
  Bootstrap resampling: off

A population map was not specified, all samples will be read from '' as a single popultaion.
Opening the VCF file...




I am looking forward to any helpful ideas.
Best,
Martin
Neo_red.vcf

Martin Schwentner

unread,
Feb 21, 2020, 5:47:12 AM2/21/20
to Stacks
Dear all,

I found the error. The problem are too long individual names in the vcf file. Once these were shorted Stacks ran perfectly.

Best,
Martin

Nicolas Rochette

unread,
Feb 21, 2020, 9:14:51 AM2/21/20
to stacks...@googlegroups.com, Martin Schwentner

Hi Martin,

Thanks for the update, sorry we couldn't get back to you earlier.

What was the length of the initial header line? eg. this code

zgrep '^#C' mygenotypes.vcf.gz | wc -c

Anyway, that's weird; there already is code to handle that case, but it's a limit situation that may have been extensively tested so there might be a bug. If you could send me the error-causing VCF (or a subset with the header and a bunch of record lines) it would greatly help.

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/293565da-dc8f-4c35-9db7-67a70125a1ff%40googlegroups.com.

Stacks newbie

unread,
Apr 8, 2020, 2:55:00 PM4/8/20
to Stacks
Hi Nicolas,
I am also having issues parsing my .vcf file from ipyrad through populations in STACKS.
Here is the error I got and populations command used:

Now processing...

RAD_0 populations: src/export_formats.cc:2632: virtual int VcfExport::write_site(const CSLocus*, const LocPopSum*, const Datum* const*, std::size_t, std::size_t): Assertion `d[s]->snpdata[index].gq != (255)' failed.

/export/software/slurm/spool/slurmd/job14086941/slurm_script: line 27: 63137 Aborted                 (core dumped) populations --in_vcf /lustre/mngeve/rapturedata/CATDATA/ipyrad/CBtestsbb_outfiles/CBtestsbb.vcf -M /lustre/mngeve/rapturedata/CATDATA/ipyrad/CBtests_popmap.txt -O /lustre/mngeve/rapturedata/CATDATA/ipyrad/stackspop -p 2 -r 0.7 -t 10 --vcf


It does not look like the same problem Martin had, but I tried to even shorten the names as he did to see if it works, and it didn't.
When I used the command you gave above to check the  length of my header, it was  = 3614

Again, the error was not like Martin's... 
PLEASE, could advice me on how I can proceed so as to run "Populations"??
My original .vcf file from ipyrad is attached here (CBtestsbb.vcf).
THANK YOU.
To unsubscribe from this group and stop receiving emails from it, send an email to stacks...@googlegroups.com.
CBtestsbb.vcf

Alberto Abreu

unread,
Jan 9, 2023, 3:29:13 PM1/9/23
to Stacks
Hello Nicolas

Has a fix for this error been found? I am also getting the message
Aborted. (basic_string::compare: __pos (which is 18446744073709551614) > this->size() (which is 11))

where my individual sample names are very short (two letters) so the solution Martin provided is unlikely to solve my problem.

best

Alberto
Reply all
Reply to author
Forward
0 new messages