public String splice ( DNASequence sequence ) { StringBuilder subData = new StringBuilder ( ) ; Location last = null ; for ( FeatureI f : this ) { Location loc = f . location ( ) ; if ( last == null || loc . startsAfter ( last ) ) { subData . append ( sequence . getSubSequence ( loc . start ( ) , loc . end ( ) ) . toString ( ) ) ; last = loc ; } else { throw new IllegalStateException ( "Splice: Feature locations should not overlap." ) ; } } return subData . toString ( ) ; }
Concatenate successive portions of the specified sequence using the feature locations in the list . The list is assumed to be appropriately ordered .