File gen= new File(dir+"/anno/genomes/sacCer1/sacCer1.fa");
FastaReader fr= new FastaReader(gen);
BufferedWriter bw= new BufferedWriter(new FileWriter(new File(dir+"/anno/sacCer1_chr.bed")));
FastaEntry en;
while( (en=fr.nextEntry())!=null ){
String chr= en.getTitle();
int l= en.getSequence().length();
bw.write(chr+"\t0\t"+l+"\t"+chr+"\t0\t+\n");
}
bw.close();