bio-ucsc-api 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +4 -3
- data/Gemfile.lock +31 -20
- data/README.md +224 -0
- data/Rakefile +5 -8
- data/VERSION +1 -1
- data/bio-ucsc-api.gemspec +39 -122
- data/lib/bio-ucsc.rb +10 -5
- data/lib/bio-ucsc/ailmel1.rb +5 -3
- data/lib/bio-ucsc/anocar2.rb +7 -6
- data/lib/bio-ucsc/anogam1.rb +7 -5
- data/lib/bio-ucsc/anogam1/chaindm3.rb +11 -8
- data/lib/bio-ucsc/anogam1/chaindm3link.rb +11 -8
- data/lib/bio-ucsc/anogam1/est.rb +11 -8
- data/lib/bio-ucsc/anogam1/gap.rb +11 -8
- data/lib/bio-ucsc/anogam1/gold.rb +11 -8
- data/lib/bio-ucsc/anogam1/intronest.rb +11 -8
- data/lib/bio-ucsc/anogam1/mrna.rb +11 -8
- data/lib/bio-ucsc/anogam1/rmsk.rb +10 -7
- data/lib/bio-ucsc/apimel2.rb +5 -3
- data/lib/bio-ucsc/apimel2/chaindm2.rb +11 -8
- data/lib/bio-ucsc/apimel2/chaindm2link.rb +11 -8
- data/lib/bio-ucsc/aplcal1.rb +5 -3
- data/lib/bio-ucsc/aplcal1/chaincaepb1.rb +11 -8
- data/lib/bio-ucsc/aplcal1/chaincaepb1link.rb +11 -8
- data/lib/bio-ucsc/aplcal1/chaincaerem2.rb +11 -8
- data/lib/bio-ucsc/aplcal1/chaincaerem2link.rb +11 -8
- data/lib/bio-ucsc/aplcal1/chaincb3.rb +11 -8
- data/lib/bio-ucsc/aplcal1/chaincb3link.rb +11 -8
- data/lib/bio-ucsc/aplcal1/chaince6.rb +11 -8
- data/lib/bio-ucsc/aplcal1/chaince6link.rb +11 -8
- data/lib/bio-ucsc/aplcal1/gap.rb +11 -8
- data/lib/bio-ucsc/aplcal1/gold.rb +11 -8
- data/lib/bio-ucsc/aplcal1/rmsk.rb +10 -7
- data/lib/bio-ucsc/bostau4.rb +5 -3
- data/lib/bio-ucsc/braflo1.rb +5 -3
- data/lib/bio-ucsc/braflo1/chaingalgal3.rb +11 -8
- data/lib/bio-ucsc/braflo1/chaingalgal3link.rb +11 -8
- data/lib/bio-ucsc/braflo1/chainhg18.rb +11 -8
- data/lib/bio-ucsc/braflo1/chainhg18link.rb +11 -8
- data/lib/bio-ucsc/braflo1/chainmm9.rb +11 -8
- data/lib/bio-ucsc/braflo1/chainmm9link.rb +11 -8
- data/lib/bio-ucsc/braflo1/chainpetmar1.rb +11 -8
- data/lib/bio-ucsc/braflo1/chainpetmar1link.rb +11 -8
- data/lib/bio-ucsc/braflo1/gap.rb +11 -8
- data/lib/bio-ucsc/braflo1/gold.rb +11 -8
- data/lib/bio-ucsc/caejap1.rb +5 -3
- data/lib/bio-ucsc/caejap1/chaince6.rb +11 -8
- data/lib/bio-ucsc/caejap1/chaince6link.rb +11 -8
- data/lib/bio-ucsc/caejap1/gap.rb +11 -8
- data/lib/bio-ucsc/caejap1/gold.rb +11 -8
- data/lib/bio-ucsc/caepb2.rb +6 -4
- data/lib/bio-ucsc/caepb2/chaince6.rb +11 -8
- data/lib/bio-ucsc/caepb2/chaince6link.rb +11 -8
- data/lib/bio-ucsc/caepb2/gap.rb +11 -8
- data/lib/bio-ucsc/caepb2/gold.rb +11 -8
- data/lib/bio-ucsc/caerem3.rb +5 -3
- data/lib/bio-ucsc/caerem3/chaince6.rb +11 -8
- data/lib/bio-ucsc/caerem3/chaince6link.rb +11 -8
- data/lib/bio-ucsc/caerem3/gap.rb +11 -8
- data/lib/bio-ucsc/caerem3/gold.rb +11 -8
- data/lib/bio-ucsc/caljac3.rb +7 -4
- data/lib/bio-ucsc/canfam2.rb +5 -3
- data/lib/bio-ucsc/canfam2/chainbostau4.rb +11 -8
- data/lib/bio-ucsc/canfam2/chainbostau4link.rb +11 -8
- data/lib/bio-ucsc/canfam2/chainmm9.rb +11 -8
- data/lib/bio-ucsc/canfam2/chainmm9link.rb +11 -8
- data/lib/bio-ucsc/canfam2/chainrn4.rb +11 -8
- data/lib/bio-ucsc/canfam2/chainrn4link.rb +11 -8
- data/lib/bio-ucsc/canfam2/chainself.rb +11 -8
- data/lib/bio-ucsc/canfam2/chainselflink.rb +11 -8
- data/lib/bio-ucsc/canfam2/est.rb +11 -8
- data/lib/bio-ucsc/canfam2/gap.rb +11 -8
- data/lib/bio-ucsc/canfam2/gold.rb +11 -8
- data/lib/bio-ucsc/canfam2/intronest.rb +11 -8
- data/lib/bio-ucsc/canfam2/mrna.rb +11 -8
- data/lib/bio-ucsc/canfam2/rmsk.rb +10 -7
- data/lib/bio-ucsc/cavpor3.rb +6 -4
- data/lib/bio-ucsc/cb3.rb +5 -3
- data/lib/bio-ucsc/cb3/chaincaepb1.rb +11 -8
- data/lib/bio-ucsc/cb3/chaincaepb1link.rb +11 -8
- data/lib/bio-ucsc/cb3/chaincaerem2.rb +11 -8
- data/lib/bio-ucsc/cb3/chaincaerem2link.rb +11 -8
- data/lib/bio-ucsc/cb3/chaince6.rb +11 -8
- data/lib/bio-ucsc/cb3/chaince6link.rb +11 -8
- data/lib/bio-ucsc/cb3/chainpripac1.rb +11 -8
- data/lib/bio-ucsc/cb3/chainpripac1link.rb +11 -8
- data/lib/bio-ucsc/cb3/est.rb +11 -8
- data/lib/bio-ucsc/cb3/gap.rb +11 -8
- data/lib/bio-ucsc/cb3/gold.rb +11 -8
- data/lib/bio-ucsc/cb3/intronest.rb +11 -8
- data/lib/bio-ucsc/cb3/mrna.rb +11 -8
- data/lib/bio-ucsc/cb3/rmsk.rb +10 -7
- data/lib/bio-ucsc/ce6.rb +8 -4
- data/lib/bio-ucsc/ce6/chaincaejap1.rb +11 -8
- data/lib/bio-ucsc/ce6/chaincaejap1link.rb +11 -8
- data/lib/bio-ucsc/ce6/chaincaepb2.rb +11 -8
- data/lib/bio-ucsc/ce6/chaincaepb2link.rb +11 -8
- data/lib/bio-ucsc/ce6/chaincaerem3.rb +11 -8
- data/lib/bio-ucsc/ce6/chaincaerem3link.rb +11 -8
- data/lib/bio-ucsc/ce6/chaincb3.rb +11 -8
- data/lib/bio-ucsc/ce6/chaincb3link.rb +11 -8
- data/lib/bio-ucsc/ce6/chainpripac1.rb +11 -8
- data/lib/bio-ucsc/ce6/chainpripac1link.rb +11 -8
- data/lib/bio-ucsc/ce6/chainself.rb +11 -8
- data/lib/bio-ucsc/ce6/chainselflink.rb +11 -8
- data/lib/bio-ucsc/ce6/est.rb +11 -8
- data/lib/bio-ucsc/ce6/gap.rb +11 -8
- data/lib/bio-ucsc/ce6/gold.rb +11 -8
- data/lib/bio-ucsc/ce6/intronest.rb +11 -8
- data/lib/bio-ucsc/ce6/mrna.rb +11 -8
- data/lib/bio-ucsc/ce6/rmsk.rb +11 -8
- data/lib/bio-ucsc/ce6/t25mersrepeats.rb +7 -4
- data/lib/bio-ucsc/ci2.rb +6 -3
- data/lib/bio-ucsc/danrer7.rb +6 -3
- data/lib/bio-ucsc/{apimel2/db_connection.rb → db_connector.rb} +33 -23
- data/lib/bio-ucsc/dm3.rb +6 -4
- data/lib/bio-ucsc/dm3/chainanogam1.rb +11 -8
- data/lib/bio-ucsc/dm3/chainanogam1link.rb +11 -8
- data/lib/bio-ucsc/dm3/chainapimel3.rb +11 -8
- data/lib/bio-ucsc/dm3/chainapimel3link.rb +11 -8
- data/lib/bio-ucsc/dm3/chaindp3.rb +11 -8
- data/lib/bio-ucsc/dm3/chaindp3link.rb +11 -8
- data/lib/bio-ucsc/dm3/chaindroana2.rb +11 -8
- data/lib/bio-ucsc/dm3/chaindroana2link.rb +11 -8
- data/lib/bio-ucsc/dm3/chaindroere1.rb +11 -8
- data/lib/bio-ucsc/dm3/chaindroere1link.rb +11 -8
- data/lib/bio-ucsc/dm3/chaindroper1.rb +11 -8
- data/lib/bio-ucsc/dm3/chaindroper1link.rb +11 -8
- data/lib/bio-ucsc/dm3/chaindrosec1.rb +11 -8
- data/lib/bio-ucsc/dm3/chaindrosec1link.rb +11 -8
- data/lib/bio-ucsc/dm3/chaindrosim1.rb +11 -8
- data/lib/bio-ucsc/dm3/chaindrosim1link.rb +11 -8
- data/lib/bio-ucsc/dm3/chaindroyak2.rb +11 -8
- data/lib/bio-ucsc/dm3/chaindroyak2link.rb +11 -8
- data/lib/bio-ucsc/dm3/est.rb +11 -8
- data/lib/bio-ucsc/dm3/gap.rb +11 -8
- data/lib/bio-ucsc/dm3/gold.rb +11 -8
- data/lib/bio-ucsc/dm3/intronest.rb +11 -8
- data/lib/bio-ucsc/dm3/mrna.rb +11 -8
- data/lib/bio-ucsc/dm3/rmsk.rb +11 -8
- data/lib/bio-ucsc/dp3.rb +6 -4
- data/lib/bio-ucsc/dp3/chaindm3.rb +11 -8
- data/lib/bio-ucsc/dp3/chaindm3link.rb +11 -8
- data/lib/bio-ucsc/dp3/est.rb +11 -8
- data/lib/bio-ucsc/dp3/gap.rb +11 -8
- data/lib/bio-ucsc/dp3/gold.rb +11 -8
- data/lib/bio-ucsc/dp3/intronest.rb +11 -8
- data/lib/bio-ucsc/dp3/mrna.rb +11 -8
- data/lib/bio-ucsc/dp3/rmsk.rb +10 -7
- data/lib/bio-ucsc/droana2.rb +6 -4
- data/lib/bio-ucsc/droere1.rb +6 -4
- data/lib/bio-ucsc/drogri1.rb +6 -4
- data/lib/bio-ucsc/dromoj2.rb +7 -5
- data/lib/bio-ucsc/droper1.rb +7 -5
- data/lib/bio-ucsc/drosec1.rb +6 -4
- data/lib/bio-ucsc/drosim1.rb +6 -4
- data/lib/bio-ucsc/drosim1/chaindm3.rb +11 -8
- data/lib/bio-ucsc/drosim1/chaindm3link.rb +11 -8
- data/lib/bio-ucsc/drosim1/est.rb +11 -8
- data/lib/bio-ucsc/drosim1/gap.rb +11 -8
- data/lib/bio-ucsc/drosim1/gold.rb +11 -8
- data/lib/bio-ucsc/drosim1/intronest.rb +11 -8
- data/lib/bio-ucsc/drosim1/mrna.rb +11 -8
- data/lib/bio-ucsc/drosim1/rmsk.rb +10 -7
- data/lib/bio-ucsc/drovir2.rb +6 -4
- data/lib/bio-ucsc/droyak2.rb +6 -4
- data/lib/bio-ucsc/droyak2/chaindm3.rb +11 -8
- data/lib/bio-ucsc/droyak2/chaindm3link.rb +11 -8
- data/lib/bio-ucsc/droyak2/est.rb +11 -8
- data/lib/bio-ucsc/droyak2/gap.rb +11 -8
- data/lib/bio-ucsc/droyak2/gold.rb +11 -8
- data/lib/bio-ucsc/droyak2/intronest.rb +11 -8
- data/lib/bio-ucsc/droyak2/mrna.rb +11 -8
- data/lib/bio-ucsc/droyak2/rmsk.rb +10 -7
- data/lib/bio-ucsc/equcab2.rb +7 -4
- data/lib/bio-ucsc/equcab2/est.rb +11 -8
- data/lib/bio-ucsc/equcab2/gap.rb +11 -8
- data/lib/bio-ucsc/equcab2/gold.rb +11 -8
- data/lib/bio-ucsc/equcab2/intronest.rb +11 -8
- data/lib/bio-ucsc/equcab2/mrna.rb +11 -8
- data/lib/bio-ucsc/equcab2/rmsk.rb +10 -7
- data/lib/bio-ucsc/felcat4.rb +7 -4
- data/lib/bio-ucsc/file.rb +10 -0
- data/lib/bio-ucsc/file/bytequeue.rb +28 -0
- data/lib/bio-ucsc/file/twobit.rb +174 -0
- data/lib/bio-ucsc/fr2.rb +5 -3
- data/lib/bio-ucsc/fr2/chaingalgal3.rb +11 -8
- data/lib/bio-ucsc/fr2/chaingalgal3link.rb +11 -8
- data/lib/bio-ucsc/fr2/chaingasacu1.rb +11 -8
- data/lib/bio-ucsc/fr2/chaingasacu1link.rb +11 -8
- data/lib/bio-ucsc/fr2/chainmm9.rb +11 -8
- data/lib/bio-ucsc/fr2/chainmm9link.rb +11 -8
- data/lib/bio-ucsc/fr2/chainorylat2.rb +11 -8
- data/lib/bio-ucsc/fr2/chainorylat2link.rb +11 -8
- data/lib/bio-ucsc/fr2/est.rb +11 -8
- data/lib/bio-ucsc/fr2/gap.rb +11 -8
- data/lib/bio-ucsc/fr2/gold.rb +11 -8
- data/lib/bio-ucsc/fr2/intronest.rb +11 -8
- data/lib/bio-ucsc/fr2/mrna.rb +11 -8
- data/lib/bio-ucsc/fr2/rmsk.rb +10 -7
- data/lib/bio-ucsc/galgal3.rb +8 -5
- data/lib/bio-ucsc/galgal3/chainanocar1.rb +11 -8
- data/lib/bio-ucsc/galgal3/chainanocar1link.rb +11 -8
- data/lib/bio-ucsc/galgal3/chainbraflo1.rb +11 -8
- data/lib/bio-ucsc/galgal3/chainbraflo1link.rb +11 -8
- data/lib/bio-ucsc/galgal3/chaincavpor3.rb +11 -8
- data/lib/bio-ucsc/galgal3/chaincavpor3link.rb +11 -8
- data/lib/bio-ucsc/galgal3/chaindanrer4.rb +11 -8
- data/lib/bio-ucsc/galgal3/chaindanrer4link.rb +11 -8
- data/lib/bio-ucsc/galgal3/chainfr2.rb +11 -8
- data/lib/bio-ucsc/galgal3/chainfr2link.rb +11 -8
- data/lib/bio-ucsc/galgal3/chaingasacu1.rb +11 -8
- data/lib/bio-ucsc/galgal3/chaingasacu1link.rb +11 -8
- data/lib/bio-ucsc/galgal3/chainmm9.rb +11 -8
- data/lib/bio-ucsc/galgal3/chainmm9link.rb +11 -8
- data/lib/bio-ucsc/galgal3/chainornana1.rb +11 -8
- data/lib/bio-ucsc/galgal3/chainornana1link.rb +11 -8
- data/lib/bio-ucsc/galgal3/chainpetmar1.rb +11 -8
- data/lib/bio-ucsc/galgal3/chainpetmar1link.rb +11 -8
- data/lib/bio-ucsc/galgal3/chainrn4.rb +11 -8
- data/lib/bio-ucsc/galgal3/chainrn4link.rb +11 -8
- data/lib/bio-ucsc/galgal3/chaintaegut1.rb +11 -8
- data/lib/bio-ucsc/galgal3/chaintaegut1link.rb +11 -8
- data/lib/bio-ucsc/galgal3/chainxentro2.rb +11 -8
- data/lib/bio-ucsc/galgal3/chainxentro2link.rb +11 -8
- data/lib/bio-ucsc/galgal3/est.rb +11 -8
- data/lib/bio-ucsc/galgal3/gap.rb +11 -8
- data/lib/bio-ucsc/galgal3/gold.rb +11 -8
- data/lib/bio-ucsc/galgal3/intronest.rb +11 -8
- data/lib/bio-ucsc/galgal3/mrna.rb +11 -8
- data/lib/bio-ucsc/galgal3/rmsk.rb +10 -7
- data/lib/bio-ucsc/gasacu1.rb +6 -4
- data/lib/bio-ucsc/gasacu1/chainanocar1.rb +11 -8
- data/lib/bio-ucsc/gasacu1/chainanocar1link.rb +11 -8
- data/lib/bio-ucsc/gasacu1/chainfr2.rb +11 -8
- data/lib/bio-ucsc/gasacu1/chainfr2link.rb +11 -8
- data/lib/bio-ucsc/gasacu1/chaingalgal3.rb +11 -8
- data/lib/bio-ucsc/gasacu1/chaingalgal3link.rb +11 -8
- data/lib/bio-ucsc/gasacu1/chainmm9.rb +11 -8
- data/lib/bio-ucsc/gasacu1/chainmm9link.rb +11 -8
- data/lib/bio-ucsc/gasacu1/chainorylat2.rb +11 -8
- data/lib/bio-ucsc/gasacu1/chainorylat2link.rb +11 -8
- data/lib/bio-ucsc/gasacu1/est.rb +11 -8
- data/lib/bio-ucsc/gasacu1/intronest.rb +11 -8
- data/lib/bio-ucsc/gasacu1/mrna.rb +11 -8
- data/lib/bio-ucsc/gasacu1/rmsk.rb +10 -7
- data/lib/bio-ucsc/gi.rb +27 -0
- data/lib/bio-ucsc/go.rb +7 -4
- data/lib/bio-ucsc/hg18.rb +7 -4
- data/lib/bio-ucsc/hg18/chainanocar1.rb +11 -8
- data/lib/bio-ucsc/hg18/chainbostau4.rb +11 -8
- data/lib/bio-ucsc/hg18/chainbraflo1.rb +11 -8
- data/lib/bio-ucsc/hg18/chaincaljac1.rb +11 -8
- data/lib/bio-ucsc/hg18/chaincanfam2.rb +11 -8
- data/lib/bio-ucsc/hg18/chaincavpor3.rb +11 -8
- data/lib/bio-ucsc/hg18/chaindanrer5.rb +11 -8
- data/lib/bio-ucsc/hg18/chainequcab1.rb +11 -8
- data/lib/bio-ucsc/hg18/chainfelcat3.rb +11 -8
- data/lib/bio-ucsc/hg18/chainfr2.rb +12 -9
- data/lib/bio-ucsc/hg18/chaingalgal3.rb +11 -8
- data/lib/bio-ucsc/hg18/chaingasacu1.rb +11 -8
- data/lib/bio-ucsc/hg18/chainmm9.rb +11 -8
- data/lib/bio-ucsc/hg18/chainmondom4.rb +11 -8
- data/lib/bio-ucsc/hg18/chainornana1.rb +11 -8
- data/lib/bio-ucsc/hg18/chainorylat2.rb +11 -8
- data/lib/bio-ucsc/hg18/chainpantro2.rb +11 -8
- data/lib/bio-ucsc/hg18/chainpetmar1.rb +11 -8
- data/lib/bio-ucsc/hg18/chainponabe2.rb +11 -8
- data/lib/bio-ucsc/hg18/chainrhemac2.rb +11 -8
- data/lib/bio-ucsc/hg18/chainrn4.rb +11 -8
- data/lib/bio-ucsc/hg18/chainself.rb +11 -8
- data/lib/bio-ucsc/hg18/chainstrpur2.rb +11 -8
- data/lib/bio-ucsc/hg18/chaintaegut1.rb +11 -8
- data/lib/bio-ucsc/hg18/chaintetnig2.rb +11 -8
- data/lib/bio-ucsc/hg18/chainxentro2.rb +11 -8
- data/lib/bio-ucsc/hg18/gap.rb +11 -8
- data/lib/bio-ucsc/hg18/gold.rb +11 -8
- data/lib/bio-ucsc/hg18/intronest.rb +11 -8
- data/lib/bio-ucsc/hg18/rmsk.rb +10 -7
- data/lib/bio-ucsc/hg18/rmskrm327.rb +10 -7
- data/lib/bio-ucsc/hg19.rb +7 -6
- data/lib/bio-ucsc/hg19/description.rb +1 -1
- data/lib/bio-ucsc/hg19/gbcdnainfo.rb +2 -2
- data/lib/bio-ucsc/hgfixed.rb +7 -4
- data/lib/bio-ucsc/loxafr3.rb +7 -4
- data/lib/bio-ucsc/mm9.rb +7 -12
- data/lib/bio-ucsc/mm9/chainbraflo1.rb +11 -8
- data/lib/bio-ucsc/mm9/chainbraflo1link.rb +11 -8
- data/lib/bio-ucsc/mm9/chaincanfam2.rb +11 -8
- data/lib/bio-ucsc/mm9/chaincanfam2link.rb +11 -8
- data/lib/bio-ucsc/mm9/chaincavpor3.rb +11 -8
- data/lib/bio-ucsc/mm9/chaincavpor3link.rb +11 -8
- data/lib/bio-ucsc/mm9/chainfr2.rb +11 -8
- data/lib/bio-ucsc/mm9/chainfr2link.rb +11 -8
- data/lib/bio-ucsc/mm9/chaingalgal3.rb +11 -8
- data/lib/bio-ucsc/mm9/chaingalgal3link.rb +11 -8
- data/lib/bio-ucsc/mm9/chaingasacu1.rb +11 -8
- data/lib/bio-ucsc/mm9/chaingasacu1link.rb +11 -8
- data/lib/bio-ucsc/mm9/chainornana1.rb +11 -8
- data/lib/bio-ucsc/mm9/chainornana1link.rb +11 -8
- data/lib/bio-ucsc/mm9/chainorylat2.rb +11 -8
- data/lib/bio-ucsc/mm9/chainorylat2link.rb +11 -8
- data/lib/bio-ucsc/mm9/chainpetmar1.rb +11 -8
- data/lib/bio-ucsc/mm9/chainpetmar1link.rb +11 -8
- data/lib/bio-ucsc/mm9/chainponabe2.rb +11 -8
- data/lib/bio-ucsc/mm9/chainponabe2link.rb +11 -8
- data/lib/bio-ucsc/mm9/chainrhemac2.rb +11 -8
- data/lib/bio-ucsc/mm9/chainrhemac2link.rb +11 -8
- data/lib/bio-ucsc/mm9/chainrn4.rb +11 -8
- data/lib/bio-ucsc/mm9/chainrn4link.rb +11 -8
- data/lib/bio-ucsc/mm9/est.rb +11 -8
- data/lib/bio-ucsc/mm9/gap.rb +11 -8
- data/lib/bio-ucsc/mm9/gold.rb +11 -8
- data/lib/bio-ucsc/mm9/intronest.rb +11 -8
- data/lib/bio-ucsc/mm9/mrna.rb +11 -8
- data/lib/bio-ucsc/mm9/rmsk.rb +10 -7
- data/lib/bio-ucsc/mondom5.rb +7 -4
- data/lib/bio-ucsc/ornana1.rb +6 -3
- data/lib/bio-ucsc/orycun2.rb +5 -3
- data/lib/bio-ucsc/orylat2.rb +7 -5
- data/lib/bio-ucsc/oviari1.rb +6 -4
- data/lib/bio-ucsc/pantro3.rb +7 -5
- data/lib/bio-ucsc/petmar1.rb +6 -5
- data/lib/bio-ucsc/ponabe2.rb +6 -4
- data/lib/bio-ucsc/ponabe2/chainmm9.rb +11 -8
- data/lib/bio-ucsc/ponabe2/chainmm9link.rb +11 -8
- data/lib/bio-ucsc/ponabe2/chainornana1.rb +11 -8
- data/lib/bio-ucsc/ponabe2/chainornana1link.rb +11 -8
- data/lib/bio-ucsc/ponabe2/chainrhemac2.rb +11 -8
- data/lib/bio-ucsc/ponabe2/chainrhemac2link.rb +11 -8
- data/lib/bio-ucsc/ponabe2/est.rb +11 -8
- data/lib/bio-ucsc/ponabe2/gap.rb +11 -8
- data/lib/bio-ucsc/ponabe2/gold.rb +11 -8
- data/lib/bio-ucsc/ponabe2/intronest.rb +11 -8
- data/lib/bio-ucsc/ponabe2/mrna.rb +11 -8
- data/lib/bio-ucsc/ponabe2/rmsk.rb +10 -7
- data/lib/bio-ucsc/pripac1.rb +7 -5
- data/lib/bio-ucsc/pripac1/chaincaepb1.rb +11 -8
- data/lib/bio-ucsc/pripac1/chaincaepb1link.rb +11 -8
- data/lib/bio-ucsc/pripac1/chaincaerem2.rb +11 -8
- data/lib/bio-ucsc/pripac1/chaincaerem2link.rb +11 -8
- data/lib/bio-ucsc/pripac1/chaincb3.rb +11 -8
- data/lib/bio-ucsc/pripac1/chaincb3link.rb +11 -8
- data/lib/bio-ucsc/pripac1/chaince6.rb +11 -8
- data/lib/bio-ucsc/pripac1/chaince6link.rb +11 -8
- data/lib/bio-ucsc/pripac1/gap.rb +11 -8
- data/lib/bio-ucsc/pripac1/gold.rb +11 -8
- data/lib/bio-ucsc/pripac1/rmsk.rb +10 -7
- data/lib/bio-ucsc/proteome.rb +7 -4
- data/lib/bio-ucsc/reference.rb +5 -160
- data/lib/bio-ucsc/rhemac2.rb +5 -5
- data/lib/bio-ucsc/rhemac2/chainmm9.rb +11 -8
- data/lib/bio-ucsc/rhemac2/chainmm9link.rb +11 -8
- data/lib/bio-ucsc/rhemac2/chainponabe2.rb +11 -8
- data/lib/bio-ucsc/rhemac2/chainponabe2link.rb +11 -8
- data/lib/bio-ucsc/rhemac2/chainrn4.rb +11 -8
- data/lib/bio-ucsc/rhemac2/chainrn4link.rb +11 -8
- data/lib/bio-ucsc/rn4.rb +6 -8
- data/lib/bio-ucsc/rn4/chaincanfam2.rb +11 -8
- data/lib/bio-ucsc/rn4/chaincanfam2link.rb +11 -8
- data/lib/bio-ucsc/rn4/chaincavpor3.rb +11 -8
- data/lib/bio-ucsc/rn4/chaincavpor3link.rb +11 -8
- data/lib/bio-ucsc/rn4/chaindanrer4.rb +11 -8
- data/lib/bio-ucsc/rn4/chaindanrer4link.rb +11 -8
- data/lib/bio-ucsc/rn4/chainequcab1.rb +11 -8
- data/lib/bio-ucsc/rn4/chainequcab1link.rb +11 -8
- data/lib/bio-ucsc/rn4/chaingalgal3.rb +11 -8
- data/lib/bio-ucsc/rn4/chaingalgal3link.rb +11 -8
- data/lib/bio-ucsc/rn4/chainmm9.rb +11 -8
- data/lib/bio-ucsc/rn4/chainmm9link.rb +11 -8
- data/lib/bio-ucsc/rn4/chainmondom4.rb +11 -8
- data/lib/bio-ucsc/rn4/chainmondom4link.rb +11 -8
- data/lib/bio-ucsc/rn4/chainpantro2.rb +11 -8
- data/lib/bio-ucsc/rn4/chainpantro2link.rb +11 -8
- data/lib/bio-ucsc/rn4/chainrhemac2.rb +11 -8
- data/lib/bio-ucsc/rn4/chainrhemac2link.rb +11 -8
- data/lib/bio-ucsc/rn4/est.rb +11 -8
- data/lib/bio-ucsc/rn4/gap.rb +11 -8
- data/lib/bio-ucsc/rn4/gold.rb +11 -8
- data/lib/bio-ucsc/rn4/intronest.rb +11 -8
- data/lib/bio-ucsc/rn4/mrna.rb +11 -8
- data/lib/bio-ucsc/rn4/rmsk.rb +10 -7
- data/lib/bio-ucsc/saccer2.rb +6 -4
- data/lib/bio-ucsc/saccer2/est.rb +11 -8
- data/lib/bio-ucsc/saccer2/gap.rb +11 -8
- data/lib/bio-ucsc/saccer2/gold.rb +11 -8
- data/lib/bio-ucsc/saccer2/intronest.rb +11 -8
- data/lib/bio-ucsc/saccer2/mrna.rb +11 -8
- data/lib/bio-ucsc/saccer2/t2micron_est.rb +4 -4
- data/lib/bio-ucsc/saccer2/t2micron_gap.rb +4 -4
- data/lib/bio-ucsc/saccer2/t2micron_gold.rb +4 -4
- data/lib/bio-ucsc/saccer2/t2micron_intronEst.rb +4 -4
- data/lib/bio-ucsc/saccer2/t2micron_mrna.rb +4 -4
- data/lib/bio-ucsc/strpur2.rb +7 -15
- data/lib/bio-ucsc/susscr2.rb +6 -4
- data/lib/bio-ucsc/susscr2/est.rb +11 -8
- data/lib/bio-ucsc/susscr2/intronest.rb +11 -8
- data/lib/bio-ucsc/susscr2/mrna.rb +11 -8
- data/lib/bio-ucsc/table_class_detector.rb +250 -475
- data/lib/bio-ucsc/taegut1.rb +6 -4
- data/lib/bio-ucsc/taegut1/chaingalgal3.rb +14 -13
- data/lib/bio-ucsc/taegut1/chaingalgal3link.rb +13 -10
- data/lib/bio-ucsc/taegut1/est.rb +13 -10
- data/lib/bio-ucsc/taegut1/gap.rb +13 -10
- data/lib/bio-ucsc/taegut1/gold.rb +13 -10
- data/lib/bio-ucsc/taegut1/intronest.rb +13 -10
- data/lib/bio-ucsc/taegut1/mrna.rb +13 -10
- data/lib/bio-ucsc/taegut1/rmsk.rb +12 -9
- data/lib/bio-ucsc/tetnig2.rb +6 -4
- data/lib/bio-ucsc/tetnig2/mrna.rb +11 -8
- data/lib/bio-ucsc/uniprot.rb +7 -4
- data/lib/bio-ucsc/visigene.rb +6 -3
- data/lib/bio-ucsc/xentro2.rb +6 -12
- data/samples/num-gene-exon.rb +1 -2
- data/samples/snp2genes.rb +1 -7
- data/samples/symbol2summary.rb +7 -1
- data/spec/ailmel1_spec.rb +245 -245
- data/spec/aplcal1_spec.rb +0 -30
- data/spec/braflo1_spec.rb +1 -1
- data/spec/canfam2_spec.rb +6 -6
- data/spec/danrer7_spec.rb +6 -6
- data/spec/file/twobit.rb +167 -0
- data/spec/galgal3_spec.rb +12 -12
- data/spec/gasacu1_spec.rb +6 -6
- data/spec/hg18/find_by_spec.rb +14 -20
- data/spec/hg19/all_mrna_spec.rb +0 -8
- data/spec/hg19/altseqliftoverpsl_spec.rb +0 -8
- data/spec/hg19/altseqpatches_spec.rb +0 -8
- data/spec/hg19/{chainanocar1_spec.rb → chainanocar2_spec.rb} +2 -2
- data/spec/hg19/{chainbostau4_spec.rb → chainbostau6_spec.rb} +2 -2
- data/spec/hg19/{chainxentro2_spec.rb → chainxentro3_spec.rb} +2 -2
- data/spec/hg19/connect_spec.rb +20 -0
- data/spec/hg19/find_by_spec.rb +14 -14
- data/spec/hg19/gwascatalog_spec.rb +0 -7
- data/spec/hg19/hgikmcextra_spec.rb +2 -1
- data/spec/hg19/mrnaorinetinfo_spec.rb +0 -8
- data/spec/hg19/{netanocar1_spec.rb → netanocar2_spec.rb} +2 -2
- data/spec/hg19/{netbostau4_spec.rb → netbostau6_spec.rb} +2 -2
- data/spec/hg19/{netxentro2_spec.rb → netxentro3_spec.rb} +2 -2
- data/spec/hg19/sibtxgraph_spec.rb +0 -8
- data/spec/hg19/snp132_spec.rb +9 -0
- data/spec/hg19/xenorefflat_spec.rb +0 -8
- data/spec/hg19/xenorefgene_spec.rb +0 -8
- data/spec/hg19/xenorefseqali_spec.rb +0 -8
- data/spec/mm9_spec.rb +32 -32
- data/spec/ornana1_spec.rb +12 -12
- data/spec/{named_scope_spec.rb → relation_objects_spec.rb} +14 -0
- data/spec/rhemac2_spec.rb +16 -6
- data/spec/rn4_spec.rb +12 -12
- data/spec/spec_helper.rb +3 -1
- data/spec/susscr2_spec.rb +6 -6
- data/spec/taegut1_spec.rb +8 -8
- data/spec/xentro2_spec.rb +6 -6
- metadata +63 -138
- data/README.rdoc +0 -202
- data/lib/bio-ucsc/ailmel1/db_connection.rb +0 -57
- data/lib/bio-ucsc/anocar2/db_connection.rb +0 -57
- data/lib/bio-ucsc/anogam1/db_connection.rb +0 -57
- data/lib/bio-ucsc/aplcal1/db_connection.rb +0 -57
- data/lib/bio-ucsc/bostau4/db_connection.rb +0 -57
- data/lib/bio-ucsc/braflo1/db_connection.rb +0 -57
- data/lib/bio-ucsc/caejap1/db_connection.rb +0 -57
- data/lib/bio-ucsc/caepb2/db_connection.rb +0 -57
- data/lib/bio-ucsc/caerem3/db_connection.rb +0 -57
- data/lib/bio-ucsc/caljac3/db_connection.rb +0 -55
- data/lib/bio-ucsc/canfam2/db_connection.rb +0 -57
- data/lib/bio-ucsc/cavpor3/db_connection.rb +0 -57
- data/lib/bio-ucsc/cb3/db_connection.rb +0 -57
- data/lib/bio-ucsc/ce6/db_connection.rb +0 -55
- data/lib/bio-ucsc/ci2/db_connection.rb +0 -55
- data/lib/bio-ucsc/danrer7/db_connection.rb +0 -57
- data/lib/bio-ucsc/dm3/db_connection.rb +0 -55
- data/lib/bio-ucsc/dp3/db_connection.rb +0 -57
- data/lib/bio-ucsc/droana2/db_connection.rb +0 -57
- data/lib/bio-ucsc/droere1/db_connection.rb +0 -57
- data/lib/bio-ucsc/drogri1/db_connection.rb +0 -57
- data/lib/bio-ucsc/dromoj2/db_connection.rb +0 -57
- data/lib/bio-ucsc/droper1/db_connection.rb +0 -57
- data/lib/bio-ucsc/drosec1/db_connection.rb +0 -57
- data/lib/bio-ucsc/drosim1/db_connection.rb +0 -57
- data/lib/bio-ucsc/drovir2/db_connection.rb +0 -57
- data/lib/bio-ucsc/droyak2/db_connection.rb +0 -57
- data/lib/bio-ucsc/equcab2/db_connection.rb +0 -57
- data/lib/bio-ucsc/felcat4/db_connection.rb +0 -57
- data/lib/bio-ucsc/fr2/db_connection.rb +0 -57
- data/lib/bio-ucsc/galgal3/db_connection.rb +0 -57
- data/lib/bio-ucsc/gasacu1/db_connection.rb +0 -57
- data/lib/bio-ucsc/go/db_connection.rb +0 -55
- data/lib/bio-ucsc/hg18/db_connection.rb +0 -59
- data/lib/bio-ucsc/hg19/db_connection.rb +0 -61
- data/lib/bio-ucsc/hgfixed/db_connection.rb +0 -55
- data/lib/bio-ucsc/loxafr3/db_connection.rb +0 -57
- data/lib/bio-ucsc/mm9/chainanocar1.rb +0 -79
- data/lib/bio-ucsc/mm9/chainanocar1link.rb +0 -79
- data/lib/bio-ucsc/mm9/chainbostau4.rb +0 -79
- data/lib/bio-ucsc/mm9/chainbostau4link.rb +0 -79
- data/lib/bio-ucsc/mm9/chainpantro2.rb +0 -81
- data/lib/bio-ucsc/mm9/chainpantro2link.rb +0 -82
- data/lib/bio-ucsc/mm9/chainxentro2.rb +0 -81
- data/lib/bio-ucsc/mm9/chainxentro2link.rb +0 -81
- data/lib/bio-ucsc/mm9/db_connection.rb +0 -55
- data/lib/bio-ucsc/mondom5/db_connection.rb +0 -57
- data/lib/bio-ucsc/ornana1/db_connection.rb +0 -57
- data/lib/bio-ucsc/orycun2/db_connection.rb +0 -57
- data/lib/bio-ucsc/orylat2/db_connection.rb +0 -55
- data/lib/bio-ucsc/oviari1/db_connection.rb +0 -57
- data/lib/bio-ucsc/pantro3/db_connection.rb +0 -55
- data/lib/bio-ucsc/petmar1/db_connection.rb +0 -57
- data/lib/bio-ucsc/ponabe2/db_connection.rb +0 -55
- data/lib/bio-ucsc/pripac1/db_connection.rb +0 -57
- data/lib/bio-ucsc/proteome/db_connection.rb +0 -59
- data/lib/bio-ucsc/rhemac2/chainpantro2.rb +0 -81
- data/lib/bio-ucsc/rhemac2/chainpantro2link.rb +0 -81
- data/lib/bio-ucsc/rhemac2/db_connection.rb +0 -55
- data/lib/bio-ucsc/rn4/chainbostau3.rb +0 -79
- data/lib/bio-ucsc/rn4/chainbostau3link.rb +0 -79
- data/lib/bio-ucsc/rn4/chainxentro2.rb +0 -81
- data/lib/bio-ucsc/rn4/chainxentro2link.rb +0 -81
- data/lib/bio-ucsc/rn4/db_connection.rb +0 -55
- data/lib/bio-ucsc/saccer2/db_connection.rb +0 -55
- data/lib/bio-ucsc/strpur2/chaingalgal3.rb +0 -81
- data/lib/bio-ucsc/strpur2/chaingalgal3link.rb +0 -81
- data/lib/bio-ucsc/strpur2/chainhg18.rb +0 -81
- data/lib/bio-ucsc/strpur2/chainhg18link.rb +0 -81
- data/lib/bio-ucsc/strpur2/chainmm9.rb +0 -81
- data/lib/bio-ucsc/strpur2/chainmm9link.rb +0 -81
- data/lib/bio-ucsc/strpur2/chainpetmar1.rb +0 -81
- data/lib/bio-ucsc/strpur2/chainpetmar1link.rb +0 -81
- data/lib/bio-ucsc/strpur2/db_connection.rb +0 -57
- data/lib/bio-ucsc/strpur2/gap.rb +0 -81
- data/lib/bio-ucsc/strpur2/gold.rb +0 -81
- data/lib/bio-ucsc/susscr2/db_connection.rb +0 -57
- data/lib/bio-ucsc/taegut1/db_connection.rb +0 -57
- data/lib/bio-ucsc/tetnig2/db_connection.rb +0 -57
- data/lib/bio-ucsc/uniprot/db_connection.rb +0 -59
- data/lib/bio-ucsc/visigene/db_connection.rb +0 -55
- data/lib/bio-ucsc/xentro2/chaingalgal3.rb +0 -81
- data/lib/bio-ucsc/xentro2/chaingalgal3link.rb +0 -81
- data/lib/bio-ucsc/xentro2/db_connection.rb +0 -57
- data/lib/bio-ucsc/xentro2/est.rb +0 -81
- data/lib/bio-ucsc/xentro2/gap.rb +0 -81
- data/lib/bio-ucsc/xentro2/gold.rb +0 -81
- data/lib/bio-ucsc/xentro2/intronest.rb +0 -81
- data/lib/bio-ucsc/xentro2/mrna.rb +0 -81
- data/lib/bio-ucsc/xentro2/rmsk.rb +0 -78
- data/spec/hg19/chainaplcal1_spec.rb +0 -16
- data/spec/hg19/netaplcal1_spec.rb +0 -16
@@ -12,25 +12,28 @@ module Bio
|
|
12
12
|
module SusScr2
|
13
13
|
|
14
14
|
class Mrna
|
15
|
+
include DBConnector
|
16
|
+
DBConnection.database "susScr2"
|
17
|
+
|
15
18
|
KLASS = "Mrna"
|
16
19
|
KLASS_S = "mrna"
|
17
20
|
|
18
21
|
Bio::Ucsc::SusScr2::CHROMS.each do |chr|
|
19
22
|
class_eval %!
|
20
23
|
class #{chr[0..0].upcase + chr[1..-1]}_#{KLASS} < DBConnection
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
+
self.table_name = "#{chr[0..0].downcase + chr[1..-1]}_#{KLASS_S}"
|
25
|
+
self.primary_key = nil
|
26
|
+
self.inheritance_column = nil
|
24
27
|
|
25
|
-
def self.find_by_interval(interval, opt = {:partial => true})
|
28
|
+
def self.find_by_interval(interval, opt = {:partial => true}); interval = Bio::Ucsc::Gi.wrap(interval)
|
26
29
|
find_first_or_all_by_interval(interval, :first, opt)
|
27
30
|
end
|
28
31
|
|
29
|
-
def self.find_all_by_interval(interval, opt = {:partial => true})
|
32
|
+
def self.find_all_by_interval(interval, opt = {:partial => true}); interval = Bio::Ucsc::Gi.wrap(interval)
|
30
33
|
find_first_or_all_by_interval(interval, :all, opt)
|
31
34
|
end
|
32
35
|
|
33
|
-
def self.find_first_or_all_by_interval(interval, first_all, opt)
|
36
|
+
def self.find_first_or_all_by_interval(interval, first_all, opt); interval = Bio::Ucsc::Gi.wrap(interval)
|
34
37
|
zstart = interval.zero_start
|
35
38
|
zend = interval.zero_end
|
36
39
|
if opt[:partial] == true
|
@@ -63,13 +66,13 @@ AND (tEnd BETWEEN :zstart AND :zend))
|
|
63
66
|
!
|
64
67
|
end # each chromosome
|
65
68
|
|
66
|
-
def self.find_by_interval(interval, opt = {:partial => true})
|
69
|
+
def self.find_by_interval(interval, opt = {:partial => true}); interval = Bio::Ucsc::Gi.wrap(interval)
|
67
70
|
chrom = interval.chrom[0..0].upcase + interval.chrom[1..-1]
|
68
71
|
chr_klass = self.const_get("#{chrom}_#{KLASS}")
|
69
72
|
chr_klass.__send__(:find_by_interval, interval, opt)
|
70
73
|
end
|
71
74
|
|
72
|
-
def self.find_all_by_interval(interval, opt = {:partial => true})
|
75
|
+
def self.find_all_by_interval(interval, opt = {:partial => true}); interval = Bio::Ucsc::Gi.wrap(interval)
|
73
76
|
chrom = interval.chrom[0..0].upcase + interval.chrom[1..-1]
|
74
77
|
chr_klass = self.const_get("#{chrom}_#{KLASS}")
|
75
78
|
chr_klass.__send__(:find_all_by_interval, interval, opt)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
#
|
2
2
|
# = table_class_detector.rb
|
3
3
|
#
|
4
|
-
# Copyright:: Copyright (C) 2011
|
4
|
+
# Copyright:: Copyright (C) 2011, 2012
|
5
5
|
# MISHIMA, Hiroyuki
|
6
6
|
# <missy at be.to / hmishima at nagasaki-u.ac.jp>
|
7
7
|
# License:: The Ruby licence (Ryby's / GPLv2 dual)
|
@@ -24,13 +24,21 @@ module Bio
|
|
24
24
|
['HInv', 'NIAGene']
|
25
25
|
COMMON_CLASS_METHODS = %!
|
26
26
|
def self.find_by_interval(interval, opt = {:partial => true})
|
27
|
+
interval = Bio::Ucsc::Gi.wrap(interval)
|
27
28
|
find_first_or_all_by_interval(interval, :first, opt)
|
28
29
|
end
|
29
30
|
|
30
31
|
def self.find_all_by_interval(interval, opt = {:partial => true})
|
32
|
+
interval = Bio::Ucsc::Gi.wrap(interval)
|
31
33
|
find_first_or_all_by_interval(interval, :all, opt)
|
32
34
|
end
|
33
35
|
!
|
36
|
+
PARAMETERS = %!
|
37
|
+
{ :chrom => interval.chrom,
|
38
|
+
:bins => interval.bin_all,
|
39
|
+
:zstart => interval.zero_start,
|
40
|
+
:zend => interval.zero_end, }
|
41
|
+
!
|
34
42
|
|
35
43
|
def const_missing(sym)
|
36
44
|
module_eval generic(sym)
|
@@ -39,35 +47,26 @@ module Bio
|
|
39
47
|
case
|
40
48
|
when (["bin", "tName", "tStart", "tEnd"] - col_names).empty?
|
41
49
|
module_eval psl(sym, :bin => true)
|
42
|
-
const_get(sym)
|
43
50
|
when (["bin", "tName", "tStart", "tEnd"] - col_names) == ["bin"]
|
44
51
|
module_eval psl(sym, :bin => false)
|
45
|
-
const_get(sym)
|
46
52
|
|
47
53
|
when (["bin", "chrom", "chromStart", "chromEnd"] - col_names).empty?
|
48
54
|
module_eval bed(sym, :bin => true)
|
49
|
-
const_get(sym)
|
50
55
|
when (["bin", "chrom", "chromStart", "chromEnd"] - col_names) == ["bin"]
|
51
56
|
module_eval bed(sym, :bin => false)
|
52
|
-
const_get(sym)
|
53
57
|
|
54
58
|
when (["bin", "chrom", "txStart", "txEnd"] - col_names).empty?
|
55
59
|
module_eval genepred(sym, :bin => true)
|
56
|
-
const_get(sym)
|
57
60
|
when (["bin", "chrom", "txStart", "txEnd"] - col_names) == ["bin"]
|
58
61
|
module_eval genepred(sym, :bin => false)
|
59
|
-
const_get(sym)
|
60
62
|
|
61
63
|
when (["bin", "genoName", "genoStart", "genoEnd"] - col_names).empty?
|
62
64
|
module_eval rmsk(sym, :bin => true)
|
63
|
-
const_get(sym)
|
64
65
|
when (["bin", "genoName", "genoStart", "genoEnd"] - col_names) == ["bin"]
|
65
66
|
module_eval rmsk(sym, :bin => false)
|
66
|
-
const_get(sym)
|
67
|
-
|
68
|
-
else
|
69
|
-
const_get(sym)
|
70
67
|
end
|
68
|
+
|
69
|
+
const_get(sym)
|
71
70
|
end
|
72
71
|
|
73
72
|
# generic: tables without interval serarch supported
|
@@ -75,7 +74,7 @@ module Bio
|
|
75
74
|
def generic(sym)
|
76
75
|
%!
|
77
76
|
class #{uphead(sym)} < DBConnection
|
78
|
-
|
77
|
+
self.table_name = "#{downhead(sym)}"
|
79
78
|
#{delete_reserved_methods}
|
80
79
|
end
|
81
80
|
!
|
@@ -84,511 +83,287 @@ module Bio
|
|
84
83
|
# PSL: Pattern Space Layout
|
85
84
|
# interval search using tName/tStart/tEnd
|
86
85
|
def psl(sym, opts={:bin => true})
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
AND (
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
86
|
+
if opts[:bin]
|
87
|
+
chrom_bin = "tName = :chrom AND bin in (:bins) "
|
88
|
+
else
|
89
|
+
chrom_bin = "tName = :chrom "
|
90
|
+
end
|
91
|
+
|
92
|
+
%!
|
93
|
+
class #{uphead(sym)} < DBConnection
|
94
|
+
self.table_name = "#{downhead(sym)}"
|
95
|
+
#{delete_reserved_methods}
|
96
|
+
#{COMMON_CLASS_METHODS}
|
97
|
+
|
98
|
+
def self.with_interval(interval)
|
99
|
+
interval = Bio::Ucsc::Gi.wrap(interval)
|
100
|
+
where(
|
101
|
+
"#{chrom_bin}" +
|
102
|
+
"AND ( " +
|
103
|
+
"(tStart BETWEEN :zstart AND :zend) " +
|
104
|
+
"OR (tEnd BETWEEN :zstart AND :zend) " +
|
105
|
+
"OR (tStart <= :zstart AND tEnd >= :zend) )",
|
106
|
+
#{PARAMETERS})
|
107
|
+
end
|
108
|
+
|
109
|
+
def self.with_interval_excl(interval)
|
110
|
+
interval = Bio::Ucsc::Gi.wrap(interval)
|
111
|
+
where(
|
112
|
+
"#{chrom_bin}" +
|
113
|
+
"AND ( " +
|
114
|
+
"(tStart BETWEEN :zstart AND :zend)" +
|
115
|
+
"AND (tEnd BETWEEN :zstart AND :zend) )",
|
116
|
+
#{PARAMETERS})
|
117
|
+
end
|
118
|
+
|
119
|
+
def self.find_first_or_all_by_interval(interval, first_all, opt)
|
120
|
+
interval = Bio::Ucsc::Gi.wrap(interval)
|
121
|
+
zstart = interval.zero_start
|
122
|
+
zend = interval.zero_end
|
123
|
+
|
124
|
+
if opt[:partial] == true
|
125
|
+
where =
|
126
|
+
"#{chrom_bin}" +
|
127
|
+
"AND ( " +
|
128
|
+
"(tStart BETWEEN :zstart AND :zend) " +
|
129
|
+
"OR (tEnd BETWEEN :zstart AND :zend) " +
|
130
|
+
"OR (tStart <= :zstart AND tEnd >= :zend) )"
|
131
|
+
else
|
132
|
+
where =
|
133
|
+
"#{chrom_bin}" +
|
134
|
+
"AND ( " +
|
135
|
+
"(tStart BETWEEN :zstart AND :zend) " +
|
136
|
+
"AND (tEnd BETWEEN :zstart AND :zend) )"
|
137
|
+
end
|
138
|
+
cond = {
|
140
139
|
:chrom => interval.chrom,
|
141
140
|
:bins => Ucsc::UcscBin.bin_all(zstart, zend),
|
142
141
|
:zstart => zstart,
|
143
|
-
:zend => zend,
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
:conditions => [where, cond], })
|
148
|
-
end
|
142
|
+
:zend => zend,}
|
143
|
+
self.find(first_all,
|
144
|
+
{ :select => "*",
|
145
|
+
:conditions => [where, cond], })
|
149
146
|
end
|
150
|
-
|
151
|
-
|
152
|
-
%!
|
153
|
-
class #{uphead(sym)} < DBConnection
|
154
|
-
set_table_name "#{downhead(sym)}"
|
155
|
-
#{delete_reserved_methods}
|
156
|
-
#{COMMON_CLASS_METHODS}
|
157
|
-
|
158
|
-
where = <<-SQL
|
159
|
-
tName = :chrom
|
160
|
-
AND ((tStart BETWEEN :zstart AND :zend)
|
161
|
-
OR (tEnd BETWEEN :zstart AND :zend)
|
162
|
-
OR (tStart <= :zstart AND tEnd >= :zend))
|
163
|
-
SQL
|
164
|
-
scope(:with_interval,
|
165
|
-
Proc.new{|gi|{:conditions => [where, {:chrom => gi.chrom,
|
166
|
-
:zstart => gi.zero_start,
|
167
|
-
:zend => gi.zero_end,}]}})
|
168
|
-
where = <<-SQL
|
169
|
-
tName = :chrom
|
170
|
-
AND ((tStart BETWEEN :zstart AND :zend)
|
171
|
-
AND (tEnd BETWEEN :zstart AND :zend))
|
172
|
-
SQL
|
173
|
-
scope(:with_interval_excl,
|
174
|
-
Proc.new{|gi|{:conditions => [where,{:chrom => gi.chrom,
|
175
|
-
:zstart => gi.zero_start,
|
176
|
-
:zend => gi.zero_end,}]}})
|
177
|
-
|
178
|
-
def self.find_first_or_all_by_interval(interval, first_all, opt)
|
179
|
-
zstart = interval.zero_start
|
180
|
-
zend = interval.zero_end
|
181
|
-
if opt[:partial] == true
|
182
|
-
where = <<-SQL
|
183
|
-
tName = :chrom
|
184
|
-
AND ((tStart BETWEEN :zstart AND :zend)
|
185
|
-
OR (tEnd BETWEEN :zstart AND :zend)
|
186
|
-
OR (tStart <= :zstart AND tEnd >= :zend))
|
187
|
-
SQL
|
188
|
-
else
|
189
|
-
where = <<-SQL
|
190
|
-
tName = :chrom
|
191
|
-
AND ((tStart BETWEEN :zstart AND :zend)
|
192
|
-
AND (tEnd BETWEEN :zstart AND :zend))
|
193
|
-
SQL
|
194
|
-
end
|
195
|
-
cond = {
|
196
|
-
:chrom => interval.chrom,
|
197
|
-
:zstart => zstart,
|
198
|
-
:zend => zend,
|
199
|
-
}
|
200
|
-
self.find(first_all,
|
201
|
-
{ :select => "*",
|
202
|
-
:conditions => [where, cond], })
|
203
|
-
end
|
204
|
-
end
|
205
|
-
!
|
206
|
-
end # case opts[:bin]
|
147
|
+
end
|
148
|
+
!
|
207
149
|
end # def psl
|
208
150
|
|
209
151
|
# BED: Browser Extensible Description format
|
210
152
|
# interval search using chrom/chromStart/chromEnd
|
211
153
|
def bed(sym, opts={:bin => true})
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
154
|
+
if opts[:bin]
|
155
|
+
chrom_bin = "chrom = :chrom AND bin in (:bins) "
|
156
|
+
else
|
157
|
+
chrom_bin = "chrom = :chrom "
|
158
|
+
end
|
159
|
+
|
160
|
+
%!
|
161
|
+
class #{uphead(sym)} < DBConnection
|
162
|
+
self.table_name = "#{downhead(sym)}"
|
163
|
+
#{delete_reserved_methods}
|
164
|
+
#{COMMON_CLASS_METHODS}
|
219
165
|
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
AND (chromEnd BETWEEN :zstart AND :zend))
|
262
|
-
SQL
|
263
|
-
end
|
264
|
-
cond = {
|
166
|
+
def self.with_interval(interval)
|
167
|
+
interval = Bio::Ucsc::Gi.wrap(interval)
|
168
|
+
where(
|
169
|
+
"#{chrom_bin}" +
|
170
|
+
"AND ( " +
|
171
|
+
"(chromStart BETWEEN :zstart AND :zend)" +
|
172
|
+
"OR (chromEnd BETWEEN :zstart AND :zend)" +
|
173
|
+
"OR (chromStart <= :zstart AND chromEnd >= :zend) )",
|
174
|
+
#{PARAMETERS})
|
175
|
+
end
|
176
|
+
|
177
|
+
def self.with_interval_excl(interval)
|
178
|
+
interval = Bio::Ucsc::Gi.wrap(interval)
|
179
|
+
where(
|
180
|
+
"#{chrom_bin}" +
|
181
|
+
"AND ( " +
|
182
|
+
"(chromStart BETWEEN :zstart AND :zend) " +
|
183
|
+
"AND (chromEnd BETWEEN :zstart AND :zend) )",
|
184
|
+
#{PARAMETERS})
|
185
|
+
end
|
186
|
+
|
187
|
+
def self.find_first_or_all_by_interval(interval, first_all, opt); interval = Bio::Ucsc::Gi.wrap(interval)
|
188
|
+
interval = Bio::Ucsc::Gi.wrap(interval)
|
189
|
+
zstart = interval.zero_start
|
190
|
+
zend = interval.zero_end
|
191
|
+
|
192
|
+
if opt[:partial] == true
|
193
|
+
where =
|
194
|
+
"#{chrom_bin}" +
|
195
|
+
"AND ( " +
|
196
|
+
"(chromStart BETWEEN :zstart AND :zend) " +
|
197
|
+
"OR (chromEnd BETWEEN :zstart AND :zend) " +
|
198
|
+
"OR (chromStart <= :zstart AND chromEnd >= :zend) )"
|
199
|
+
else
|
200
|
+
where =
|
201
|
+
"#{chrom_bin}" +
|
202
|
+
"AND ( " +
|
203
|
+
"(chromStart BETWEEN :zstart AND :zend)" +
|
204
|
+
"AND (chromEnd BETWEEN :zstart AND :zend))"
|
205
|
+
end
|
206
|
+
cond = {
|
265
207
|
:chrom => interval.chrom,
|
266
208
|
:bins => Ucsc::UcscBin.bin_all(zstart, zend),
|
267
209
|
:zstart => zstart,
|
268
|
-
:zend => zend,
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
:conditions => [where, cond], })
|
273
|
-
end
|
274
|
-
end
|
275
|
-
!
|
276
|
-
when false
|
277
|
-
%!
|
278
|
-
class #{uphead(sym)} < DBConnection
|
279
|
-
set_table_name "#{downhead(sym)}"
|
280
|
-
#{delete_reserved_methods}
|
281
|
-
#{COMMON_CLASS_METHODS}
|
282
|
-
|
283
|
-
where = <<-SQL
|
284
|
-
chrom = :chrom
|
285
|
-
AND ((chromStart BETWEEN :zstart AND :zend)
|
286
|
-
OR (chromEnd BETWEEN :zstart AND :zend)
|
287
|
-
OR (chromStart <= :zstart AND chromEnd >= :zend))
|
288
|
-
SQL
|
289
|
-
scope(:with_interval,
|
290
|
-
Proc.new{|gi|{:conditions => [where, {:chrom => gi.chrom,
|
291
|
-
:zstart => gi.zero_start,
|
292
|
-
:zend => gi.zero_end,}]}})
|
293
|
-
where = <<-SQL
|
294
|
-
chrom = :chrom
|
295
|
-
AND ((chromStart BETWEEN :zstart AND :zend)
|
296
|
-
AND (chromEnd BETWEEN :zstart AND :zend))
|
297
|
-
SQL
|
298
|
-
scope(:with_interval_excl,
|
299
|
-
Proc.new{|gi|{:conditions => [where,{:chrom => gi.chrom,
|
300
|
-
:zstart => gi.zero_start,
|
301
|
-
:zend => gi.zero_end,}]}})
|
302
|
-
|
303
|
-
def self.find_first_or_all_by_interval(interval, first_all, opt)
|
304
|
-
zstart = interval.zero_start
|
305
|
-
zend = interval.zero_end
|
306
|
-
if opt[:partial] == true
|
307
|
-
where = <<-SQL
|
308
|
-
chrom = :chrom
|
309
|
-
AND ((chromStart BETWEEN :zstart AND :zend)
|
310
|
-
OR (chromEnd BETWEEN :zstart AND :zend)
|
311
|
-
OR (chromStart <= :zstart AND chromEnd >= :zend))
|
312
|
-
SQL
|
313
|
-
else
|
314
|
-
where = <<-SQL
|
315
|
-
chrom = :chrom
|
316
|
-
AND ((chromStart BETWEEN :zstart AND :zend)
|
317
|
-
AND (chromEnd BETWEEN :zstart AND :zend))
|
318
|
-
SQL
|
319
|
-
end
|
320
|
-
cond = {
|
321
|
-
:chrom => interval.chrom,
|
322
|
-
:zstart => zstart,
|
323
|
-
:zend => zend,
|
324
|
-
}
|
325
|
-
self.find(first_all,
|
326
|
-
{ :select => "*",
|
327
|
-
:conditions => [where, cond], })
|
328
|
-
end
|
210
|
+
:zend => zend, }
|
211
|
+
self.find(first_all,
|
212
|
+
{ :select => "*",
|
213
|
+
:conditions => [where, cond], })
|
329
214
|
end
|
330
|
-
|
331
|
-
|
215
|
+
end
|
216
|
+
!
|
332
217
|
end # def bed
|
333
218
|
|
334
219
|
# genePred: Gene and gene-prediction features
|
335
220
|
# interval search using chrom/txStart/txEnd
|
336
221
|
def genepred(sym, opts={:bin => true})
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
AND (
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
where =
|
383
|
-
|
384
|
-
AND
|
385
|
-
|
386
|
-
AND
|
387
|
-
|
388
|
-
|
389
|
-
cond = {
|
222
|
+
if opts[:bin]
|
223
|
+
chrom_bin = "chrom = :chrom AND bin in (:bins) "
|
224
|
+
else
|
225
|
+
chrom_bin = "chrom = :chrom "
|
226
|
+
end
|
227
|
+
|
228
|
+
%!
|
229
|
+
class #{uphead(sym)} < DBConnection
|
230
|
+
self.table_name = "#{downhead(sym)}"
|
231
|
+
#{delete_reserved_methods}
|
232
|
+
#{COMMON_CLASS_METHODS}
|
233
|
+
|
234
|
+
def self.with_interval(interval)
|
235
|
+
interval = Bio::Ucsc::Gi.wrap(interval)
|
236
|
+
where(
|
237
|
+
"#{chrom_bin}" +
|
238
|
+
"AND ( " +
|
239
|
+
"(txStart BETWEEN :zstart AND :zend) " +
|
240
|
+
"OR (txEnd BETWEEN :zstart AND :zend) " +
|
241
|
+
"OR (txStart <= :zstart AND txEnd >= :zend) )",
|
242
|
+
#{PARAMETERS})
|
243
|
+
end
|
244
|
+
|
245
|
+
def self.with_interval_excl(interval)
|
246
|
+
interval = Bio::Ucsc::Gi.wrap(interval)
|
247
|
+
where(
|
248
|
+
"#{chrom_bin}" +
|
249
|
+
"AND ( " +
|
250
|
+
"(txStart BETWEEN :zstart AND :zend) " +
|
251
|
+
"AND (txEnd BETWEEN :zstart AND :zend) )",
|
252
|
+
#{PARAMETERS})
|
253
|
+
end
|
254
|
+
|
255
|
+
def self.find_first_or_all_by_interval(interval, first_all, opt); interval = Bio::Ucsc::Gi.wrap(interval)
|
256
|
+
interval = Bio::Ucsc::Gi.wrap(interval)
|
257
|
+
zstart = interval.zero_start
|
258
|
+
zend = interval.zero_end
|
259
|
+
if opt[:partial] == true
|
260
|
+
where =
|
261
|
+
"#{chrom_bin}" +
|
262
|
+
"AND ( " +
|
263
|
+
"(txStart BETWEEN :zstart AND :zend)" +
|
264
|
+
"OR (txEnd BETWEEN :zstart AND :zend)" +
|
265
|
+
"OR (txStart <= :zstart AND txEnd >= :zend))"
|
266
|
+
else
|
267
|
+
where =
|
268
|
+
"#{chrom_bin}" +
|
269
|
+
"AND ( " +
|
270
|
+
"(txStart BETWEEN :zstart AND :zend)" +
|
271
|
+
"AND (txEnd BETWEEN :zstart AND :zend) )"
|
272
|
+
end
|
273
|
+
cond = {
|
390
274
|
:chrom => interval.chrom,
|
391
275
|
:bins => Bio::Ucsc::UcscBin.bin_all(zstart, zend),
|
392
276
|
:zstart => zstart,
|
393
277
|
:zend => zend,
|
394
278
|
}
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
end
|
279
|
+
self.find(first_all,
|
280
|
+
{ :select => "*",
|
281
|
+
:conditions => [where, cond], })
|
399
282
|
end
|
400
|
-
|
401
|
-
|
402
|
-
%!
|
403
|
-
class #{uphead(sym)} < DBConnection
|
404
|
-
set_table_name "#{downhead(sym)}"
|
405
|
-
#{delete_reserved_methods}
|
406
|
-
#{COMMON_CLASS_METHODS}
|
407
|
-
|
408
|
-
where = <<-SQL
|
409
|
-
chrom = :chrom
|
410
|
-
AND ((txStart BETWEEN :zstart AND :zend)
|
411
|
-
OR (txEnd BETWEEN :zstart AND :zend)
|
412
|
-
OR (txStart <= :zstart AND txEnd >= :zend))
|
413
|
-
SQL
|
414
|
-
scope(:with_interval,
|
415
|
-
Proc.new{|gi|{:conditions => [where, {:chrom => gi.chrom,
|
416
|
-
:zstart => gi.zero_start,
|
417
|
-
:zend => gi.zero_end}]}})
|
418
|
-
where = <<-SQL
|
419
|
-
chrom = :chrom
|
420
|
-
AND ((txStart BETWEEN :zstart AND :zend)
|
421
|
-
AND (txEnd BETWEEN :zstart AND :zend))
|
422
|
-
SQL
|
423
|
-
scope(:with_interval_excl,
|
424
|
-
Proc.new{|gi|{:conditions => [where, {:chrom => gi.chrom,
|
425
|
-
:zstart => gi.zero_start,
|
426
|
-
:zend => gi.zero_end}]}})
|
427
|
-
|
428
|
-
def self.find_first_or_all_by_interval(interval, first_all, opt)
|
429
|
-
zstart = interval.zero_start
|
430
|
-
zend = interval.zero_end
|
431
|
-
if opt[:partial] == true
|
432
|
-
where = <<-SQL
|
433
|
-
chrom = :chrom
|
434
|
-
AND ((txStart BETWEEN :zstart AND :zend)
|
435
|
-
OR (txEnd BETWEEN :zstart AND :zend)
|
436
|
-
OR (txStart <= :zstart AND txEnd >= :zend))
|
437
|
-
SQL
|
438
|
-
else
|
439
|
-
where = <<-SQL
|
440
|
-
chrom = :chrom
|
441
|
-
AND ((txStart BETWEEN :zstart AND :zend)
|
442
|
-
AND (txEnd BETWEEN :zstart AND :zend))
|
443
|
-
SQL
|
444
|
-
end
|
445
|
-
cond = {
|
446
|
-
:chrom => interval.chrom,
|
447
|
-
:zstart => zstart,
|
448
|
-
:zend => zend,
|
449
|
-
}
|
450
|
-
self.find(first_all,
|
451
|
-
{ :select => "*",
|
452
|
-
:conditions => [where, cond], })-u
|
453
|
-
end
|
454
|
-
end
|
455
|
-
!
|
456
|
-
end # case opts[:bin]
|
283
|
+
end
|
284
|
+
!
|
457
285
|
end # def genepred
|
458
286
|
|
459
287
|
# rmsk: Repeatmasker .out file
|
460
288
|
# interval search using genoName/genoStart/genoEnd
|
461
289
|
def rmsk(sym, opts={:bin => true})
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
290
|
+
if opts[:bin]
|
291
|
+
chrom_bin = "genoName = :chrom AND bin in (:bins) "
|
292
|
+
else
|
293
|
+
chrom_bin = "genoName = :chrom "
|
294
|
+
end
|
295
|
+
|
296
|
+
%!
|
297
|
+
class #{uphead(sym)} < DBConnection
|
298
|
+
self.table_name = "#{downhead(sym)}"
|
299
|
+
#{delete_reserved_methods}
|
300
|
+
#{COMMON_CLASS_METHODS}
|
469
301
|
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
AND (
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
AND (genoEnd BETWEEN :zstart AND :zend))
|
511
|
-
SQL
|
512
|
-
end
|
513
|
-
cond = {
|
302
|
+
def self.with_interval(interval)
|
303
|
+
interval = Bio::Ucsc::Gi.wrap(interval)
|
304
|
+
where(
|
305
|
+
"#{chrom_bin}" +
|
306
|
+
"AND ( " +
|
307
|
+
"(genoStart BETWEEN :zstart AND :zend)" +
|
308
|
+
"OR (genoEnd BETWEEN :zstart AND :zend)" +
|
309
|
+
"OR (genoStart <= :zstart AND genoEnd >= :zend) )",
|
310
|
+
#{PARAMETERS})
|
311
|
+
end
|
312
|
+
|
313
|
+
def self.with_interval_excl(interval)
|
314
|
+
interval = Bio::Ucsc::Gi.wrap(interval)
|
315
|
+
where(
|
316
|
+
"#{chrom_bin}" +
|
317
|
+
"AND ( " +
|
318
|
+
"(genoStart BETWEEN :zstart AND :zend)" +
|
319
|
+
"AND (genoEnd BETWEEN :zstart AND :zend) )",
|
320
|
+
#{PARAMETERS})
|
321
|
+
end
|
322
|
+
|
323
|
+
def self.find_first_or_all_by_interval(interval, first_all, opt); interval = Bio::Ucsc::Gi.wrap(interval)
|
324
|
+
interval = Bio::Ucsc::Gi.wrap(interval)
|
325
|
+
zstart = interval.zero_start
|
326
|
+
zend = interval.zero_end
|
327
|
+
if opt[:partial] == true
|
328
|
+
where =
|
329
|
+
"#{chrom_bin}" +
|
330
|
+
"AND ( " +
|
331
|
+
"(genoStart BETWEEN :zstart AND :zend) " +
|
332
|
+
"OR (genoEnd BETWEEN :zstart AND :zend) " +
|
333
|
+
"OR (genoStart <= :zstart AND genoEnd >= :zend) )"
|
334
|
+
else
|
335
|
+
where =
|
336
|
+
"#{chrom_bin}" +
|
337
|
+
"AND ( " +
|
338
|
+
"(genoStart BETWEEN :zstart AND :zend) " +
|
339
|
+
"AND (genoEnd BETWEEN :zstart AND :zend) )"
|
340
|
+
end
|
341
|
+
cond = {
|
514
342
|
:chrom => interval.chrom,
|
515
343
|
:bins => Bio::Ucsc::UcscBin.bin_all(zstart, zend),
|
516
344
|
:zstart => zstart,
|
517
345
|
:zend => zend,
|
518
346
|
}
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
end
|
523
|
-
end
|
524
|
-
!
|
525
|
-
when false
|
526
|
-
%!
|
527
|
-
class #{uphead(sym)} < DBConnection
|
528
|
-
set_table_name "#{downhead(sym)}"
|
529
|
-
#{delete_reserved_methods}
|
530
|
-
#{COMMON_CLASS_METHODS}
|
531
|
-
|
532
|
-
where = <<-SQL
|
533
|
-
genoName = :chrom
|
534
|
-
AND ((genoStart BETWEEN :zstart AND :zend)
|
535
|
-
OR (genoEnd BETWEEN :zstart AND :zend)
|
536
|
-
OR (genoStart <= :zstart AND genoEnd >= :zend))
|
537
|
-
SQL
|
538
|
-
scope(:with_interval,
|
539
|
-
Proc.new{|gi|{:conditions => [where, {:chrom => gi.chrom,
|
540
|
-
:bins => gi.bin_all,
|
541
|
-
:zstart => gi.zero_start,
|
542
|
-
:zend => gi.zero_end,}]}})
|
543
|
-
where = <<-SQL
|
544
|
-
genoName = :chrom
|
545
|
-
AND ((genoStart BETWEEN :zstart AND :zend)
|
546
|
-
AND (genoEnd BETWEEN :zstart AND :zend))
|
547
|
-
SQL
|
548
|
-
scope(:with_interval_excl,
|
549
|
-
Proc.new{|gi|{:conditions => [where,{:chrom => gi.chrom,
|
550
|
-
:zstart => gi.zero_start,
|
551
|
-
:zend => gi.zero_end,}]}})
|
552
|
-
|
553
|
-
def self.find_first_or_all_by_interval(interval, first_all, opt)
|
554
|
-
zstart = interval.zero_start
|
555
|
-
zend = interval.zero_end
|
556
|
-
if opt[:partial] == true
|
557
|
-
where = <<-SQL
|
558
|
-
genoName = :chrom
|
559
|
-
AND ((genoStart BETWEEN :zstart AND :zend)
|
560
|
-
OR (genoEnd BETWEEN :zstart AND :zend)
|
561
|
-
OR (genoStart <= :zstart AND genoEnd >= :zend))
|
562
|
-
SQL
|
563
|
-
else
|
564
|
-
where = <<-SQL
|
565
|
-
genoName = :chrom
|
566
|
-
AND ((genoStart BETWEEN :zstart AND :zend)
|
567
|
-
AND (genoEnd BETWEEN :zstart AND :zend))
|
568
|
-
SQL
|
569
|
-
end
|
570
|
-
cond = {
|
571
|
-
:chrom => interval.chrom,
|
572
|
-
:zstart => zstart,
|
573
|
-
:zend => zend,
|
574
|
-
}
|
575
|
-
self.find(first_all,
|
576
|
-
{ :select => "*",
|
577
|
-
:conditions => [where, cond], })
|
578
|
-
end
|
347
|
+
self.find(first_all,
|
348
|
+
{ :select => "*",
|
349
|
+
:conditions => [where, cond], })
|
579
350
|
end
|
580
|
-
|
581
|
-
|
351
|
+
end
|
352
|
+
!
|
582
353
|
end # def rmsk
|
583
354
|
|
584
355
|
private
|
585
356
|
|
357
|
+
#
|
358
|
+
# This hack works only for ActiveRecord version <=3.0
|
359
|
+
#
|
586
360
|
def delete_reserved_methods
|
587
361
|
codes = Array.new
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
362
|
+
unless ActiveRecord::VERSION::MAJOR == 3 && ActiveRecord::VERSION::MINOR > 0
|
363
|
+
codes << "include SafeAttributes"
|
364
|
+
RESERVED_METHODS.each do |reserved|
|
365
|
+
codes << "bad_attribute_names :#{reserved}"
|
366
|
+
end
|
592
367
|
end
|
593
368
|
codes.join("\n")
|
594
369
|
end
|