{% macro fasta_check_report(validation_results, file_name) -%}
{% set results_for_fasta = validation_results['fasta_check'][file_name] %}
{% if results_for_fasta.get('connection_error') %}
Warning: The following results may be incomplete due to problems with external services. Please try again later for
complete results.
Error message: {{ results_for_fasta.get('connection_error') }}
{% endif %}
{% set expand_icon = "" %}
{% if results_for_fasta.get('all_insdc') %}
{% set icon = "✔" %}
{% set row_class = "report-section pass" %}
{% set text = "All sequences are INSDC accessioned" %}
{% else %}
{% set expand_icon = "▶" %}
{% set icon = "❌" %}
{% set row_class = "report-section fail collapsible" %}
{% set text = "Some sequences are not INSDC accessioned" %}
{% endif %}
{{ expand_icon }} {{ icon }} {{ text }}
{% if not results_for_fasta.get('all_insdc') %}
First 10 sequences not in INSDC. Full report: {{ results_for_fasta.get('report_path', '') }}
Sequence name | Refget md5 |
{% set sequence_info_list = results_for_fasta.get('sequences', [])|rejectattr("insdc")|list %}
{% for sequence_info in sequence_info_list[:10] %}
{{sequence_info.get('sequence_name') }} | {{ sequence_info.get('sequence_md5') }} |
{% endfor %}
{% endif %}
{% if 'possible_assemblies' in results_for_fasta %}
{% if 'metadata_assembly_compatible' in results_for_fasta %}
{% set analysis_text = results_for_fasta.get('associated_analyses')|join(", ") %}
{% set expand_icon = "" %}
{% if results_for_fasta.get('metadata_assembly_compatible') %}
{% set icon = "✔" %}
{% set row_class = "report-section pass" %}
{% set text = analysis_text + ": Assembly accession in metadata is compatible" %}
{% else %}
{% set expand_icon = "▶" %}
{% set icon = "❌" %}
{% set row_class = "report-section fail collapsible" %}
{% set text = analysis_text + ": Assembly accession in metadata is not compatible" %}
{% endif %}
{% else %}
{% set expand_icon = "▶" %}
{% set icon = "❌" %}
{% set row_class = "report-section fail collapsible" %}
{% set text = "No assembly accession found in metadata" %}
{% endif %}
{{ expand_icon }} {{ icon }} {{ text }}
{% if 'metadata_assembly_compatible' not in results_for_fasta or not results_for_fasta['metadata_assembly_compatible'] %}
Full report: {{ results_for_fasta.get('report_path', '') }}
Category | Accessions |
Assembly accession found in metadata |
{{ results_for_fasta.get('assembly_in_metadata', 'Not found') }} |
Assembly accession(s) compatible with FASTA |
{{ results_for_fasta.get('possible_assemblies')|join(", ") }} |
{% endif %}
{% endif %}
{%- endmacro %}