本文整理汇总了Java中org.biojava.nbio.structure.Structure.getPolyChainByPDB方法的典型用法代码示例。如果您正苦于以下问题:Java Structure.getPolyChainByPDB方法的具体用法?Java Structure.getPolyChainByPDB怎么用?Java Structure.getPolyChainByPDB使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.biojava.nbio.structure.Structure
的用法示例。
在下文中一共展示了Structure.getPolyChainByPDB方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: test4letterChains
import org.biojava.nbio.structure.Structure; //导入方法依赖的package包/类
@Test
public void test4letterChains() throws IOException, StructureException, URISyntaxException {
String filename = "/1hh0_4char.cif.gz";
URL url = getClass().getResource(filename);
assumeNotNull("Can't find resource "+filename,url);
File file = new File(url.toURI());
assumeNotNull(file);
assumeTrue(file.exists());
MMCIFFileReader reader = new MMCIFFileReader();
Structure s = reader.getStructure(file);
assertNotNull("Failed to load structure from jar",s);
List<Chain> chains = s.getChains();
assertEquals("Wrong number of chains",chains.size(), 1);
Chain chain = chains.get(0);
assertEquals("Wrong chain ID",chain.getId(),"ABCD");
Chain chain2 = s.getPolyChainByPDB("ABCD");
assertNotNull(chain2);
assertEquals(chain2, chain);
}
示例2: check1REPChainC
import org.biojava.nbio.structure.Structure; //导入方法依赖的package包/类
/**
* Check that the gapped residues have no atoms, but that ungapped residues
* have atoms.
*
* @param s: Structure to test.
*/
public void check1REPChainC(Structure s) throws StructureException {
String sequence = "MAETAVINHKKRKNSPRIVQSNDLTEAAYSLSRDQKRMLYLFVDQIRK" +
"SDGTLQEHDGICEIHVAKYAEIFGLTSAEASKDIRQALKSFAGKEVVFYRPEEDAGDE" +
"KGYESFPWFIKPAHSPSRGLYSVHINPYLIPFFIGLQNRFTQFRLSETKEITNPYAMR" +
"LYESLCQYRKPDGSGIVSLKIDWIIERYQLPQSYQRMPDFRRRFLQVCVNEINSRTPM" +
"RLSYIEKKKGRQTTHIVFSFRDITSMTTG";
boolean [] shouldMatch = new boolean[sequence.length()];
for (int i = 0; i < sequence.length(); i++) shouldMatch[i] = true;
// 1-14 is gap
for (int i = 0; i < 14; i++) shouldMatch[i] = false;
// 50-55 is gap
for (int i = 49; i < 55; i++) shouldMatch[i] = false;
// 98-109 is gap
for (int i = 97; i < 109; i++) shouldMatch[i] = false;
// 247-251 is gap
for (int i = 246; i < 251; i++) shouldMatch[i] = false;
Chain c = s.getPolyChainByPDB("C");
List<Group> seqres = c.getSeqResGroups();
// Check lengths
Assert.assertEquals(sequence.length(), seqres.size());
// Check sequences.
Assert.assertEquals(sequence, c.getSeqResSequence());
for (int i = 0; i < sequence.length(); i++) {
Assert.assertEquals(shouldMatch[i], hasAtoms(seqres.get(i)));
}
}
示例3: setUpBeforeClass
import org.biojava.nbio.structure.Structure; //导入方法依赖的package包/类
@BeforeClass
public static void setUpBeforeClass() throws StructureException, IOException {
Structure s = StructureIO.getStructure("1smt");
Chain origChainA = s.getPolyChainByPDB("A");
Chain clonedChainA = (Chain) origChainA.clone();
chain1 = Calc.atomsToPoints(StructureTools.getAtomCAArray(origChainA));
chain2 = Calc.atomsToPoints(StructureTools.getAtomCAArray(clonedChainA));
}
示例4: test4A1Immcif
import org.biojava.nbio.structure.Structure; //导入方法依赖的package包/类
/**
* This tests that the biounit and operator ids are the right ones when parsing from mmcif
* @throws IOException
* @throws StructureException
*/
@Test
public void test4A1Immcif() throws IOException, StructureException {
String pdbId = "4A1I";
int biolAssemblyNr = 2;
AtomCache cache = new AtomCache();
cache.setUseMmCif(true);
cache.setUseMmtf(false);
StructureIO.setAtomCache(cache);
Structure bioAssembly = StructureIO.getBiologicalAssembly(pdbId,biolAssemblyNr);
if ( bioAssembly == null){
System.err.println("Could not generate the biological assembly " + pdbId + " nr " + biolAssemblyNr);
}
/*
* loop_
_pdbx_struct_assembly_gen.assembly_id
_pdbx_struct_assembly_gen.oper_expression
_pdbx_struct_assembly_gen.asym_id_list
1 1 A,I,J,K,L,M,N,UA,H,PA,QA,RA,SA,TA,BB
2 1 G,KA,LA,MA,NA,OA,AB
2 2 B,O,P,Q,R,VA
3 1 B,O,P,Q,R,VA
3 3 G,KA,LA,MA,NA,OA,AB
4 1 C,S,T,U,V,W,WA,F,FA,GA,HA,IA,JA,ZA
5 1 D,X,Y,Z,XA,E,AA,BA,CA,DA,EA,YA
*/
//System.out.println(bioAssembly.toPDB());
assertEquals(1, bioAssembly.nrModels());
assertEquals(2, bioAssembly.getPolyChains().size());
// this tests checks that the operator ids are exactly those read from mmcif, it doesn't necessarily work in mmtf where there are no ids
Chain g = bioAssembly.getPolyChainByPDB("G_1");
Chain b = bioAssembly.getPolyChainByPDB("B_2");
assertNotNull(g);
assertNotNull(b);
}
示例5: test3th3
import org.biojava.nbio.structure.Structure; //导入方法依赖的package包/类
@Test
public void test3th3() throws StructureException, IOException {
AtomCache cache = new AtomCache();
StructureIO.setAtomCache(cache);
Structure s = StructureIO.getStructure("3th3");
// there's 2 residues with residue number 201 in chain T: LYS and a sugar BGC
// that's more like bad annotation in the file but it's good if we can parse
// the file without crashing and produce a good warning
// below we make sure that we parse both residues but that we can only lookup the
// aminoacid residue (see ChainImpl.addChain)
// since biojava 5.0 polymer and nonpolymer chains are separated, we've modified the
// test accordingly below
Chain c = s.getPolyChainByPDB("T");
ResidueNumber rn = ResidueNumber.fromString("201");
rn.setChainName("T");
Group g = c.getGroupByPDB(rn);
// we get the aminoacid residue and not the BGC sugar residue
assertEquals("LYS", g.getPDBName());
// let's see if we have both the residues with that number:
int count = 0;
for (Group gr : c.getAtomGroups()) {
if (gr.getResidueNumber().equals(rn)) count++;
}
assertEquals(1, count);
c = s.getNonPolyChainsByPDB("T").get(0);
g = c.getGroupByPDB(rn);
assertNotNull(g);
assertEquals("BGC", g.getPDBName());
}