Question: BioJava: How to get All frame 1 to 6 of DNA to Protein translation for All Genetic Code?
0
gravatar for rushikesh4381
3.2 years ago by
rushikesh43810 wrote:

 How to get All frame 1 to 6 of DNA to Protein translation for all Genetic Code using biojava.

ADD COMMENTlink modified 9 days ago by Biostar ♦♦ 20 • written 3.2 years ago by rushikesh43810
1

sounds like homework . what have you tried ?

ADD REPLYlink written 3.2 years ago by Pierre Lindenbaum117k

Looks like you have not tried to write a program and also you have not even tried to search in google as well.

ADD REPLYlink written 3.2 years ago by geek_y9.1k

Below class only translates for Universal genetic code but not for all genetic code ..... i am trying for all conversion for all genetic code

===============================================================

public class Check_Transaltion {

    public static void main(String[] args) {

        String filename = "";
        String type = "";

        try {
            if (args.length != 0) {
                filename = args[0];
                type = args[1].toUpperCase();
            }else{
        //        filename =System.getProperty("java.io.tmpdir")+"/MYOZ1.fasta";
                type="DNA";
                FileOutputStream f = new FileOutputStream(new File("/home/arraygen/Desktop/MYOZ1.fasta"));
                PrintStream ps = new PrintStream(f);
                ps.print(MYOZ1);
                ps.close();
                f.close();
            }

            SymbolTokenization toke = AlphabetManager.alphabetForName(type)
                    .getTokenization("token");

            BufferedReader br = new BufferedReader(new FileReader("/home/arraygen/Desktop/MYOZ1.fasta"));

            SequenceIterator seqi = RichSequence.IOTools.readFasta(br,
                    toke, null);

            // for each sequence
            while (seqi.hasNext()) {
                Sequence seq = seqi.nextSequence();

                // for each frame
                for (int i = 0; i < 3; i++) {
                    SymbolList prot;
                    Sequence trans;

                    // take the reading frame
                    // remember that in a SymbolList the first element has
                    // index= 1
                    // remember that if the length of the list evenly divisible
                    // by three an IllegalArgumentException will be thrown
                    SymbolList syms = seq.subList(i + 1, seq.length()
                            - (seq.length() - i) % 3);

                    // if it is DNA transcribe it to RNA
                    if (syms.getAlphabet() == DNATools.getDNA()) {
                        syms = DNATools.toRNA(syms);
                    }

                    // output forward translation to STDOUT
                    prot = RNATools.translate(syms);
                    trans = SequenceTools.createSequence(prot, "", seq
                            .getName()
                            + "TranslationFrame: +" + i,
                            Annotation.EMPTY_ANNOTATION);

                    /*
                     * This method is deprecated since BioJava 1.5
                     * SeqIOTools.writeFasta(System.out, trans);
                     */
                    RichSequence.IOTools.writeFasta(System.out, trans, null);

                    // output reverse frame translation to STDOUT
                    syms = RNATools.reverseComplement(syms);
                    prot = RNATools.translate(syms);
                    trans = SequenceTools.createSequence(prot, "", seq
                            .getName()
                            + " TranslationFrame: -" + i,
                            Annotation.EMPTY_ANNOTATION);
                    /*
                     * This method is deprecated since BioJava 1.5
                     * SeqIOTools.writeFasta(System.out, trans);
                     */

        //            System.out.println(trans.seqString());
    //                trans.seqString()

                    RichSequence.IOTools.writeFasta(System.out, trans, null);
                }
            }
            br.close();
        } catch (IOException e) {
            e.printStackTrace();
        } catch (IllegalAlphabetException e) {
            e.printStackTrace();
        } catch (NoSuchElementException e) {
            e.printStackTrace();
        } catch (BioException e) {
            e.printStackTrace();
        }
    }

    private static String MYOZ1 = ">gi|21359948|ref|NM_021245.2| Homo sapiens myozenin 1 (MYOZ1), mRNA "
            + "\n"
            + "GTTTCTCCCTAAGTGCTTCTTTGGATCTCAGGCTCTAGGTGCAATGTGAAGGGGAGTCCCTGGGCAGACTGATCCCTGGC"
            + "TCAGACAGTTCAGTGGGAGAATCCCAAAGGCCTTTTCCCTCCTTCCTGAGCCTCCGGGCAAGGAGGGAGGGATCTTGGTT"
            + "CCAGGGTCTCAGTACCCCCTGTGCCATTTGAGCTGCTTGCGCTCATCATCTCTATTAATAACCAACTTCCCTCCCCCACT"
            + "GCCAGTGCTGCCCCCACGCCTGCCCAGCTCGTGTTCTCCGGTCACAGCAGCTCAGTCCTCCAAAGCTGCTGGACCCCAGG"
            + "GAGAGCTGACCACTGCCCGAGCAGCCGGCTGAATCCACCTCCACAATGCCGCTCTCAGGAACCCCGGCCCCTAATAAGAA"
            + "GAGGAAATCCAGCAAGCTGATCATGGAACTCACTGGAGGTGGACAGGAGAGCTCAGGCTTGAACCTGGGCAAAAAGATCA"
            + "GTGTCCCAAGGGATGTGATGTTGGAGGAACTGTCGCTGCTTACCAACCGGGGCTCCAAGATGTTCAAACTGCGGCAGATG"
            + "AGGGTGGAGAAGTTTATTTATGAGAACCACCCTGATGTTTTCTCTGACAGCTCAATGGATCACTTCCAGAAGTTCCTTCC"
            + "AACAGTGGGGGGACAGCTGGGCACAGCTGGTCAGGGATTCTCATACAGCAAGAGCAACGGCAGAGGCGGCAGCCAGGCAG"
            + "GGGGCAGTGGCTCTGCCGGACAGTATGGCTCTGATCAGCAGCACCATCTGGGCTCTGGGTCTGGAGCTGGGGGTACAGGT"
            + "GGTCCCGCGGGCCAGGCTGGCAGAGGAGGAGCTGCTGGCACAGCAGGGGTTGGTGAGACAGGATCAGGAGACCAGGCAGG"
            + "CGGAGAAGGAAAACATATCACTGTGTTCAAGACCTATATTTCCCCATGGGAGCGAGCCATGGGGGTTGACCCCCAGCAAA"
            + "TGAACCCCTGGTCCTCTACAACCAAAACCTCTCCAACAGGCCTTCTTTCAATCGAACCCCTATTCCCTGGCTGAGCTCTG"
            + "GGGAGCCTGTAGACTACAACGTGGATATTGGCATCCCCTTGGATGGAGAAACAGAGGAGCTGTGAGGTGTTTCCTCCTCT"
            + "GATTTGCATCATTTCCCCTCTCTGGCTCCAATTTGGAGAGGGAATGCTGAGCAGATAGCCCCCATTGTTAATCCAGTATC"
            + "CTTATGGGAATGGAGGGAAAAAGGAGAGATCTACCTTTCCATCCTTTACTCCAAGTCCCCACTCCACGCATCCTTCCTCA"
            + "CCAACTCAGAGCTCCCCTTCTACTTGCTCCATATGGAACCTGCTCGTTTATGGAATTTGCTCTGCCACCAGTAACAGTCA"
            + "ATAAACTTCAAGGAAAATGAAAAAAAA";

}

ADD REPLYlink written 3.2 years ago by rushikesh43810
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1904 users visited in the last hour