Hello,
I compiled a java file and I tried to execute my program to change embl flat
file to ncbi flat file.
But output file(Toncbi.gbk) is  o byte.


//ex>java embl_togbk embl_sample


import java.io.*;
import java.util.*;
import java.lang.*;
import org.biojava.bio.*;
import org.biojava.bio.seq.*;
import org.biojava.bio.seq.io.*;
import org.biojava.bio.symbol.*;


public class embl_togbk  { 
        public static void main(String[] args) {
                String  fileName = args[0];
                BufferedReader br;
                SequenceIterator seq_iter;
                Sequence seq;
                try {
                        br = new BufferedReader(new FileReader(fileName));
                        seq_iter = SeqIOTools.readEmbl(br);
                        while(seq_iter.hasNext()) {
                                seq =seq_iter.nextSequence();
                                System.out.println(seq.getName());              
                                Iterator feat_iter = seq.features();
                                while(feat_iter.hasNext()) {
                                        Feature f= (Feature) (feat_iter.next());
                                        Annotation annot = f.getAnnotation();
                                        System.out.println("*+feature: "+ 
f.getType());
                                        System.out.println();
                                }
                        }       
        //              System.out.println();
                        SeqIOTools.biojavaToFile("GenBank","dna", new
FileOutputStream("Toncbi.gbk"), seq_iter);

                        br.close();
                }       catch(Exception e) {
                        e.printStackTrace();
                }
        }
}



//-----------------------------------------------
//file:embl_sample 
ID   A1MVRNA2   standard; DNA; 2593 BP.
XX
AC   X01572;
XX
DT   03-AUG-1987  (an correction)
DT   30-JAN-1986  (author review)
DT   17-JUL-1985  (first entry)
XX
DE   Alfalfa mosaic virus (A1M4) RNA 2
XX
KW   unidentified reading frame.
XX
OS   Alfalfa mosaic virus
OC   Viridae; ss-RNA nonenveloped viruses; Alfamovirus.
XX
RN   [1]   (bases 1-2593; enum. 1 to 2593)
RA   Cornelissen B.J.C., Brederode F.T., Veeneman G.H., van Boom J.H.,
RA   Bol J.F.;
RT   "Complete nucleotide sequence of alfalfa mosaic virus RNA 2";
RL   Nucl. Acids Res. 11:3019-3025(1983).
XX
CC   Data kindly reviewed (30-JAN-1986) by J.F. Bol
XX
FH   Key        From     To       Description
FH
FT   TRANSCR    1       80      A1MV RNA 2
FT   CDS        11      80      unidentified reading frame
XX
SQ   Sequence  80 BP;  13 A;  14 C;  21 G;  32 T;
     TTTTTTTTTT ATGCCCCCCCC GGGGGGGGGG TTTTTTTTTT TTTTTTTTTT GGGGGGGGGG
     AAAAAAAAAA CCCCCCCCTAA
//

-------------------------------------------------------
Is there a problem with this code? 
Thank you very much for answer. 

Regards. 

Jessica
-- 
View this message in context: 
http://www.nabble.com/Using-SeqIOTools.biojavaToFile-tf1859886.html#a5079611
Sent from the BioJava forum at Nabble.com.

_______________________________________________
Biojava-l mailing list  -  [email protected]
http://lists.open-bio.org/mailman/listinfo/biojava-l

Reply via email to