Skip to content
This repository
Browse code

Updated the RDoc with detailed instructions on filtering.

  • Loading branch information...
commit 1659e7de960166d33c2ca726d587ee93a6aac76f 1 parent aa7c099
Daz Oakley authored

Showing 2 changed files with 38 additions and 2 deletions. Show diff stats Hide diff stats

  1. +5 2 History.txt
  2. +33 0 README.rdoc
7 History.txt
... ... @@ -1,7 +1,10 @@
1   -=== 0.2.1 2011-02-XX
  1 +=== 0.2.1 2011-02-16
2 2
3 3 * 1 minor bugfix:
4   - * Force retrieved ASCII_8BIT text encoding to UTF-8 when running in Ruby 1.9+
  4 + * Force retrieved ASCII_8BIT text encoding to UTF-8 when running in
  5 + Ruby 1.9+.
  6 +* 1 minor enhancement:
  7 + * Added support for boolean filters.
5 8
6 9 === 0.2.0 2010-06-10
7 10
33 README.rdoc
Source Rendered
@@ -80,6 +80,39 @@ just get on with things...
80 80
81 81 See Biomart module and Class docs for more detail.
82 82
  83 +== Advanced Filtering
  84 +
  85 +Most filters in biomart are just pure textual filters, i.e.
  86 +
  87 + kermits.search( :filters => { "marker_symbol" => "Cbx1" } )
  88 +
  89 +To filter on more than one term, simply pass a comma concatenated string,
  90 +or an array (the following two searches are equivalent):
  91 +
  92 + kermits.search( :filters => { "marker_symbol" => "Cbx1,Mysm1" } )
  93 + kermits.search( :filters => { "marker_symbol" => ["Cbx1","Mysm1"] } )
  94 +
  95 +Finally, there are also boolean filters (shown in the standard MartView
  96 +interface as a filter name and then two radio buttons: 'Only' or
  97 +'Excluded'). These filers can only accept the following:
  98 +
  99 +- 'Only': true / 'only' / 'included'
  100 +- 'Excluded': false / 'excluded'
  101 +
  102 +Here's some example usage:
  103 +
  104 + snp_mart = Biomart::Dataset.new( "http://www.ensembl.org/biomart", { :name => "hsapiens_snp" } )
  105 +
  106 + # These are equivalent to selecting 'Only' in MartView
  107 + snp_mart.search( :filters => { 'with_variation_annotation' => true, 'ensembl_gene' => 'ENSG00000244734' } )
  108 + snp_mart.search( :filters => { 'with_variation_annotation' => 'only', 'ensembl_gene' => 'ENSG00000244734' } )
  109 + snp_mart.search( :filters => { 'with_variation_annotation' => 'included', 'ensembl_gene' => 'ENSG00000244734' } )
  110 +
  111 + # These are equivalent to selecting 'Excluded' in MartView
  112 + snp_mart.search( :filters => { 'with_variation_annotation' => false, 'ensembl_gene' => 'ENSG00000244734' } )
  113 + snp_mart.search( :filters => { 'with_variation_annotation' => 'excluded', 'ensembl_gene' => 'ENSG00000244734' } )
  114 +
  115 +
83 116 == Federated Searches
84 117
85 118 To perform a federated search across two datasets...

0 comments on commit 1659e7d

Please sign in to comment.
Something went wrong with that request. Please try again.