File mismatch detected in summary.seqs

After making contigs I ran the summary.seqs command. I am getting error.

make.contigs(file=stability.files, processors=2)
Group count:
BF1 48820
BF2 39063
BGF1 29053
BGF2 57182
BTF1 70994
BTF2 70994
GPF1 46465
GPF2 45973
PF1 44677
PF2 48949
TPF1 68722
TPF2 40591
Total of all groups is 611483
It took 371 secs to process 611483 sequences.

mothur > summary.seqs(fasta=stability.trim.contigs.fasta, count=stability.contigs.count_table)

Using 2 processors.

[ERROR]: Your count file contains 540489 unique sequences, but your fasta file contains 611483. File mismatch detected, quitting command.

I need help in resolving this.
Regards
Hira

Few questions…

  1. Can you tell me what version of mothur you are running?
  2. Can you re-run make.contigs and summary.seqs?
  3. What files does make.contigs say are being generated?

Pat

1 Like

I am using Mothur Version 1.48.0 on macOS Ventura 13.3.1.
I had rerun make.contigs and summary.seqs.
The commands were run as given below:

mothur > set.dir(input=/users/hiraabid/desktop/mothur/Fish_gut_microbiome_data, output=/users/hiraabid/desktop/mothur/Fish_gut_microbiome_data)
Mothur's directories:
outputDir=/users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/
inputdir=
	/users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/
mothur > make.file(inputdir=/users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/, type=fastq, prefix=stability)
Setting input directories to: 
	/users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/
Output File Names: 
/users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/stability.files

mothur > make.contigs(file=stability.files, processors=2)

Using 2 processors.
Unable to open BF1_1.fastq. Trying input directory /users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/BF1_1.fastq.
Unable to open BF1_2.fastq. Trying input directory /users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/BF1_2.fastq.
Unable to open BF2_1.fastq. Trying input directory /users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/BF2_1.fastq.
Unable to open BF2_2.fastq. Trying input directory /users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/BF2_2.fastq.
Unable to open BGF1_1.fastq. Trying input directory /users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/BGF1_1.fastq.
Unable to open BGF1_2.fastq. Trying input directory /users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/BGF1_2.fastq.
Unable to open BGF2_1.fastq. Trying input directory /users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/BGF2_1.fastq.
Unable to open BGF2_2.fastq. Trying input directory /users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/BGF2_2.fastq.
Unable to open BTF1_1.fastq. Trying input directory /users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/BTF1_1.fastq.
Unable to open BTF1_2.fastq. Trying input directory /users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/BTF1_2.fastq.
Unable to open BTF2_1.fastq. Trying input directory /users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/BTF2_1.fastq.
Unable to open BTF2_2.fastq. Trying input directory /users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/BTF2_2.fastq.
Unable to open GPF1_1.fastq. Trying input directory /users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/GPF1_1.fastq.
Unable to open GPF1_2.fastq. Trying input directory /users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/GPF1_2.fastq.
Unable to open GPF2_1.fastq. Trying input directory /users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/GPF2_1.fastq.
Unable to open GPF2_2.fastq. Trying input directory /users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/GPF2_2.fastq.
Unable to open PF1_1.fastq. Trying input directory /users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/PF1_1.fastq.
Unable to open PF1_2.fastq. Trying input directory /users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/PF1_2.fastq.
Unable to open PF2_1.fastq. Trying input directory /users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/PF2_1.fastq.
Unable to open PF2_2.fastq. Trying input directory /users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/PF2_2.fastq.
Unable to open TPF1_1.fastq. Trying input directory /users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/TPF1_1.fastq.
Unable to open TPF1_2.fastq. Trying input directory /users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/TPF1_2.fastq.
Unable to open TPF2_1.fastq. Trying input directory /users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/TPF2_1.fastq.
Unable to open TPF2_2.fastq. Trying input directory /users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/TPF2_2.fastq.

Processing file pair /users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/BF1_1.fastq - /users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/BF1_2.fastq (files 1 of 12) <<<<<
Making contigs…
Done.

It took 24 secs to assemble 48820 reads.

Processing file pair /users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/BF2_1.fastq - /users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/BF2_2.fastq (files 2 of 12) <<<<<
Making contigs…
Done.

It took 19 secs to assemble 39063 reads.

Processing file pair /users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/BGF1_1.fastq - /users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/BGF1_2.fastq (files 3 of 12) <<<<<
Making contigs…
Done.

It took 16 secs to assemble 29053 reads.

Processing file pair /users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/BGF2_1.fastq - /users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/BGF2_2.fastq (files 4 of 12) <<<<<
Making contigs…
Done.

It took 30 secs to assemble 57182 reads.

Processing file pair /users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/BTF1_1.fastq - /users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/BTF1_2.fastq (files 5 of 12) <<<<<
Making contigs…
Done.

It took 40 secs to assemble 70994 reads.

Processing file pair /users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/BTF2_1.fastq - /users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/BTF2_2.fastq (files 6 of 12) <<<<<
Making contigs…
Done.

It took 37 secs to assemble 70994 reads.

Processing file pair /users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/GPF1_1.fastq - /users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/GPF1_2.fastq (files 7 of 12) <<<<<
Making contigs…
Done.

It took 26 secs to assemble 46465 reads.

Processing file pair /users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/GPF2_1.fastq - /users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/GPF2_2.fastq (files 8 of 12) <<<<<
Making contigs…
Done.

It took 25 secs to assemble 45973 reads.

Processing file pair /users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/PF1_1.fastq - /users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/PF1_2.fastq (files 9 of 12) <<<<<
Making contigs…
Done.

It took 25 secs to assemble 44677 reads.

Processing file pair /users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/PF2_1.fastq - /users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/PF2_2.fastq (files 10 of 12) <<<<<
Making contigs…
Done.

It took 27 secs to assemble 48949 reads.

Processing file pair /users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/TPF1_1.fastq - /users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/TPF1_2.fastq (files 11 of 12) <<<<<
Making contigs…
Done.

It took 37 secs to assemble 68722 reads.

Processing file pair /users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/TPF2_1.fastq - /users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/TPF2_2.fastq (files 12 of 12) <<<<<
Making contigs…
Done.

It took 22 secs to assemble 40591 reads.

Group count:
BF1 48820
BF2 39063
BGF1 29053
BGF2 57182
BTF1 70994
BTF2 70994
GPF1 46465
GPF2 45973
PF1 44677
PF2 48949
TPF1 68722
TPF2 40591

Total of all groups is 611483

It took 332 secs to process 611483 sequences.

Output File Names:
/users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/stability.trim.contigs.fasta
/users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/stability.scrap.contigs.fasta
/users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/stability.contigs_report
/users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/stability.contigs.count_table

mothur > summary.seqs(fasta=stability.trim.contigs.fasta, count=stability.contigs.count_table)

Using 2 processors.
[ERROR]: Your count file contains 540489 unique sequences, but your fasta file contains 611483. File mismatch detected, quitting command.

mothur > summary.seqs(fasta=stability.trim.contigs.fasta)

Using 2 processors.

Start End NBases Ambigs Polymer NumSeqs

Minimum: 1 301 301 0 3 1

2.5%-tile: 1 439 439 0 4 15288

25%-tile: 1 445 445 0 5 152871

Median: 1 460 460 0 5 305742

75%-tile: 1 465 465 0 6 458613

97.5%-tile: 1 466 466 8 6 596196

Maximum: 1 602 602 155 301 611483

Mean: 1 456 456 0 5

# of Seqs: 611483

It took 9 secs to summarize 611483 sequences.

Output File Names:

/users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/stability.trim.contigs.summary

Hmmmm. I’m not sure what’s going wrong. A couple of things to try…

  1. Rerun make.contigs but with processors=1
  2. Can you use relative paths? Use your terminal app to move to your data (e.g., cd /users/hiraabid/desktop/mothur/Fish_gut_microbiome_data/) and then launch mothur with ./mothur, skip set.dir, and run make.file(inputdir=., type=fastq, prefix=stability) and make.contigs(file=stability.files, processors=1)

Pat

1 Like

Sir, I followed the steps as you have suggested but got the same error again.
I checked all of my fastq files thoroughly. The two samples named BTF1 and BTF2 are totally identical
Fastq forward read for BTF1


Fastq forward read for BTF2

Similarly the reverse read files are similar.
As their forward and reverse reads are similar. So what actually happens is that the fasta file contains all the samples but the count table generated does not has the sample BTF2 as I checked the count table. Then I did this:

count.seqs(count=stability.contigs.count_table, groups=BTF1-BTF2)
Output File Names: 
stability.contigs.sparse.count_table

This sparse count table showed only one sample i.e., BTF1

I removed BTF2 forward and reverse fastq files from my folder and then made contigs as follows which worked well:

Group count: 
BF1	48820
BF2	39063
BGF1	29053
BGF2	57182
BTF1	70994
GPF1	46465
GPF2	45973
PF1	44677
PF2	48949
TPF1	68722
TPF2	40591

Total of all groups is 540489

It took 308 secs to process 540489 sequences.

Output File Names: 
/users/hiraabid/desktop/mothur/Fish_microbiome_DATA/stability.trim.contigs.fasta
/users/hiraabid/desktop/mothur/Fish_microbiome_DATA/stability.scrap.contigs.fasta
/users/hiraabid/desktop/mothur/Fish_microbiome_DATA/stability.contigs_report
/users/hiraabid/desktop/mothur/Fish_microbiome_DATA/stability.contigs.count_table


mothur > summary.seqs(fasta=stability.trim.contigs.fasta, count=stability.contigs.count_table)

Using 2 processors.

		Start	End	NBases	Ambigs	Polymer	NumSeqs
Minimum:	1	301	301	0	3	1
2.5%-tile:	1	439	439	0	4	13513
25%-tile:	1	445	445	0	5	135123
Median: 	1	460	460	0	5	270245
75%-tile:	1	465	465	0	6	405367
97.5%-tile:	1	466	466	8	6	526977
Maximum:	1	602	602	155	301	540489
Mean:	1	456	456	0	5
# of unique seqs:	540489
total # of seqs:	540489

It took 12 secs to summarize 540489 sequences.

Output File Names:
/users/hiraabid/desktop/mothur/Fish_microbiome_DATA/stability.trim.contigs.summary

Is this happening due to two samples having identical results?
Group count:
BTF1 70994
BTF2 70994
Can I resolve this somehow ?

Regards
Hira

Ah, that would explain the problem. I’d remove the BFT1 or BTF2 fastq files or replace them with the correct ones.

Pat

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.