本文整理汇总了Java中org.biojava.nbio.structure.Structure.setPDBHeader方法的典型用法代码示例。如果您正苦于以下问题:Java Structure.setPDBHeader方法的具体用法?Java Structure.setPDBHeader怎么用?Java Structure.setPDBHeader使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.biojava.nbio.structure.Structure
的用法示例。
在下文中一共展示了Structure.setPDBHeader方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getMetaModel
import org.biojava.nbio.structure.Structure; //导入方法依赖的package包/类
@Override
public Structure getMetaModel() throws InvalidParameterException, InvalidInputException {
try {
Structure structure = (Structure) getStructure();
PDBHeader pdbHeader = new PDBHeader();
pdbHeader.setTitle(inputParser.getTitleFromFile(getInputFile()));
PDBCrystallographicInfo pdbCrystallographicInfo = new PDBCrystallographicInfo();
List<Chain> modelFromFile = inputParser.getModelFromFile(getInputFile());
structure.setModel(0, modelFromFile);
pdbCrystallographicInfo.setSpaceGroup(new SpaceGroup(0, 1, 1, "P 1", "P 1", BravaisLattice.CUBIC));
CrystalCell crystalCell = pdbCrystallographicInfo.getSpaceGroup().getBravLattice().getExampleUnitCell();
//call always after getModelFromFile --> box calculation
inputParser.getCrystlCell(getInputFile(), crystalCell);
pdbCrystallographicInfo.setCrystalCell(crystalCell);
pdbHeader.setCrystallographicInfo(pdbCrystallographicInfo);
structure.setPDBHeader(pdbHeader);
return structure;
} catch (IOException e) {
getConsoleHandler().printErrorln(e.getMessage());
throw new InvalidInputException(getName() + " wasn't able to parse input file!");
}
}
示例2: toMultimodelStructure
import org.biojava.nbio.structure.Structure; //导入方法依赖的package包/类
public static Structure toMultimodelStructure(MultipleAlignment multAln, List<Atom[]> transformedAtoms) throws StructureException {
PDBHeader header = new PDBHeader();
String title = multAln.getEnsemble().getAlgorithmName() + " V."
+ multAln.getEnsemble().getVersion() + " : ";
for (StructureIdentifier name : multAln.getEnsemble()
.getStructureIdentifiers()) {
title += name.getIdentifier() + " ";
}
Structure artificial = getAlignedStructure(transformedAtoms);
artificial.setPDBHeader(header);
header.setTitle(title);
return artificial;
}
示例3: testWrite
import org.biojava.nbio.structure.Structure; //导入方法依赖的package包/类
/**
* Test the writing of Structure objects to a file.
* @throws IOException
*/
@Test
public void testWrite() throws IOException {
Structure structure = new StructureImpl();
PDBHeader pdbHeader = new PDBHeader();
pdbHeader.setExperimentalTechnique("X-RAY DIFFRACTION");
structure.setEntityInfos(new ArrayList<EntityInfo>());
structure.setPDBHeader(pdbHeader);
Chain chain = new ChainImpl();
chain.setId("A");
chain.setName("A");
Group group = new AminoAcidImpl();
group.setPDBName("FKF");
ChemComp chemComp = new ChemComp();
chemComp.setType("TYPfdl");
chemComp.setOne_letter_code("A");
group.setChemComp(chemComp);
Atom atom = new AtomImpl();
atom.setName("A");
atom.setElement(Element.Ag);
atom.setCoords(new double[] {1.0,2.0,3.0});
chain.addGroup(group);
group.addAtom(atom);
ResidueNumber residueNumber = new ResidueNumber();
residueNumber.setInsCode('A');
residueNumber.setSeqNum(100);
group.setResidueNumber(residueNumber);
structure.addChain(chain);
File tempFile = testFolder.newFile("tmpfile");
MmtfActions.writeToFile(structure, tempFile.toPath());
}
示例4: fromPDB
import org.biojava.nbio.structure.Structure; //导入方法依赖的package包/类
private Structure fromPDB(JTextField f, JTextField c) throws StructureException{
String pdb = f.getText();
if ( pdb.length() < 4) {
f.setText("!!!");
return null;
}
String chain = c.getText();
if ( debug )
System.out.println("file :" + pdb + " " + chain);
/// prepare structures
// load them from the file system
PDBFileReader reader = new PDBFileReader();
reader.setPath(".");
Structure tmp1 = new StructureImpl();
try {
Structure structure1 = reader.getStructureById(pdb);
// no chain has been specified
// return whole structure
if (( chain == null) || (chain.length()==0)){
return structure1;
}
if ( debug)
System.out.println("using chain " + chain + " for structure " + structure1.getPDBCode());
Chain c1 = structure1.findChain(chain);
tmp1.setPDBCode(structure1.getPDBCode());
tmp1.setPDBHeader(structure1.getPDBHeader());
tmp1.setPDBCode(structure1.getPDBCode());
tmp1.addChain(c1);
System.out.println("ok");
} catch (IOException e){
logger.warn(e.getMessage());
throw new StructureException(e);
}
return tmp1;
}
示例5: fromPDB
import org.biojava.nbio.structure.Structure; //导入方法依赖的package包/类
private Structure fromPDB(JTextField f, JTextField c) throws StructureException{
String pdb = f.getText();
if ( pdb.length() < 4) {
f.setText("!!!");
return null;
}
String chain = c.getText();
if ( debug )
System.out.println("file :" + pdb + " " + chain);
/// prepare structures
// load them from the file system
String dir = pdbDir.getText();
PDBFileReader reader = new PDBFileReader(dir);
if ( debug )
System.out.println("dir: " + dir);
Structure tmp1 = new StructureImpl();
try {
Structure structure1 = reader.getStructureById(pdb);
// no chain has been specified
// return whole structure
if (( chain == null) || (chain.length()==0)){
return structure1;
}
if ( debug)
System.out.println("using chain " + chain + " for structure " + structure1.getPDBCode());
Chain c1 = structure1.findChain(chain);
tmp1.setPDBCode(structure1.getPDBCode());
tmp1.setPDBHeader(structure1.getPDBHeader());
tmp1.setPDBCode(structure1.getPDBCode());
tmp1.addChain(c1);
System.out.println("ok");
} catch (IOException e){
logger.warn(e.getMessage());
throw new StructureException(e);
}
return tmp1;
}