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


Java ComponentDefinition.getSequences方法代码示例

本文整理汇总了Java中org.sbolstandard.core2.ComponentDefinition.getSequences方法的典型用法代码示例。如果您正苦于以下问题:Java ComponentDefinition.getSequences方法的具体用法?Java ComponentDefinition.getSequences怎么用?Java ComponentDefinition.getSequences使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.sbolstandard.core2.ComponentDefinition的用法示例。


在下文中一共展示了ComponentDefinition.getSequences方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: recurseComponentDefinition

import org.sbolstandard.core2.ComponentDefinition; //导入方法依赖的package包/类
/**
 * Creates a copy of an SBOL ComponentDefintion from the given ComponentDefinition's Component if it does not already exist within the given SBOL Document.
 * 
 * @param sbolDoc - The SBOL Document that will store the created ComponentDefintion.
 * @param cd - The ComponentDefinition's Component to be created.
 * @throws SBOLValidationException - SBOL validation exception while creating an SBOL object for SBML2SBOL conversion.
 */
private static void recurseComponentDefinition(SBOLDocument sbolDoc, ComponentDefinition cd) throws SBOLValidationException {
	for (org.sbolstandard.core2.Component comp : cd.getComponents()) {
		if (sbolDoc.getComponentDefinition(comp.getDefinitionURI()) == null) {
			ComponentDefinition compDef = comp.getDefinition();
			sbolDoc.createCopy(compDef);

			for (Sequence sequence : compDef.getSequences()) {
				if (sbolDoc.getSequence(sequence.getIdentity()) == null) {
					sbolDoc.createCopy(sequence);

				}
			}
			recurseComponentDefinition(sbolDoc,compDef);
		}
	}
}
 
开发者ID:MyersResearchGroup,项目名称:iBioSim,代码行数:24,代码来源:SBML2SBOL.java

示例2: hasSequence

import org.sbolstandard.core2.ComponentDefinition; //导入方法依赖的package包/类
public boolean hasSequence() {
	ComponentDefinition cd = getCD();

	if (cd == null) {
		return false;
	}

	return cd.getSequences() != null && cd.getSequences().stream()
			.filter(s -> s.getElements() != null && !s.getElements().equals("")).count() != 0;
}
 
开发者ID:SynBioDex,项目名称:SBOLDesigner,代码行数:11,代码来源:SBOLDesign.java

示例3: addSubComponent

import org.sbolstandard.core2.ComponentDefinition; //导入方法依赖的package包/类
private static int addSubComponent(int position, ComponentDefinition subComp, ComponentDefinition parentComp, String strand,Sequence parentSeq) throws SBOLValidationException, SBOLException 
	{
		//Assume that each CompDef given only has 1 Sequence and 1 element?
//		if (subComp.getSequences() != null && subComp.getSequences().iterator().next().getElements() != null 
//				&& subComp.getSequences().iterator().next().getElements().length() >= 1) {
		if (subComp.getSequences() != null
				&& subComp.getSequences().size() >= 1) {
//			SequenceAnnotation annot = new SequenceAnnotationImpl();
//			annot.setBioStart(position);
//			position += subComp.getDnaSequence().getNucleotides().length() - 1;
//			annot.setBioEnd(position);
//			if (strand.equals(GlobalConstants.SBOL_ASSEMBLY_MINUS_STRAND))
//				annot.setStrand(StrandType.NEGATIVE);
//			else
//				annot.setStrand(StrandType.POSITIVE);
//			annot.setSubComponent(subComp);
//			parentComp.addAnnotation(annot);
//			position++;
			
			int start = position;
			position += subComp.getSequences().iterator().next().getElements().length() - 1;
			int end = position;
			OrientationType orient; 
			if (strand.equals(GlobalConstants.SBOL_ASSEMBLY_MINUS_STRAND))
				orient = OrientationType.REVERSECOMPLEMENT;
			else
				orient = OrientationType.INLINE;
			SequenceAnnotation annot = parentComp.createSequenceAnnotation("parentComp_annot"+position, "annot_range", start, end, orient);
			parentComp.createComponent(subComp.getDisplayId(), AccessType.PRIVATE, subComp.getIdentity());
			annot.setComponent(subComp.getDisplayId());
			position++;
			
//			DnaSequenceImpl subSeq = (DnaSequenceImpl) subComp.getDnaSequence();
//			if (strand.equals(GlobalConstants.SBOL_ASSEMBLY_MINUS_STRAND))
//				parentComp.getDnaSequence().setNucleotides(parentComp.getDnaSequence().getNucleotides() 
//					+ subSeq.getReverseComplementaryNucleotides());
//			else
//				parentComp.getDnaSequence().setNucleotides(parentComp.getDnaSequence().getNucleotides() 
//						+ subSeq.getNucleotides());
			
			Sequence subSeq = subComp.getSequences().iterator().next();
			if (strand.equals(GlobalConstants.SBOL_ASSEMBLY_MINUS_STRAND))
			{
				//TODO: How to handle this getReverseComplementaryNucleotides()?
				parentSeq.setElements(parentSeq.getElements()
						+ getReverseComplementaryNucleotides(subSeq.getElements()));
			}
			else
			{
				parentSeq.setElements(parentSeq.getElements()
						+ subSeq.getElements());
			}
			
		} 
		else 
		{
//			JOptionPane.showMessageDialog(Gui.frame, "DNA Component " + subComp.getDisplayId() + " has no DNA sequence.", 
//					"Missing DNA Sequence", JOptionPane.ERROR_MESSAGE);
			String message = "DNA Component " + subComp.getDisplayId() + " has no DNA sequence.";
			String messageTitle = "Missing DNA Sequence";
			throw new SBOLException(message, messageTitle);
//			return -1;
		}	
		return position;
	}
 
开发者ID:MyersResearchGroup,项目名称:iBioSim,代码行数:66,代码来源:Assembler2.java


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