本文整理汇总了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);
}
}
}
示例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;
}
示例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;
}