Hello, There appears to be a problem when writing a sequence to file in EMBL format, but only if it contains a multiple of 60 nucleotides (there are 60 nt's on each line): the last line of nucleotides is not written and the nucleotide-count of the last line is incorrect.
Example code below and example sequence files in attachment.
Best regards,
Stein Aerts.
________________________________________
import org.biojava.bio.seq.io.*;
import org.biojava.bio.seq.*;
import java.io.*;
public class TestEmbl {
public static void main(String[] args) throws Exception {
Sequence seq = null;
BufferedReader br = new BufferedReader(new
FileReader("D:\\SAE\\temp\\test_in.embl"));
SequenceIterator stream = SeqIOTools.readEmbl(br);
if (stream.hasNext()){
seq = stream.nextSequence();
}
SequenceFormat format = new EmblLikeFormat();
OutputStream out = new FileOutputStream("D:\\SAE\\temp\\test_out.embl");
format.writeSequence(seq, new PrintStream(out));
}
}
test_out.embl
Description: Binary data
test_in.embl
Description: Binary data
