### Install FreeSASA Python Module Source: https://github.com/freesasa/freesasa-python/blob/master/docs/source/index.md Install the FreeSASA Python Module using pip. This is the recommended method for most users. ```default pip install freesasa ``` -------------------------------- ### Build FreeSASA Python Module from Source Source: https://github.com/freesasa/freesasa-python/blob/master/README.md Developers can build the FreeSASA Python module from source. This process involves updating git submodules and running the setup script with Cython enabled. ```sh git submodule update --init USE_CYTHON=1 python setup.py build ``` -------------------------------- ### SASA Selection Output Source: https://github.com/freesasa/freesasa-python/blob/master/docs/source/intro.md Example output for SASA calculations on selected atoms. ```default alanine : 120.08 A2 r1_10 : 634.31 A2 ``` -------------------------------- ### Run FreeSASA Python Module Tests Source: https://github.com/freesasa/freesasa-python/blob/master/docs/source/index.md Run the tests for the FreeSASA Python module after building from source. This ensures the installation and build were successful. ```default python setup.py test ``` -------------------------------- ### Install FreeSASA Python Module with Conda Source: https://github.com/freesasa/freesasa-python/blob/master/README.md Install the FreeSASA Python module using conda from the conda-forge channel. This is an alternative installation method, particularly useful for managing complex dependencies. ```sh conda install -c conda-forge freesasa-python ``` -------------------------------- ### Basic SASA Calculation Output Source: https://github.com/freesasa/freesasa-python/blob/master/docs/source/intro.md Example output for a basic SASA calculation, showing total, polar, and apolar surface areas. ```default Total : 4804.06 A2 Polar : 2504.22 A2 Apolar : 2299.84 A2 ``` -------------------------------- ### Build FreeSASA Python Module from Source Source: https://github.com/freesasa/freesasa-python/blob/master/docs/source/index.md Clone the FreeSASA Python repository and build the module from source. This method is for developers or users who need to build from the latest code. ```default git clone https://github.com/freesasa/freesasa-python.git git submodule update --init python setyp.py build ``` -------------------------------- ### Basic SASA Calculation Source: https://github.com/freesasa/freesasa-python/blob/master/docs/source/intro.md Perform a basic SASA calculation using default parameters on a PDB file. Requires the PDB file to be available. ```python import freesasa structure = freesasa.Structure("1ubq.pdb") result = freesasa.calc(structure) area_classes = freesasa.classifyResults(result, structure) print "Total : %.2f A2" % result.totalArea() for key in area_classes: print key, ": %.2f A2" % area_classes[key] ``` -------------------------------- ### SASA Calculation for Atom Selections Source: https://github.com/freesasa/freesasa-python/blob/master/docs/source/intro.md Calculate SASA for specific atom selections using Pymol selection syntax. Requires a structure and a previous calculation result. ```python selections = freesasa.selectArea(('alanine, resn ala', 'r1_10, resi 1-10'), structure, result) for key in selections: print key, ": %.2f A2" % selections[key] ``` -------------------------------- ### SASA Calculation with Custom Classifier Source: https://github.com/freesasa/freesasa-python/blob/master/docs/source/intro.md Perform SASA calculation using a custom NACCESS configuration file for atom classification and radii. ```python classifier = freesasa.Classifier("naccess.config") structure = freesasa.Structure("1ubq.pdb", classifier) result = freesasa.calc(structure) area_classes = freesasa.classifyResults(result, structure, classifier) ``` -------------------------------- ### Custom SASA Classifier with Nitrogen Focus Source: https://github.com/freesasa/freesasa-python/blob/master/docs/source/intro.md Illustrates extending the FreeSASA Classifier to classify nitrogen atoms separately and assign radii based on element type. ```python import freesasa import re class DerivedClassifier(freesasa.Classifier): # this must be set explicitly in all derived classifiers purePython = True def classify(self, residueName, atomName): if re.match('\s*N', atomName): return 'Nitrogen' return 'Not-nitrogen' def radius(self, residueName, atomName): if re.match('\s*N',atomName): # Nitrogen return 1.6 if re.match('\s*C',atomName): # Carbon return 1.7 if re.match('\s*O',atomName): # Oxygen return 1.4 if re.match('\s*S',atomName): # Sulfur return 1.8 return 0; # everything else (Hydrogen, etc) classifier = DerivedClassifier() # use the DerivedClassifier to calculate atom radii structure = freesasa.Structure("1ubq.pdb", classifier) result = freesasa.calc(structure) # use the DerivedClassifier to classify atoms area_classes = freesasa.classifyResults(result,structure,classifier) ``` -------------------------------- ### High Precision SASA Calculation Source: https://github.com/freesasa/freesasa-python/blob/master/docs/source/intro.md Perform a high precision SASA calculation using the LeeRichards algorithm with 100 slices. ```python result = freesasa.calc(structure, freesasa.Parameters({'algorithm' : freesasa.LeeRichards, 'n-slices' : 100})) ``` -------------------------------- ### SASA Calculation with Bio.PDB Structure Source: https://github.com/freesasa/freesasa-python/blob/master/docs/source/intro.md Calculate SASA directly from a Bio.PDB Structure object using freesasa.calcBioPDB. ```python from Bio.PDB import PDBParser parser = PDBParser() structure = parser.get_structure("Ubiquitin", "1ubq.pdb") result, sasa_classes = freesasa.calcBioPDB(structure) ``` -------------------------------- ### SASA Selection for Nitrogen Atoms Source: https://github.com/freesasa/freesasa-python/blob/master/docs/source/intro.md A simpler method to select and calculate SASA for nitrogen atoms using their symbol. ```python selection = freesasa.selectArea('nitrogen, symbol n', structure, result) ``` -------------------------------- ### Write SASA Results to PDB Source: https://github.com/freesasa/freesasa-python/blob/master/docs/source/intro.md Write the calculated SASA results to a new PDB file. This requires the input structure to have been parsed by FreeSASA. ```python import freesasa structure = freesasa.Structure('2ubq.pdb') result = freesasa.calc(structure) result.write_pdb('2ubq.sasa.pdb') ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.