<jupyter_start><jupyter_text>Filter By Deposition Date Demo Imports<jupyter_code>from pyspark.sql import SparkSession
from mmtfPyspark.io import mmtfReader
from mmtfPyspark.filters import DepositionDate
from mmtfPyspark.structureViewer import view_structure<jupyter_output><empty_output><jupyter_text>Configure Spark<jupyter_code>spark = SparkSession.builder.appName("FilterByDepositionDateDemo").getOrCreate()<jupyter_output><empty_output><jupyter_text>Read in MMTF Files<jupyter_code>path = "../../resources/mmtf_reduced_sample/"

pdb = mmtfReader.read_sequence_file(path)<jupyter_output><empty_output><jupyter_text>Filter by deposition date<jupyter_code>pdb = pdb.filter(DepositionDate('1999-02-26','2000-02-28'))<jupyter_output><empty_output><jupyter_text>Count number of entires<jupyter_code>count = pdb.count()

print(f"Number of structure desposited between 1999-02-26 and 2000-02-28 is : {count} (for sample ~10,000 structures)")<jupyter_output>Number of structure desposited between 1999-02-26 and 2000-02-28 is : 117 (for sample ~10,000 structures)<jupyter_text>View 3D structures<jupyter_code>pdbIds = pdb.keys().collect()

view_structure(pdbIds)<jupyter_output><empty_output><jupyter_text>Terminate Spark<jupyter_code>spark.stop()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11006289308176101, 'fraction_numerical': 0.04874213836477988, 'mean_word_length': 10.265486725663717, 'pattern_counts': {'":': 0, '<': 28, '<?xml version=': 0, '>': 28, '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': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '611240', 'license': 'Apache-2.0', 'n_tokens_mistral': 517, 'n_tokens_neox': 451, 'n_words': 69, 'path': 'demos/filters/FilterByDepositionDateDemo.ipynb', 'repo_name': 'sbliven/mmtf-pyspark', 'size': '1272'}