コード例 #1
0
ファイル: testHelixFusion.cpp プロジェクト: Suncuss/mslib
int main(){

	cout << "Read a string pdb 'fourHelixBundle'"<<endl;
	PDBReader pdbin;
	pdbin.read(fourHelixBundle);
	pdbin.close();

	System sys;
	sys.addAtoms(pdbin.getAtomPointers());
	sys.writePdb("/tmp/preFusion.pdb");
	HelixFusion hf;
	cout << "Chain Sizes: "<<sys("A").positionSize()<<" "<<sys("B").positionSize()<<endl;
	hf.setChains(sys("A"),sys("B"));

	hf.fusionByAtomicAlignment(0.3);




	for (uint f = 0; f< hf.getNumberFusions();f++){
		Chain &newChain = hf.getFusedChain(f);
		PDBWriter pdbout;
		char name[80];
		sprintf(name,"/tmp/fusedChain-%04d.pdb",f);
		pdbout.open((string)name);
		pdbout.write(newChain.getAtomPointers());
		pdbout.close();
	}



	hf.fusionByHelicalFrames();
}
コード例 #2
0
ファイル: testCRDIO.cpp プロジェクト: Suncuss/mslib
int main() {

	// Write a test PDB file from testData.h (/tmp/testPdb.pdb)
	
	PDBReader pRead;
	if(!pRead.read(pdbForTestCrd)) {
		cerr << "Unable to read pdbForTestCrd" << endl;
		exit(0);
	}

	AtomPointerVector atoms = pRead.getAtomPointers();
	cout << atoms << endl;

	CRDReader cRead;
	
	if(!cRead.read(testCrdFile)) {
		cerr << "Unable to read crdFile" << endl;
		exit(0);
	}

	cout << cRead.getAtomPointers();
	cRead.assignCoordinates(atoms);
		
	PDBWriter w("/tmp/testPDB.pdb");
	if(!w.open() || !w.write(atoms)) {
		cerr << "Unable to write /tmp/testPDB.pdb" << endl;
		exit(0);
	}


	CRDWriter w2("/tmp/testCRD.crd");
	if(!w2.open()) {
		cerr << "Unable to open /tmp/testCRD.pdb" << endl;
		exit(0);
	}

	w2.addRemark("This is a test file created by testCRDIO");
	if(!w2.write(atoms)) {
		cerr << "Unable to write /tmp/testCRD.pdb" << endl;
		exit(0);
	}


	return 0;

};