//Flag true only CA will be readed public MolData(string fileName,PDBMODE flag,INPUTMODE mode,CHAIN_MODE chainFlag=CHAIN_MODE.SINGLE) { using (StreamReader rr = new StreamReader(fileName)) { switch (mode) { case INPUTMODE.PROTEIN: mol = new Molecule( flag,chainFlag); break; case INPUTMODE.RNA: mol = new MoleculeRNA(flag); break; } bool res = mol.ReadMolecule(rr); if (!res) return; if (mol.Chains.Count == 0) { ErrorBase.AddErrors("Error in reading file: " + fileName + "\nCannot find residues, file will not be considered!"); rr.Close(); return; } molLength = mol.Chains[0].chainSequence.Length; } //CenterMol(); }
internal Residue(Molecule molecule, Atom atom,PDBMODE flag) { // this.molecule = molecule; //this.residueName = atom.ResidueName; this.residueName = (char)atom.tabParam[0]; //this.chainIdentifier = atom.ChainIdentifier; this.tabParam[0] = atom.tabParam[1]; //this.residueSequenceNumber = atom.ResidueSequenceNumber; //this.residueSequenceNumber = atom.tabParam[2]; this.tabParam[1] = atom.tabParam[2]; atoms = new List<Atom>(); this.atoms.Add(atom); //AddAtom(atom); //this.residueIdentifier = Residue.GetResidueIdentifier(this.residueName); }
public bool ReadMolData(MemoryStream stream, PDBMODE flag,string modelName) { StreamReader rr = new StreamReader(stream); mol = new Molecule(flag); bool res = mol.ReadMolecule(rr); if (!res) { return false; } if (mol.Chains.Count == 0) { ErrorBase.AddErrors("Error in reading file: " + modelName + "\nCannot find residues, file will not be considered!"); return false; } molLength = mol.Chains[0].chainSequence.Length; return true; //CenterMol(); }
public void CleanMolData() { mol = null; }