Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pilon error: Exception in thread "main" java.lang.IllegalArgumentException: Cannot add sequence that already exists in SAMSequenceDictionary: contig_1 #157

Open
saras224 opened this issue Mar 17, 2023 · 1 comment

Comments

@saras224
Copy link

Hi @bwlang
I ran the following command : pilon --genome assembly.fasta --bam C8_sorted.bam --threads 40

its giving this error:
Pilon version 1.24 Thu Jan 28 13:00:45 2021 -0500
Exception in thread "main" java.lang.IllegalArgumentException: Cannot add sequence that already exists in SAMSequenceDictionary: contig_1
at htsjdk.samtools.SAMSequenceDictionary.setSequences(SAMSequenceDictionary.java:80)
at htsjdk.samtools.SAMSequenceDictionary.(SAMSequenceDictionary.java:53)
at htsjdk.samtools.SAMTextHeaderCodec.decode(SAMTextHeaderCodec.java:123)
at htsjdk.samtools.BAMFileReader.readHeader(BAMFileReader.java:704)
at htsjdk.samtools.BAMFileReader.(BAMFileReader.java:298)
at htsjdk.samtools.BAMFileReader.(BAMFileReader.java:176)
at htsjdk.samtools.SamReaderFactory$SamReaderFactoryImpl.open(SamReaderFactory.java:396)
at htsjdk.samtools.SamReaderFactory$SamReaderFactoryImpl.open(SamReaderFactory.java:208)
at org.broadinstitute.pilon.BamFile.reader(BamFile.scala:51)
at org.broadinstitute.pilon.BamFile.(BamFile.scala:57)
at org.broadinstitute.pilon.Pilon$.optionParse(Pilon.scala:131)
at org.broadinstitute.pilon.Pilon$.optionParse(Pilon.scala:172)
at org.broadinstitute.pilon.Pilon$.main(Pilon.scala:84)
at org.broadinstitute.pilon.Pilon.main(Pilon.scala)

Please help me resolve this error.
Thanks!!

@bwlang
Copy link
Contributor

bwlang commented Mar 17, 2023

If I read this error message correclty, it seems that you have 2 contigs in your fasta file named "contig_1". That's not allowed. It might indicate dupliate data. Probably you should investigate how that happened.

You can confirm the problem by looking at at your assembly.fasta (maybe run samtools faidx assembly.fasta to produce an assembly.fasta.fai file that may be easier to read).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants