本文整理汇总了Java中org.biojava.nbio.structure.StructureIO类的典型用法代码示例。如果您正苦于以下问题:Java StructureIO类的具体用法?Java StructureIO怎么用?Java StructureIO使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
StructureIO类属于org.biojava.nbio.structure包,在下文中一共展示了StructureIO类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import org.biojava.nbio.structure.StructureIO; //导入依赖的package包/类
public static void main(String[] args) throws IOException,
StructureException {
// Align two trimeric DNA clamps
Structure s1 = StructureIO.getStructure("1bcc");
Structure s2 = StructureIO.getStructure("1kb9");
// Select the parameters for clustering and alignment
SubunitClustererParameters clusterParams = new SubunitClustererParameters();
QsAlignParameters alignParams = new QsAlignParameters();
QsAlignResult result = QsAlign
.align(s1, s2, clusterParams, alignParams);
System.out.println(result);
}
示例2: setUpBioJava
import org.biojava.nbio.structure.StructureIO; //导入依赖的package包/类
/**
* Set up the configuration parameters for BioJava.
*/
public static AtomCache setUpBioJava() {
// Set up the atom cache etc
AtomCache cache = new AtomCache();
cache.setUseMmCif(true);
FileParsingParameters params = cache.getFileParsingParams();
params.setCreateAtomBonds(true);
params.setAlignSeqRes(true);
params.setParseBioAssembly(true);
DownloadChemCompProvider cc = new DownloadChemCompProvider();
ChemCompGroupFactory.setChemCompProvider(cc);
cc.checkDoFirstInstall();
cache.setFileParsingParams(params);
StructureIO.setAtomCache(cache);
return cache;
}
示例3: testDivideInternally
import org.biojava.nbio.structure.StructureIO; //导入依赖的package包/类
/**
* Test {@link SubunitCluster#divideInternally(SubunitClustererParameters)}
*
* @throws StructureException
* @throws IOException
*/
@Test
public void testDivideInternally() throws StructureException, IOException {
Structure s = StructureIO.getStructure("4e3e");
// Create a SubunitCluster for the chain
SubunitCluster sc1 = new SubunitCluster(
new Subunit(StructureTools.getRepresentativeAtomArray(s
.getChainByIndex(0)), "chain 0", null, s));
SubunitClustererParameters clustererParameters = new SubunitClustererParameters();
clustererParameters.setStructureCoverageThreshold(0.8);
clustererParameters.setRMSDThreshold(3.0);
clustererParameters.setMinimumSequenceLength(20);
// Clusters should be merged by identity
boolean divided = sc1.divideInternally(clustererParameters);
// Divided has to be true, and Subunit length shorter than half
assertTrue(divided);
assertEquals(sc1.size(), 2);
assertTrue(sc1.length() < 178);
assertEquals(sc1.getAlignedAtomsSubunit(0).length,
sc1.getAlignedAtomsSubunit(1).length);
}
示例4: testCollagen
import org.biojava.nbio.structure.StructureIO; //导入依赖的package包/类
/**
* Some collagen structures have very short Chains, so the minimum sequence
* length is adjusted: 1A3I.
*
* @see SubunitClustererParameters#getMinimumSequenceLengthFraction()
*/
@Test
public void testCollagen() throws StructureException, IOException {
Structure s = StructureIO.getStructure("1A3I");
List<Subunit> subunits = SubunitExtractor.extractSubunits(s, 5, 0.75, 20);
// We expect all 3 subunits to be returned
assertEquals(subunits.size(), 3);
subunits = SubunitExtractor.extractSubunits(s, 8, 0.75, 9);
// Now we expect only the long Subunit to be returned
assertEquals(subunits.size(), 1);
assertEquals(subunits.get(0).size(), 9);
}
示例5: testDatesV4
import org.biojava.nbio.structure.StructureIO; //导入依赖的package包/类
/**
* Test parsing dates from MMCIF file version 4.
*/
@Test
public void testDatesV4() throws IOException, StructureException, ParseException {
ClassLoader classLoader = this.getClass().getClassLoader();
String file4 = classLoader.getResource("org/biojava/nbio/structure/io/mmcif/1stp_v4.cif").getPath();
Structure s = StructureIO.getStructure(file4);
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd",Locale.US);
Date modDate = dateFormat.parse("2011-07-13");
assertEquals(modDate, s.getPDBHeader().getModDate());
Date releaseDate = dateFormat.parse("1992-10-15");
assertEquals(releaseDate, s.getPDBHeader().getRelDate());
Date depositionDate = dateFormat.parse("1992-03-12");
assertEquals(depositionDate, s.getPDBHeader().getDepDate());
}
示例6: testSites1a4w
import org.biojava.nbio.structure.StructureIO; //导入依赖的package包/类
@Test
public void testSites1a4w()throws IOException, StructureException {
AtomCache cache = new AtomCache();
StructureIO.setAtomCache(cache);
cache.setUseMmCif(true);
Structure sCif = StructureIO.getStructure("1A4W");
assertNotNull(sCif);
// After it has read the file, it should check that expected SITES are present.
List<Site> sites = sCif.getSites();
// 1a4w has 5 sites from ligands.
assertEquals(5, sites.size());
// Check for each site that it has parsed all residues.
assertEquals(3, getGroupsInSite(sCif, "CAT"));
assertEquals(6, getGroupsInSite(sCif, "AC1")); // Site has residue with insertion code.
assertEquals(6, getGroupsInSite(sCif, "AC2"));
assertEquals(14, getGroupsInSite(sCif, "AC3"));
assertEquals(14, getGroupsInSite(sCif, "AC4"));
}
示例7: checkPDB
import org.biojava.nbio.structure.StructureIO; //导入依赖的package包/类
private void checkPDB(String pdbId, String organismTaxId) throws IOException, StructureException {
Structure s = StructureIO.getStructure(pdbId);
assertNotNull(s.getEntityInfos());
assertTrue(s.getEntityInfos().size() > 0);
for ( EntityInfo c : s.getEntityInfos()) {
if(EntityType.POLYMER.equals(c.getType())) {
assertNotNull(c.getOrganismTaxId());
if(pdbId.equals("3zd6")){
if(c.getMolId()==2) {
assertEquals(c.getOrganismTaxId(), "32630");
continue;
}
}
assertEquals(c.getOrganismTaxId(), organismTaxId);
}
}
}
示例8: testRoundTrip
import org.biojava.nbio.structure.StructureIO; //导入依赖的package包/类
/**
* Test that we can round trip a simple structure.
* @throws IOException an error reading the file
* @throws StructureException an error parsing the structure
*/
@Test
public void testRoundTrip() throws IOException, StructureException {
AtomCache cache = new AtomCache();
cache.setUseMmCif(true);
ChemCompGroupFactory.setChemCompProvider(new DownloadChemCompProvider());
StructureIO.setAtomCache(cache);
Structure structure = StructureIO.getStructure("4CUP");
AdapterToStructureData writerToEncoder = new AdapterToStructureData();
new MmtfStructureWriter(structure, writerToEncoder);
MmtfStructureReader mmtfStructureReader = new MmtfStructureReader();
new StructureDataToAdapter(writerToEncoder, mmtfStructureReader);
assertTrue(checkIfAtomsSame(structure,mmtfStructureReader.getStructure()));
}
示例9: testLigandConnections
import org.biojava.nbio.structure.StructureIO; //导入依赖的package包/类
@Test
public void testLigandConnections()throws IOException, StructureException {
AtomCache cache = new AtomCache();
// This needs MMCIF
cache.setUseMmCif(true);
StructureIO.setAtomCache(cache);
cache.setUseMmCif(true);
ChemCompGroupFactory.setChemCompProvider(new DownloadChemCompProvider());
FileParsingParameters params = cache.getFileParsingParams();
params.setCreateAtomBonds(true);
StructureIO.setAtomCache(cache);
Structure sCif = StructureIO.getStructure("4HHB");
//Verify that we have all HEM atoms from the CIF file.
assertEquals( HEM_COUNT_4HHB, countBondedAtomsInLigandGroups(sCif) );
}
示例10: testMultipleConformations
import org.biojava.nbio.structure.StructureIO; //导入依赖的package包/类
@Test
public void testMultipleConformations()throws IOException, StructureException {
AtomCache cache = new AtomCache();
// This needs MMCIF
cache.setUseMmCif(true);
StructureIO.setAtomCache(cache);
cache.setUseMmCif(true);
ChemCompGroupFactory.setChemCompProvider(new DownloadChemCompProvider());
FileParsingParameters params = cache.getFileParsingParams();
params.setCreateAtomBonds(true);
StructureIO.setAtomCache(cache);
Structure sCif = StructureIO.getStructure("3UCB");
//Verify that we have all atoms from all conformations of the ligands
assertEquals(ATOM_COUNT_3UCB, countBondedAtomsInLigandGroups(sCif));
}
示例11: main
import org.biojava.nbio.structure.StructureIO; //导入依赖的package包/类
public static void main(String[] args){
try {
Structure struc = StructureIO.getStructure("1aoi");
StructureAlignmentJmol jmolPanel = new StructureAlignmentJmol();
jmolPanel.setStructure(struc);
// send some RASMOL style commands to Jmol
jmolPanel.evalString("select * ; color chain;");
jmolPanel.evalString("select nucleic; cartoon on;");
jmolPanel.evalString("select *; spacefill off; wireframe off; cartoon on; ");
} catch (Exception e){
e.printStackTrace();
}
}
示例12: testNMR
import org.biojava.nbio.structure.StructureIO; //导入依赖的package包/类
/**
* An NMR multi-model entry: 1B4C
*
* @throws StructureException
* @throws IOException
*/
@Test
public void testNMR() throws IOException, StructureException {
// as of mmCIF v5 there's no bioassemblies for NMR entries, so now we use the AU (bioassembly 0) - JD 2017-08-02
Structure pdb = StructureIO.getStructure("BIO:1b4c:0");
SubunitClustererParameters clusterParams = new SubunitClustererParameters();
QuatSymmetryParameters symmParams = new QuatSymmetryParameters();
QuatSymmetryResults symmetry = QuatSymmetryDetector.calcGlobalSymmetry(
pdb, symmParams, clusterParams);
// C2 symmetry non pseudosymmetric
assertEquals("C2", symmetry.getSymmetry());
assertEquals("A2", symmetry.getStoichiometry());
assertFalse(symmetry.isPseudoStoichiometric());
}
示例13: testDihedral
import org.biojava.nbio.structure.StructureIO; //导入依赖的package包/类
/**
* Test a dihedral symmetry: 2VML
*/
@Test
public void testDihedral() throws IOException, StructureException {
Structure pdb = StructureIO.getStructure("BIO:2vml:1");
SubunitClustererParameters clusterParams = new SubunitClustererParameters();
clusterParams.setClustererMethod(SubunitClustererMethod.SEQUENCE);
QuatSymmetryParameters symmParams = new QuatSymmetryParameters();
QuatSymmetryResults symmetry = QuatSymmetryDetector.calcGlobalSymmetry(
pdb, symmParams, clusterParams);
// D3 symmetry non pseudosymmetric
assertEquals("D3", symmetry.getSymmetry());
assertEquals("A6B6", symmetry.getStoichiometry());
assertFalse(symmetry.isPseudoStoichiometric());
}
示例14: testInternalSymmetry
import org.biojava.nbio.structure.StructureIO; //导入依赖的package包/类
/**
* A structure with combined internal and quaternary symmetry: 4E3E
*
* @throws IOException
* @throws StructureException
*/
@Test
public void testInternalSymmetry() throws IOException, StructureException {
Structure pdb = StructureIO.getStructure("BIO:4e3e:1");
// Internal symmetry analysis, use structural clustering
SubunitClustererParameters cp = new SubunitClustererParameters();
cp.setClustererMethod(SubunitClustererMethod.STRUCTURE);
cp.setInternalSymmetry(true);
cp.setStructureCoverageThreshold(0.75); // Lower coverage for internal symm
QuatSymmetryParameters symmParams = new QuatSymmetryParameters();
QuatSymmetryResults symmetry = QuatSymmetryDetector.calcGlobalSymmetry(
pdb, symmParams, cp);
// D2 combined internal and quaternary symmetry
assertEquals("D3", symmetry.getSymmetry());
assertEquals("A6", symmetry.getStoichiometry());
}
示例15: testHelical
import org.biojava.nbio.structure.StructureIO; //导入依赖的package包/类
/**
* A structure with helical symmetry: 1B47
*
* @throws IOException
* @throws StructureException
*/
@Test
public void testHelical() throws IOException, StructureException {
Structure pdb = StructureIO.getStructure("BIO:1B47:1");
SubunitClustererParameters cp = new SubunitClustererParameters();
QuatSymmetryParameters symmParams = new QuatSymmetryParameters();
QuatSymmetryResults symmetry = QuatSymmetryDetector.calcGlobalSymmetry(
pdb, symmParams, cp);
// H symmetry A3 stoichiometry
assertEquals("H", symmetry.getSymmetry());
assertEquals("A3", symmetry.getStoichiometry());
}