<commit_before>class VariantTsvPresenter
  def self.objects
    Variant.joins(:evidence_items)
      .includes(:gene, :variant_groups, :variant_types)
      .uniq
  end

  def self.headers
    [
      'variant_id',
      'variant_civic_url',
      'gene',
      'entrez_id',
      'variant',
      'summary',
      'variant_groups',
      'chromosome',
      'start',
      'stop',
      'reference_bases',
      'variant_bases',
      'representative_transcript',
      'ensembl_version',
      'reference_build',
      'chromosome2',
      'start2',
      'stop2',
      'representative_transcript2',
      'variant_types'
    ]
  end

  def self.row_from_object(variant)
    [
      variant.id,
      LinkAdaptors::Variant.new(variant).path(include_domain: true),
      variant.gene.name,
      variant.gene.entrez_id,
      variant.name,
      variant.description.gsub("\n", ' '),
      variant.variant_groups.map(&:name).join(','),
      variant.chromosome,
      variant.start,
      variant.stop,
      variant.reference_bases,
      variant.variant_bases,
      variant.representative_transcript,
      variant.ensembl_version,
      variant.reference_build,
      variant.chromosome2,
      variant.start2,
      variant.stop2,
      variant.representative_transcript2,
      variant.variant_types.map(&:name).join(',')
    ]
  end

  def self.file_name
    'VariantSummaries.tsv'
  end
end<commit_msg>include hgvs expressions in future spreadsheets<commit_after>class VariantTsvPresenter
  def self.objects
    Variant.joins(:evidence_items)
      .includes(:gene, :variant_groups, :variant_types, :hgvs_expressions)
      .uniq
  end

  def self.headers
    [
      'variant_id',
      'variant_civic_url',
      'gene',
      'entrez_id',
      'variant',
      'summary',
      'variant_groups',
      'chromosome',
      'start',
      'stop',
      'reference_bases',
      'variant_bases',
      'representative_transcript',
      'ensembl_version',
      'reference_build',
      'chromosome2',
      'start2',
      'stop2',
      'representative_transcript2',
      'variant_types',
      'hgvs_expressions'
    ]
  end

  def self.row_from_object(variant)
    [
      variant.id,
      LinkAdaptors::Variant.new(variant).path(include_domain: true),
      variant.gene.name,
      variant.gene.entrez_id,
      variant.name,
      variant.description.gsub("\n", ' '),
      variant.variant_groups.map(&:name).join(','),
      variant.chromosome,
      variant.start,
      variant.stop,
      variant.reference_bases,
      variant.variant_bases,
      variant.representative_transcript,
      variant.ensembl_version,
      variant.reference_build,
      variant.chromosome2,
      variant.start2,
      variant.stop2,
      variant.representative_transcript2,
      variant.variant_types.map(&:name).join(','),
      variant.hgvs_expressions.map(&:expression).join(',')
    ]
  end

  def self.file_name
    'VariantSummaries.tsv'
  end
end
{'fraction_non_alphanumeric': 0.11955420466058764, 'fraction_numerical': 0.005403579871664978, 'mean_word_length': 2.6034063260340634, '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': '7377099', 'n_tokens_mistral': 1004, 'n_tokens_neox': 956, 'n_words': 131}