Merge Two Sequences With Biojava3?
2
0
Entering edit mode
12.3 years ago
Lexxx233 ▴ 20

I want to merge DNASequence together , Is there any quick way to do this? Currently I have to get DNA sequences to Strings, concatenate them, then construct a new DNASequence from the newly concatenated strings.

e.g

DNASequence result = new DNASequence("ACGT");
result = new DNASequence(result.getSequenceAsString() + otherSequence.getSequenceAsString());

This does not look very nice and probably not the best performance either.

biojava java • 2.3k views
ADD COMMENT
1
Entering edit mode
12.0 years ago
Medhat 9.8k

this is the fastest way

String s3 = s1.concat(s2);

or you can use

StringBuffer.append(s2)  [Java String buffer][1]
ADD COMMENT
0
Entering edit mode
12.3 years ago

To be honest with you that looks as good as Java gets.

ADD COMMENT

Login before adding your answer.

Traffic: 1313 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6