当前位置: 首页>>代码示例>>Java>>正文


Java Structure.getPolyChainByPDB方法代码示例

本文整理汇总了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);
}
 
开发者ID:biojava,项目名称:biojava,代码行数:26,代码来源:TestDifficultMmCIFFiles.java

示例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)));
	}
}
 
开发者ID:biojava,项目名称:biojava,代码行数:43,代码来源:TestHeaderOnly.java

示例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));
	
}
 
开发者ID:biojava,项目名称:biojava,代码行数:11,代码来源:TestProteinSuperposition.java

示例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);

}
 
开发者ID:biojava,项目名称:biojava,代码行数:53,代码来源:TestHardBioUnits.java

示例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());
}
 
开发者ID:biojava,项目名称:biojava,代码行数:45,代码来源:Test3th3.java


注:本文中的org.biojava.nbio.structure.Structure.getPolyChainByPDB方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。