cstacks fails with message: "Error parsing ./stacks/NA18505.recal.snps.tsv.gz at line: 54219 (4 fields)"

287 views
Skip to first unread message

Thomas Cooke

unread,
Aug 4, 2015, 6:15:44 PM8/4/15
to Stacks
I'm running ref_map.pl (version 1.32) on Ubuntu linux, with bam functionality enabled (samtools 0.1.19). I executed the following command:

ref_map.pl -T 8 -e /usr/local/bin/stacks \
-B hapmap_radtags -b 1 -D "HapMap concordance analysis" \
-o ./stacks/ \
-s NA18505.recal.bam \
-s NA18508.recal.bam \
-s NA19648.recal.bam \
-s NA19704.recal.bam \
-s NA19730.recal.bam \
-s NA19836.recal.bam \
-s NA21732.recal.bam \
-s NA21733.recal.bam

Stacks appeared to successfully generate files with suffix .snps.tsv.gz, .alleles.tsv.gz, .tags.tsv.gz for each sample in the directory ./stacks, but then cstacks fails. Below is an excerpt from ref_map.log. Can you please help me figure out what the problem might be? Thanks!

-Tom

/usr/local/bin/stacks/cstacks -g -b 1 -o ./stacks -s ./stacks/NA18505.recal -s ./stacks/NA18508.recal -s ./stacks/NA19648.recal -s ./stacks/NA19704.recal -s ./stacks/NA19730.recal -s ./stacks/NA19836.recal -s ./stacks/NA21732.recal -s ./stacks/NA21733.recal  -p 8 2>&1
Number of mismatches allowed between stacks: 1
Loci matched based on genomic location.
Constructing catalog from 8 samples.
Initializing new catalog...
  Parsing ./stacks/NA18505.recal.tags.tsv.gz
  Parsing ./stacks/NA18505.recal.snps.tsv.gz
Error parsing ./stacks/NA18505.recal.snps.tsv.gz at line: 54219. (4 fields).
Failed to initialize the catalog.

Julian Catchen

unread,
Aug 5, 2015, 11:01:14 AM8/5/15
to stacks...@googlegroups.com, cook...@gmail.com
Hi Tom,

As you note in the subject line, the cstacks program is unable to parse
the ./stacks/NA18505.recal.snps.tsv.gz file. Stacks expects 10 columns
in a *.SNPs.tsv file but it is only finding 4 columns at line 54219 in
the file. You can take a look at that line in the file to see what is
happening there. More usefully, you could re-run pstacks for that sample
(all the pstacks commands were recorded in the ref_map.log file) as it
is the program that generates the *.snps.tsv file. pstacks may have
crashed, you might have run out of disk space, or some other problem may
have occurred.

Best,

julian

ps - I would also recommend upgrading to 1.34 as there were some bugs
limiting the number of SNPs output by the populations program.

Ross Whetten

unread,
Oct 23, 2015, 2:12:53 PM10/23/15
to Stacks, jcat...@illinois.edu
I am getting a similar error using v1.35 - pstacks runs without complaint and produces the three expected output files, but cstacks complains about the format of the tags.tsv.gz file at line 0, and fails to initialize the catalog:
Initializing new catalog...
  Parsing stacks/P01A01.tags.tsv.gz
Error parsing stacks/P01A01.tags.tsv.gz at line: 0. (1 fields).

Failed to initialize the catalog.

The failure happened with any of several sample names I tried, so it is not specific to a single file.
The first line of the *.tags.tsv.gz files is # pstacks version 1.35; generated on 2015-10-23 13:26:45; the following lines follow the format described in the STACKS manual.

Regards,
Ross

Julian Catchen

unread,
Oct 23, 2015, 4:31:46 PM10/23/15
to Ross Whetten, Stacks
Hi Ross,

My first thought is that you have two versions of Stacks installed and
you are inadvertantly running an older version when you try to build the
catalog (the version strings in the Stacks output files are relatively new).

Can you post the command you are using and verify that the copy of
cstacks your command is running is version 1.35?

Best,

julian

Ross Whetten

unread,
Oct 23, 2015, 7:24:07 PM10/23/15
to Julian Catchen, Stacks
Hi Julian,
That was it - I had neglected to put the full path to the v1.35 executable in the cstacks call.  I keep multiple versions of STACKS installed so I can repeat analyses that were done at different times with different versions, but the downside is having to remember which version to use for which analysis.
Thanks for the quick reply!

Regards,
Ross

Reply all
Reply to author
Forward
0 new messages