Merge Two Sequences With Biojava3?
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.
• 2,659 views
•
link
2 answers
this is the fastest way
String s3 = s1.concat(s2);
or you can use
StringBuffer.append(s2) [Java String buffer][1]
• 0 views
•
link
To be honest with you that looks as good as Java gets.
• 0 views
•
link
Log in to answer this question.