<commit_before>COPY (
SELECT
    json_build_object(
        'upi', rna.upi,
        'taxid', xref.taxid,
        'first_seen', array_agg(release1.timestamp),
        'last_seen', array_agg(release2.timestamp),
        'cross_references', array_agg(
            json_build_object(
                'name', acc."database",
                'external_id', acc.external_id,
                'optional_id', acc.optional_id,
                'accession', acc.accession,
                'non_coding_id', acc.non_coding_id,
                'parent_accession', acc.parent_ac || '.' || acc.seq_version
                )
            ),
        'description', array_agg(pre.description),
        'deleted', array_agg(xref.deleted),
        'length', array_agg(rna.len),
        'species', array_agg(acc.species),
        'organelles', array_agg(acc.organelle),
        'expert_dbs', array_agg(db.display_name),
        'rna_type', array_agg(pre.rna_type),
        'product', array_agg(acc.product),
        'md5', array_agg(rna.md5),
        'authors', array_agg(refs.authors),
        'journals', array_agg(refs.location),
        'pub_titles', array_agg(refs.title),
        'pub_ids', array_agg(refs.id),
        'pubmed_ids', array_agg(pubmed.ref_pubmed_id::varchar) || array_agg(refs.pmid),
        'dois', array_agg(pubmed.doi) || array_agg(refs.doi),
        'has_coordinates', array_agg(pre.has_coordinates),
        'rfam_family_names', array_agg(models.short_name),
        'rfam_ids', array_agg(hits.rfam_model_id),
        'rfam_clans', array_agg(models.rfam_clan_id),
        'qa_status', json_build_object(
            'has_issue', bool_or(qa.has_issue),
            'possible_contamination', bool_or(qa.possible_contamination),
            'incomplete_sequence', bool_or(qa.incomplete_sequence),
            'missing_rfam_match', bool_or(qa.missing_rfam_match),
        )),
        'tax_strings', array_agg(acc.classification),
        'functions', array_agg(acc.function),
        'genes', array_agg(acc.gene),
        'gene_synonyms', array_agg(acc.gene_synonym),
        'common_name', array_agg(acc.common_name),
        'notes', array_agg(acc.note),
        'locus_tags', array_agg(acc.locus_tag),
        'standard_names', array_agg(acc.standard_name),
        'products', array_agg(acc.product),
        'go_annotations', array_agg(<commit_msg>Fix QA status part of the query<commit_after>COPY (
SELECT
    json_build_object(
        'upi', rna.upi,
        'taxid', xref.taxid,
        'first_seen', array_agg(release1.timestamp),
        'last_seen', array_agg(release2.timestamp),
        'cross_references', array_agg(
            json_build_object(
                'name', acc."database",
                'external_id', acc.external_id,
                'optional_id', acc.optional_id,
                'accession', acc.accession,
                'non_coding_id', acc.non_coding_id,
                'parent_accession', acc.parent_ac || '.' || acc.seq_version
                )
            ),
        'description', array_agg(pre.description),
        'deleted', array_agg(xref.deleted),
        'length', array_agg(rna.len),
        'species', array_agg(acc.species),
        'organelles', array_agg(acc.organelle),
        'expert_dbs', array_agg(db.display_name),
        'rna_type', array_agg(pre.rna_type),
        'product', array_agg(acc.product),
        'md5', array_agg(rna.md5),
        'authors', array_agg(refs.authors),
        'journals', array_agg(refs.location),
        'pub_titles', array_agg(refs.title),
        'pub_ids', array_agg(refs.id),
        'pubmed_ids', array_agg(pubmed.ref_pubmed_id::varchar) || array_agg(refs.pmid),
        'dois', array_agg(pubmed.doi) || array_agg(refs.doi),
        'has_coordinates', array_agg(pre.has_coordinates),
        'rfam_family_names', array_agg(models.short_name),
        'rfam_ids', array_agg(hits.rfam_model_id),
        'rfam_clans', array_agg(models.rfam_clan_id),
        'qa_status', json_build_object(
            'has_issue', bool_or(qa.has_issue),
            'possible_contamination', bool_or(qa.possible_contamination),
            'incomplete_sequence', bool_or(qa.incomplete_sequence),
            'missing_rfam_match', bool_or(qa.missing_rfam_match),
        ),
        'tax_strings', array_agg(acc.classification),
        'functions', array_agg(acc.function),
        'genes', array_agg(acc.gene),
        'gene_synonyms', array_agg(acc.gene_synonym),
        'common_name', array_agg(acc.common_name),
        'notes', array_agg(acc.note),
        'locus_tags', array_agg(acc.locus_tag),
        'standard_names', array_agg(acc.standard_name),
        'products', array_agg(acc.product),
        'go_annotations', array_agg(
{'fraction_non_alphanumeric': 0.13673945304218782, 'fraction_numerical': 0.0016959932160271359, 'mean_word_length': 2.7414750198255353, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5260180', 'n_tokens_mistral': 1601, 'n_tokens_neox': 1556, 'n_words': 199}