Permalink
Browse files

Updated the RDoc with detailed instructions on filtering.

  • Loading branch information...
1 parent aa7c099 commit 1659e7de960166d33c2ca726d587ee93a6aac76f Daz Oakley committed Feb 16, 2011
Showing with 38 additions and 2 deletions.
  1. +5 −2 History.txt
  2. +33 −0 README.rdoc
View
7 History.txt
@@ -1,7 +1,10 @@
-=== 0.2.1 2011-02-XX
+=== 0.2.1 2011-02-16
* 1 minor bugfix:
- * Force retrieved ASCII_8BIT text encoding to UTF-8 when running in Ruby 1.9+
+ * Force retrieved ASCII_8BIT text encoding to UTF-8 when running in
+ Ruby 1.9+.
+* 1 minor enhancement:
+ * Added support for boolean filters.
=== 0.2.0 2010-06-10
View
33 README.rdoc
@@ -80,6 +80,39 @@ just get on with things...
See Biomart module and Class docs for more detail.
+== Advanced Filtering
+
+Most filters in biomart are just pure textual filters, i.e.
+
+ kermits.search( :filters => { "marker_symbol" => "Cbx1" } )
+
+To filter on more than one term, simply pass a comma concatenated string,
+or an array (the following two searches are equivalent):
+
+ kermits.search( :filters => { "marker_symbol" => "Cbx1,Mysm1" } )
+ kermits.search( :filters => { "marker_symbol" => ["Cbx1","Mysm1"] } )
+
+Finally, there are also boolean filters (shown in the standard MartView
+interface as a filter name and then two radio buttons: 'Only' or
+'Excluded'). These filers can only accept the following:
+
+- 'Only': true / 'only' / 'included'
+- 'Excluded': false / 'excluded'
+
+Here's some example usage:
+
+ snp_mart = Biomart::Dataset.new( "http://www.ensembl.org/biomart", { :name => "hsapiens_snp" } )
+
+ # These are equivalent to selecting 'Only' in MartView
+ snp_mart.search( :filters => { 'with_variation_annotation' => true, 'ensembl_gene' => 'ENSG00000244734' } )
+ snp_mart.search( :filters => { 'with_variation_annotation' => 'only', 'ensembl_gene' => 'ENSG00000244734' } )
+ snp_mart.search( :filters => { 'with_variation_annotation' => 'included', 'ensembl_gene' => 'ENSG00000244734' } )
+
+ # These are equivalent to selecting 'Excluded' in MartView
+ snp_mart.search( :filters => { 'with_variation_annotation' => false, 'ensembl_gene' => 'ENSG00000244734' } )
+ snp_mart.search( :filters => { 'with_variation_annotation' => 'excluded', 'ensembl_gene' => 'ENSG00000244734' } )
+
+
== Federated Searches
To perform a federated search across two datasets...

0 comments on commit 1659e7d

Please sign in to comment.