ID sample error in cstacks

152 views
Skip to first unread message

sara razi

unread,
Aug 27, 2018, 4:13:25 AM8/27/18
to stacks...@googlegroups.com
Hi, 
I'm trying to do GBS pipeline in stacks software.I run the pstacks and gave pstacks output including "alleles", "models", snps" and "tags" files for each samples , but when I run cstacks, it gives me this error: " Sample ID '184' occurs more than once. Sample IDs must be unique Aborted". While I checked the samples ID, I did not have any other sample ID with this number. Do you know how can I fix this problem? 
sara

Julian Catchen

unread,
Aug 27, 2018, 12:25:13 PM8/27/18
to stacks...@googlegroups.com, sara razi
Hi Sara,

For one or more of your pstacks runs, you specified the same ID to
different samples. Stacks requires you to provide distinct IDs to each
sample you process. If you use the ref_map.pl wrapper program it will
handle numbering the samples for you.

julian

sara razi wrote on 8/27/18 3:13 AM:

Flor Rodríguez-Gómez

unread,
Sep 3, 2018, 6:23:56 PM9/3/18
to Stacks
Hi Sara and Julian,
I have the same problem. I am using ref_map_pl and the error is "Error: Sample ID '52' occurs more than once. Sample IDs must be unique. Aborted" using cstacks, but I don´t have samples with same ID. 
Actually is weird because it error only pass when I use the next parameters -b 3 -T 20 -m 4 -S -o /share/Part1/metagenome_course/frodriguez/data/Quercus/Todas/results_TB1_m4_n2_b3 -O /share/Part1/metagenome_course/frodriguez/data/Quercus/Todas/popmapT1.txt --samples /share/Part1/metagenome_course/frodriguez/data/Quercus/Todas/SAM_file -B ref_catalog1 -D "Ref datos ejemplo catalog1" --create_db -X "cstacks:-n 2"
And I don´t have problems when I use next one " 

-b 1 -T 20 -m 3 -S -o /share/Part1/metagenome_course/frodriguez/data/Quercus/Todas/population_map_results_TB1 -O /share/Part1/metagenome_course/frodriguez/data/Quercus/Todas/popmapT1.txt --samples /share/Part1/metagenome_course/frodriguez/data/Quercus/Todas/SAM_file -B ref_catalog1 -D "Ref datos ejemplo catalog1" --create_db


when I use -m 3 I don´t have any problems, in fact, the run finish very well, but only when I use a different -m value and -X "cstacks:-n".

Please help me!
Cheers,
Flor

Julian Catchen

unread,
Sep 5, 2018, 12:36:46 PM9/5/18
to stacks...@googlegroups.com, Flor Rodríguez-Gómez, sara....@gmail.com
Hi Sara and Flor,

First, test that you really don't have the same sample ID more than once:

ls -1 *.tags.tsv.gz | \
grep -v catalog | \
while read line; \
do \
zcat $line | \
head -n 2 | tail -n 1 | \
cut -f 1; \
done | \
sort -n | uniq -c

You should see all 1s in the left column, each corresponding to a sample
ID in the right column, like:

1 1
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
etc...

Best,

julian

Flor Rodríguez-Gómez wrote on 9/3/18 5:23 PM:
> Hi Sara and Julian,
> I have the same problem. I am using ref_map_pl and the error is "Error:
> Sample ID '52' occurs more than once. Sample IDs must be unique.
> Aborted" using cstacks, but I don´t have samples with same ID.
> Actually is weird because it error only pass when I use the next
> parameters -b 3-T 20 -m 4-S -o
Reply all
Reply to author
Forward
0 new messages