I want to store some genomic positions using MongoDB.
something like:
{
chrom:"chr2",
position:100,
name:"rs25"
}
I want to be able to quickly find all the records in a given segment. What would be the best key/_id to be used ?
a chrom , position object ?
db.snps.save({_id:{chrom:"chr2",position:100},name:"rs25"})
a padded string ?
db.snps.save({_id:"chr02:00000000100",chrom:"chr2",position:100,name:"rs25"})
an auto-generated id with an index on chrom and position ?
db.snps.save({chrom:"chr2",position:100,name:"rs25"})
other ?
???
thanks for your suggestion(s)
Pierre
PS: I cross-posted this question on stackoverflow http://stackoverflow.com/questions/3740112
I posted a benchmark on my blog