Examples of FastaEntry


Examples of fork.lib.bio.seq.FastaEntry

    int size= 1;
   
   
    FrequencyCount<String> fcg= new FrequencyCount();
    FastaReader frg= new FastaReader(genomef);
    FastaEntry eng;
    while( (eng=frg.nextEntry())!=null ){
        String s= eng.getSequence();
        for( int i=0; i<s.length()-size; i++ ){
            String ss= s.substring(i, i+size);
            fcg.add(ss);
        }
    }
    Object[] ks= fcg.getSortedKeys();
   
   
    File[] fs= d.listFiles();
    for( int j=0; j<fs.length; j++ ){
        File f= fs[j];
        if(FileName.getExt(f).equals("fasta")){
            FastaReader fr= new FastaReader(f);
            FastaEntry en;
            FrequencyCount<String> fc= new FrequencyCount<>();


            while( (en=fr.nextEntry())!=null ){
                String s= en.getSequence();
                for( int i=0; i<s.length()-size; i++ ){
                    String ss= s.substring(i, i+size);
                    fc.add(ss);
                }
            }
View Full Code Here

Examples of fork.lib.bio.seq.FastaEntry

    FastaExporter fe= new FastaExporter(out);
    Iterator<GenomicRegion> it= gb.iterator();
    while(it.hasNext()){
        GenomicRegion gr= it.next();
        String seq= get.getSequence(gr);
        fe.appendEntry(new FastaEntry(gr.toUCSCFormat(), seq));
        String cseq = NucleotideSequenceParser.parseSequence(seq).complementary().toString();
        DirectionalGenomicRegion cgr= new DirectionalGenomicRegion(gr.chr, '-', (int)gr.low, (int)gr.high);
        fe.appendEntry(new FastaEntry( cgr.toUCSCFormat(), cseq));
    }
    fe.close();
}
View Full Code Here

Examples of fork.lib.bio.seq.FastaEntry

    File dir= Dirs.getFile("dir");
   
    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();
   
}
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.