- if ( !ForesterUtil.isEmpty( node.getNodeData().getSequence().getMolecularSequence() ) ) {
- query = node.getNodeData().getSequence().getMolecularSequence();
- }
- else if ( ( node.getNodeData().getSequence().getAccession() != null )
- && !ForesterUtil.isEmpty( node.getNodeData().getSequence().getAccession().getValue() ) ) {
- if ( !ForesterUtil.isEmpty( node.getNodeData().getSequence().getAccession().getSource() ) ) {
- query = node.getNodeData().getSequence().getAccession().getSource() + "%7C";
+ if ( node.getNodeData().isHasSequence() ) {
+ if ( !ForesterUtil.isEmpty( node.getNodeData().getSequence().getMolecularSequence() ) ) {
+ query = node.getNodeData().getSequence().getMolecularSequence();
+ }
+ if ( ForesterUtil.isEmpty( query ) && ( node.getNodeData().getSequence().getAccession() != null )
+ && !ForesterUtil.isEmpty( node.getNodeData().getSequence().getAccession().getValue() ) ) {
+ final Identifier id = SequenceIdParser.parse( node.getNodeData().getSequence().getAccession()
+ .getValue() );
+ if ( id != null ) {
+ query = id.getValue();
+ }
+ }
+ if ( ForesterUtil.isEmpty( query ) && !ForesterUtil.isEmpty( node.getNodeData().getSequence().getName() ) ) {
+ final Identifier id = SequenceIdParser.parse( node.getNodeData().getSequence().getName() );
+ if ( id != null ) {
+ query = id.getValue();
+ }
+ }
+ if ( ForesterUtil.isEmpty( query ) && !ForesterUtil.isEmpty( node.getNodeData().getSequence().getSymbol() ) ) {
+ final Identifier id = SequenceIdParser.parse( node.getNodeData().getSequence().getSymbol() );
+ if ( id != null ) {
+ query = id.getValue();
+ }