Last active
November 21, 2015 01:49
-
-
Save mokolodi1/31f9d6fa97add802ff0b to your computer and use it in GitHub Desktop.
a working schema for GeneExpression
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GeneExpression = new Meteor.Collection("gene_expression"); | |
Expression2 = new Meteor.Collection("expression2"); | |
var normalValue = { | |
type: Number, | |
decimal: true, | |
optional: true, | |
}; | |
GeneExpression.attachSchema(new SimpleSchema({ | |
study_label: { type: String, optional: true }, | |
collaborations: { type: [String] }, | |
gene_label: { type: String }, | |
sample_label: { type: String }, | |
baseline_progression: { | |
type: String, | |
allowedValues: [ | |
"baseline", | |
"progression", | |
], | |
}, | |
values: { | |
type: new SimpleSchema({ | |
quantile_counts: _.extend({ | |
label: "Quantile normalized counts", | |
}, normalValue), | |
quantile_counts_log: _.extend({ | |
label: "Quantile normalized counts log2", | |
min: 0, | |
max: 100, | |
autoValue: function () { | |
var quantileCounts = this.siblingField('quantile_counts'); | |
if (quantileCounts.isSet) { | |
return Math.log(quantileCounts.value + 1) / Math.LN2; | |
} else { | |
this.unset(); | |
} | |
} | |
}, normalValue), | |
raw_counts: _.extend({ | |
label: "Raw counts", | |
}, normalValue), | |
tpm: _.extend({ | |
label: "TPM (Transcripts Per Million)", | |
}, normalValue), | |
fpkm: _.extend({ | |
label: "RPKM (Reads Per Kilobase of transcript per Million mapped reads)", | |
}, normalValue), | |
}), | |
optional: true, // simply because collection2 can't do upserts | |
} | |
})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment