malonge / RagTag

Tools for fast and flexible genome assembly scaffolding and improvement
MIT License
470 stars 47 forks source link

Error using merge #82

Closed SuPrSh closed 3 years ago

SuPrSh commented 3 years ago

Hello, I am getting constant error while using merge command in ragtag

Mon Sep 27 20:53:00 2021 --- INFO: Building the scaffold graph from the AGP files
Traceback (most recent call last):
  File "/root/miniconda3/envs/myenv/bin/ragtag_merge.py", line 430, in <module>
    main()
  File "/root/miniconda3/envs/myenv/bin/ragtag_merge.py", line 362, in main
    agp_multi_sg.add_agps(agp_list, in_weights=weight_list, exclusion_set=comp_exclusion_set)
  File "/root/miniconda3/envs/myenv/lib/python3.6/site-packages/ragtag_utilities/ScaffoldGraph.py", line 606, in add_agps
    for ap in self._get_assembly_points(agp, weight):
  File "/root/miniconda3/envs/myenv/lib/python3.6/site-packages/ragtag_utilities/ScaffoldGraph.py", line 513, in _get_assembly_points
    raise RuntimeError("{} is in {} but not {}.".format(agp_line.comp, agp, self.components_fasta_fname))
RuntimeError: k141_114310 is in /mnt/sdb/P6260/megahit/R1/ragtag_output/ragtag.scaffold.agp but not /mnt/sdb/P6260/ragtag/ggan/ragtag.ggan.scaffold.fasta.
malonge commented 3 years ago

Hi there,

This is showing that there is a component in your AGP file (k141_114310) that is not in the assembly. In other words, that AGP file defines a scaffolding solution for some other assembly, not ragtag.ggan.scaffold.fasta. In order for RagTag "merge" to work, all AGP files must contain the exact same set of components as the assembly. Read here for more details.

dgs108 commented 6 months ago

I would like to revisit this comment. I have a similar situation in that when scaffolding, SALSA2 corrected 8 of my contigs and broke them into 2. Thus, a contig that appears as ctg927 in the .fasta file appears as ctg927_1 and ctg927_2 in the resulting AGP file.

In this situation, would you advise to polish the preliminary assembly before scaffolding?

Thanks!