<jupyter_start><jupyter_text>Filter By RFree DemoExample of reading an MMTF Hadoop Sequence file, filtering the entries by resolution, and counting the number of entries. This example shows how methods can be chained together.[R Free](http://pdb101.rcsb.org/learn/guide-to-understanding-pdb-data/r-value-and-r-free) Imports<jupyter_code>from pyspark import SparkConf, SparkContext
from mmtfPyspark.io import mmtfReader
from mmtfPyspark.filters import RFree
from mmtfPyspark.structureViewer import view_structure<jupyter_output><empty_output><jupyter_text>Configure Spark<jupyter_code>conf = SparkConf().setMaster("local[*]") \
                      .setAppName("FilterByRFreeDate")
sc = SparkContext(conf = conf)<jupyter_output><empty_output><jupyter_text>Read in MMTF Files, filter by RFree and count<jupyter_code>path = "../../resources/mmtf_reduced_sample/"

structures = mmtfReader.read_sequence_file(path, sc) \
                       .filter(RFree(0.15,0.25))
        
print(f"Number of structures : {structures.count()}")<jupyter_output>Number of structures : 1397<jupyter_text>Visualize Structures<jupyter_code>structure_names = structures.keys().collect()
view_structure(structure_names, style='stick')<jupyter_output><empty_output><jupyter_text>Terminate Spark<jupyter_code>sc.stop()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1073318216175359, 'fraction_numerical': 0.009826152683295541, 'mean_word_length': 6.1567567567567565, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 20, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '513128', 'license': 'Apache-2.0', 'n_tokens_mistral': 458, 'n_tokens_neox': 429, 'n_words': 80, 'path': 'docs/_static/demos/filters/FilterByRFreeDemo.ipynb', 'repo_name': 'sbliven/mmtf-pyspark', 'size': '1323'}