<commit_before>package org.biojava.bio.structure.quaternary.io;

import java.util.ArrayList;
import java.util.List;

import org.biojava.bio.structure.Structure;
import org.biojava.bio.structure.StructureTools;
import org.biojava.bio.structure.io.FileParsingParameters;
import org.biojava.bio.structure.io.MMCIFFileReader;
import org.biojava.bio.structure.io.mmcif.SimpleMMcifConsumer;
import org.biojava.bio.structure.io.mmcif.model.PdbxStructAssembly;
import org.biojava.bio.structure.io.mmcif.model.PdbxStructAssemblyGen;
import org.biojava.bio.structure.io.mmcif.model.PdbxStructOperList;



/** A provider for information about biological units for PDB files that is based on reading local MMcif files.
 * 
 * @author <NAME>
 *
 */
public class MmCifPDBBiolAssemblyProvider implements RawBioUnitDataProvider{

	String pdbId;
	List<PdbxStructAssembly> pdbxStructAssemblies;
	List<PdbxStructAssemblyGen> pdbxStructAssemblyGens;
	List<PdbxStructOperList> pdbxStructOperList;
	Structure asymUnit;
	
	public MmCifPDBBiolAssemblyProvider(){
		//reset();
	}
	
	@Override
	public void setPdbId(String pdbId) {
		
		if (
				this.pdbId != null && 
				(this.pdbId.equals(pdbId))
				) {
			// we already have all the data we need...
			return;
		}
		
		this.pdbId= pdbId;
		
		reset();
		
		MMCIFFileReader reader = new MMCIFFileReader();
		FileParsingParameters params = new FileParsingParameters();<commit_msg>now accepts external fileparsing parameters via AtomCache<commit_after>package org.biojava.bio.structure.quaternary.io;

import java.util.ArrayList;
import java.util.List;

import org.biojava.bio.structure.Structure;
import org.biojava.bio.structure.StructureTools;
import org.biojava.bio.structure.align.util.AtomCache;
import org.biojava.bio.structure.io.FileParsingParameters;
import org.biojava.bio.structure.io.MMCIFFileReader;
import org.biojava.bio.structure.io.mmcif.SimpleMMcifConsumer;
import org.biojava.bio.structure.io.mmcif.model.PdbxStructAssembly;
import org.biojava.bio.structure.io.mmcif.model.PdbxStructAssemblyGen;
import org.biojava.bio.structure.io.mmcif.model.PdbxStructOperList;



/** A provider for information about biological units for PDB files that is based on reading local MMcif files.
 * 
 * @author <NAME>
 *
 */
public class MmCifPDBBiolAssemblyProvider implements RawBioUnitDataProvider{

	String pdbId;
	List<PdbxStructAssembly> pdbxStructAssemblies;
	List<PdbxStructAssemblyGen> pdbxStructAssemblyGens;
	List<PdbxStructOperList> pdbxStructOperList;
	Structure asymUnit;
	
	AtomCache cache ;
	
	public MmCifPDBBiolAssemblyProvider(){
		//reset();
	}
	
	@Override
	public void setPdbId(String pdbId) {
		if ( cache == null)
			cache =new AtomCache();
		
		if (
				this.pdbId != null && 
				(this.pdbId.equals(pdbId))
				) {
			// we already have all the data we need...
			return;
		}
		
		this.pdbId= pdbId;
		
		reset();
		
		MMCIFFileReader reader = new MMCIFFileReader();
		FileParsingParameters params = cache.getFileParsingParams();
		params.setAlignSeqRes(true);
{'fraction_non_alphanumeric': 0.09983416252072969, 'fraction_numerical': 0.0, 'mean_word_length': 4.8, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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}}
{'dir': 'git-commits-cleaned', 'id': '4633128', 'n_tokens_mistral': 1093, 'n_tokens_neox': 996, 'n_words': 193}