<commit_before>Studies = new Meteor.Collection("studies");

// regex for study_label that must be alphanumeric
var alphaNumeric = /^[a-zA-Z0-9_]*$/;
SimpleSchema.messages({
  regEx: [
    { exp: alphaNumeric, msg: "Must be alphanumeric" }
  ]
});

var samplesSchema = {
  type: [String],
  optional: true
};

Studies.attachSchema(new SimpleSchema({
  collaborations: { type: [String], min: 1 },

  id: { // TODO: change to study_label
    type: String,
    regEx: alphaNumeric,
    label: "Study ID",
  },
  name: { type: String },
  // short_name: { type: String, max: 16 },
  description: { type: String, optional: true },

  tables: { type: [String] },

  // TODO: change to sample_labels
  Sample_IDs: { type: [String], defaultValue: [], optional: true },
  // TODO: remove (?)
  Patient_IDs: { type: [String], defaultValue: [], optional: true },
  patients: {
    type: [new SimpleSchema({
      patient_label: { type: String },
      sample_labels: { type: [String], optional: true, defaultValue: [] },
    })],
    optional: true,
  },

  gene_expression: { type: [String], optional: true },
  gene_expression_index: { type: Object, blackbox: true, optional: true },
  gene_expression_genes: { type: [String], optional: true },
<commit_msg>require short_name in Studies<commit_after>Studies = new Meteor.Collection("studies");

// regex for study_label that must be alphanumeric
var alphaNumeric = /^[a-zA-Z0-9_]*$/;
SimpleSchema.messages({
  regEx: [
    { exp: alphaNumeric, msg: "Must be alphanumeric" }
  ]
});

var samplesSchema = {
  type: [String],
  optional: true
};

Studies.attachSchema(new SimpleSchema({
  collaborations: { type: [String], min: 1 },

  id: { // TODO: change to study_label
    type: String,
    regEx: alphaNumeric,
    label: "Study ID",
  },
  name: { type: String },
  short_name: { type: String },
  description: { type: String, optional: true },

  tables: { type: [String] },

  // TODO: change to sample_labels
  Sample_IDs: { type: [String], defaultValue: [], optional: true },
  // TODO: remove (?)
  Patient_IDs: { type: [String], defaultValue: [], optional: true },
  patients: {
    type: [new SimpleSchema({
      patient_label: { type: String },
      sample_labels: { type: [String], optional: true, defaultValue: [] },
    })],
    optional: true,
  },

  gene_expression: { type: [String], optional: true },
  gene_expression_index: { type: Object, blackbox: true, optional: true },
  gene_expression_genes: { type: [String], optional: true },

{'fraction_non_alphanumeric': 0.1577261809447558, 'fraction_numerical': 0.0032025620496397116, 'mean_word_length': 3.724007561436673, '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': '281133', 'n_tokens_mistral': 827, 'n_tokens_neox': 802, 'n_words': 225}