Answers.Body: <p>Probably too late but it might help someone else.
  I ran into the exact same problem. AGP file validates without error or warnings using the NCBI validation tool.
  When validating the submission I get the &quot;has only &quot;1&quot; component&quot; for all my contigs, but not the scaffolds (which have been broken up into contigs).
  So despite the fact that contigs are allowed in the AGP file I decided to remove all entries for contigs in the AGP file and validate again using Webin-CLI and now I get &quot;INFO : The submission has been validated successfully.&quot;
  That still doesn't mean a successful submission as Webin-CLI gets a connection refused error.
  This same error pups up when I use lftp or Filezilla so I think this is an unrelated error to the AGP error. But it means that ENA is not checking my fasta and agp files, so no submission ;-(.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-04-17T11:37:29.973Z
Answers.LastActivityDate: 2024-04-17T11:39:35.367Z
Answers.LastEditDate: 2024-04-17T11:39:35.367Z
Answers.UserDisplayName: Hans Jansen
Answers.Body: <p>Oh you silly sausage! Don't use AGP gap files.</p>
  <p>This is not a direct answer but a workaround. However, if your scaffolded genome is annotated, you might as well submit a flat file (.embl) instead of fasta and the gap file. The thing is, making that file is actually a lot more straightforward thanks to amazing <a href="https://github.com/NBISweden/EMBLmyGFF3" rel="nofollow noreferrer">EMBLmyGFF3</a>. You will also need the locus tag (a string used as prefix for loci in your genome) you must pre-register in the web interface (it's among &quot;Project&quot; options). Note that although the script does handle some EBI specifics (like automatic filtering of gff3 tags they don't like, or filtering sequences &lt; 100 bases), some there are things that need to be taken care of. For example, I had to remove duplicates (using <code>agat_sp_fix_features_locations_duplicated.pl</code>) and overlapping genes (using <code>agat_sp_fix_overlaping_genes.pl</code>), both available in <a href="https://github.com/NBISweden/AGAT" rel="nofollow noreferrer">AGAT collection</a>. This might be different for genomes annotated with a different tool (mine was <code>braker2</code>).</p>
  <p>Anyway, once I was advised to use this tool, it took like 2 hours for 400Mbp genome including the uploading time, so I certainly recommend it over wrestling with AGP files.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-06-03T22:00:36.213Z
Answers.LastActivityDate: 2021-06-03T22:00:36.213Z
Answers.UserDisplayName: Kamil S Jaron
Body: <p>I am battling the submission of scaffolded assembly to EBI, somehow I can not get AGP gap file right.</p>
  <p><em>background</em></p>
  <p>The only option seems to be using the <a href="https://ena-docs.readthedocs.io/en/latest/submit/assembly.html" rel="nofollow noreferrer">Webin-CLI submission interface</a>. For the scaffolded assembly submission, <a href="https://ena-docs.readthedocs.io/en/latest/submit/assembly/genome.html#scaffold-assembly" rel="nofollow noreferrer">one needs</a> the manifest file, the sequence (fasta or flat file), and AGP file, which denotes how contigs are glued together into scaffolds. I got already that the sequence file should contain only contigs, and EBI will glue them together using the AGP file.</p>
  <p><em>the problem</em></p>
  <p>So far so good, I checked <a href="https://www.ncbi.nlm.nih.gov/assembly/agp/AGP_Specification/" rel="nofollow noreferrer">the specification</a> and <a href="https://www.ncbi.nlm.nih.gov/assembly/agp/AGP_Specification/scaffold_from_contig_WGS.agp.v2.0/" rel="nofollow noreferrer">the example provided</a> and generated similarly looking files for my assembly, but then when I tried to validate the files using</p>
  <pre><code>ena-webin-cli -context genome -userName XXX -password XXX -manifest manifest_file -outputDir asm01_submission -inputDir ena_submission_input -ascp -validate
  </code></pre>
  <p>I got tons of errors with type</p>
  <pre><code>ERROR: Scaffold &quot;NODE_667656&quot; has only &quot;1&quot; component, minimum two components expected.
  ERROR: Scaffold &quot;NODE_353389&quot; has only &quot;1&quot; component, minimum two components expected.
  ...
  </code></pre>
  <p>supposedly for each contig that actually was not scaffolded. I am quite confused about this, as the example file contains tons of scaffold with one component only (for example the first one <code>EG1_scaffold1</code>).</p>
  <p>What am I missing?</p>
  <p>Sample of my AGP file (incl 1 scaffold and 3 contigs):</p>
  <pre><code>Path_2003       1       1672    1       W       NODE_32694_length_1672_cov_36.024451    1       1672    +
  Path_2003       1673    1772    2       U       100     scaffold        yes     align_trnscpt
  Path_2003       1773    2521    3       W       NODE_61726_length_749_cov_25.233631     1       749     +
  Path_2003       2522    2621    4       U       100     scaffold        yes     align_trnscpt
  Path_2003       2622    5705    5       W       NODE_20424_length_3084_cov_26.290988    1       3084    +
  NODE_667656     1       86      1       W       NODE_667656_length_86_cov_136.111111    1       86      +
  NODE_353389     1       155     1       W       NODE_353389_length_155_cov_25.230769    1       155     +
  </code></pre>
  
Tags: <database><public-databases>
Title: How to specify the list of contigs in AGP gap file used for ENA submissions
ThreadText: # How to specify the list of contigs in AGP gap file used for ENA submissions
  
  (Asked by: username_0 on 2021-06-03)
  
  I am battling the submission of scaffolded assembly to EBI, somehow I can not get AGP gap file right.
  
  *background*
  
  The only option seems to be using the [Webin-CLI submission interface](https://ena-docs.readthedocs.io/en/latest/submit/assembly.html). For the scaffolded assembly submission, [one needs](https://ena-docs.readthedocs.io/en/latest/submit/assembly/genome.html#scaffold-assembly) the manifest file, the sequence (fasta or flat file), and AGP file, which denotes how contigs are glued together into scaffolds. I got already that the sequence file should contain only contigs, and EBI will glue them together using the AGP file.
  
  *the problem*
  
  So far so good, I checked [the specification](https://www.ncbi.nlm.nih.gov/assembly/agp/AGP_Specification/) and [the example provided](https://www.ncbi.nlm.nih.gov/assembly/agp/AGP_Specification/scaffold_from_contig_WGS.agp.v2.0/) and generated similarly looking files for my assembly, but then when I tried to validate the files using
  
  ```
  ena-webin-cli -context genome -userName XXX -password XXX -manifest manifest_file -outputDir asm01_submission -inputDir ena_submission_input -ascp -validate
  
  ```
  
  I got tons of errors with type
  
  ```
  ERROR: Scaffold "NODE_667656" has only "1" component, minimum two components expected.
  ERROR: Scaffold "NODE_353389" has only "1" component, minimum two components expected.
  ...
  
  ```
  
  supposedly for each contig that actually was not scaffolded. I am quite confused about this, as the example file contains tons of scaffold with one component only (for example the first one `EG1_scaffold1`).
  
  What am I missing?
  
  Sample of my AGP file (incl 1 scaffold and 3 contigs):
  
  ```
  Path_2003       1       1672    1       W       NODE_32694_length_1672_cov_36.024451    1       1672    +
  Path_2003       1673    1772    2       U       100     scaffold        yes     align_trnscpt
  Path_2003       1773    2521    3       W       NODE_61726_length_749_cov_25.233631     1       749     +
  Path_2003       2522    2621    4       U       100     scaffold        yes     align_trnscpt
  Path_2003       2622    5705    5       W       NODE_20424_length_3084_cov_26.290988    1       3084    +
  NODE_667656     1       86      1       W       NODE_667656_length_86_cov_136.111111    1       86      +
  NODE_353389     1       155     1       W       NODE_353389_length_155_cov_25.230769    1       155     +
  
  ```
  
  **Tags:** database, public-databases
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2024-04-17. Score: 1
  
  Probably too late but it might help someone else.
  I ran into the exact same problem. AGP file validates without error or warnings using the NCBI validation tool.
  When validating the submission I get the "has only "1" component" for all my contigs, but not the scaffolds (which have been broken up into contigs).
  So despite the fact that contigs are allowed in the AGP file I decided to remove all entries for contigs in the AGP file and validate again using Webin-CLI and now I get "INFO : The submission has been validated successfully."
  That still doesn't mean a successful submission as Webin-CLI gets a connection refused error.
  This same error pups up when I use lftp or Filezilla so I think this is an unrelated error to the AGP error. But it means that ENA is not checking my fasta and agp files, so no submission ;-(.
  
  
  ---
  
  ### Answer by username_0 on 2021-06-03. Score: 1
  
  Oh you silly sausage! Don't use AGP gap files.
  
  This is not a direct answer but a workaround. However, if your scaffolded genome is annotated, you might as well submit a flat file (.embl) instead of fasta and the gap file. The thing is, making that file is actually a lot more straightforward thanks to amazing [EMBLmyGFF3](https://github.com/NBISweden/EMBLmyGFF3). You will also need the locus tag (a string used as prefix for loci in your genome) you must pre-register in the web interface (it's among "Project" options). Note that although the script does handle some EBI specifics (like automatic filtering of gff3 tags they don't like, or filtering sequences < 100 bases), some there are things that need to be taken care of. For example, I had to remove duplicates (using `agat_sp_fix_features_locations_duplicated.pl`) and overlapping genes (using `agat_sp_fix_overlaping_genes.pl`), both available in [AGAT collection](https://github.com/NBISweden/AGAT). This might be different for genomes annotated with a different tool (mine was `braker2`).
  
  Anyway, once I was advised to use this tool, it took like 2 hours for 400Mbp genome including the uploading time, so I certainly recommend it over wrestling with AGP files.
  
  
  ---
  
  