[Biojava-l] RES: Alignment Viewer

mark.schreiber at novartis.com mark.schreiber at novartis.com
Thu Jun 29 07:36:05 UTC 2006


The following example works for me. Let me know if it causes problems for 
you.

- Mark

/*
 * SeqDBExample.java
 *
 * Created on June 29, 2006, 3:23 PM
 *
 */

package db;

import org.biojava.bio.seq.DNATools;
import org.biojava.bio.seq.ProteinTools;
import org.biojava.bio.seq.RNATools;
import org.biojava.bio.seq.Sequence;
import org.biojava.bio.seq.db.HashSequenceDB;
import org.biojava.bio.seq.db.SequenceDB;
import org.biojava.bio.seq.io.SeqIOTools;

/**
 *
 * @author
 */
public class SeqDBExample {
 
    private SequenceDB db;
 
    /** Creates a new instance of SeqDBExample */
    public SeqDBExample() {
        db = new HashSequenceDB();
    }
 
    public void test() throws Exception{
        //create 3 sequences
        Sequence rna = RNATools.createRNASequence("auggc", "rna seq");
        Sequence dna = DNATools.createDNASequence("atggc", "dna seq");
        Sequence prot = ProteinTools.createProteinSequence("HVFST", "prot 
seq");
 
        //add them to the DB
        db.addSequence(rna); db.addSequence(dna); db.addSequence(prot);
 
        //get them back and print them to the screen
        SeqIOTools.writeFasta(System.out, db.getSequence("rna seq"));
        SeqIOTools.writeFasta(System.out, db.getSequence("dna seq"));
        SeqIOTools.writeFasta(System.out, db.getSequence("prot seq"));
 
    }
 
 
    public static void main(String[] args) throws Exception{
        SeqDBExample example = new SeqDBExample();
        example.test();
    }
}






"Anderson Moura da Silva" <anderson.moura at telemar-rj.com.br>
06/28/2006 09:52 PM

 
        To:     <mark.schreiber at novartis.com>
        cc: 
        Subject:        RES: [Biojava-l] Alignment Viewer


Well,

I've created a HashSequenceDB and then I need to load from a customized 
XML file, many sequences of DNA, RNA or Protein Alphabet.

I don't have the code here now but i did something like this:

//Check whether it's DNA, RNA or Protein in a loop

if (alphabet=="DNA"){
                 sym = createDNASequence(sequence_string, name_sequence);
                 Sequence = createSequence(sym , null, name_sequence, 
null);
}
else if (alphabet=="RNA"){
                 sym = createRNASequence(sequence_string, name_sequence);
                 sequence = createSequence(sym , null, name_sequence, 
null);
}
else if (alphabet=="PROTEIN_TERM"){
                 sym = createProteinSequence(sequence_string, 
name_sequence);
                 sequence = createSequence(sym , null, name_sequence, 
null);
}
hashSequenceDB.addSequence(name_sequence,sequence);

//end of the loop

then in another class, I try to get back the sequences doing this passing 
the var name_sequence as a parameter:

hashSequenceDB.getSequence(name_sequence);

//but it aways give me back a null pointer type error.

If you can help I'd be glad!

Thanks
Anderson Moura - Brazil

-----Mensagem original-----
De: mark.schreiber at novartis.com [mailto:mark.schreiber at novartis.com]
Enviada em: terça-feira, 27 de junho de 2006 22:43
Para: Anderson Moura da Silva
Cc: biojava-l at lists.open-bio.org; biojava-l-bounces at lists.open-bio.org
Assunto: Re: [Biojava-l] Alignment Viewer


Hi -

I don't think there is an alignment viewer officially although I know that 

people have written them. Maybe someone would like to contribute theirs to 

the list??

Can you give more detailed information about your SequenceDB bug? Biojava 
version, example code etc?

Thanks,

- Mark

Mark Schreiber
Research Investigator (Bioinformatics)

Novartis Institute for Tropical Diseases (NITD)
10 Biopolis Road
#05-01 Chromos
Singapore 138670
www.nitd.novartis.com

phone +65 6722 2973
fax  +65 6722 2910





"Anderson Moura da Silva" <anderson.moura at telemar-rj.com.br>
Sent by: biojava-l-bounces at lists.open-bio.org
06/27/2006 07:59 PM

 
        To:     <biojava-l at lists.open-bio.org>
        cc:     (bcc: Mark Schreiber/GP/Novartis)
        Subject:        [Biojava-l] Alignment Viewer


Hi everyone,

Does BioJava implements a Alignment Panel like SequencePanel? Is it 
possible to put colors in it like ClustalW?
I Used the SequencePanel but not in colors, is it possible to put colors 
on this one?

Another question: The SequenceDB can only store sequences of one type? I'm 

asking it because I tryed to save sequences using ProteinTools, RNATools 
and DNATools on the same SequenceDB and I was not able to get this 
sequences back using the ID of the sequence. Is it wrong to put more than 
one type of sequence on the same SequenceDB?

Thank you a lot

Anderson Moura - Brasil


Esta mensagem, incluindo seus anexos, pode conter informações 
privilegiadas e/ou de caráter confidencial, não podendo ser retransmitida 
sem autorização do remetente. Se você não é o destinatário ou pessoa 
autorizada a recebê-la, informamos que o seu uso, divulgação, cópia ou 
arquivamento são proibidos. Portanto, se você recebeu esta mensagem por 
engano, por favor, nos informe respondendo imediatamente a este e-mail e 
em seguida apague-a.


_______________________________________________
Biojava-l mailing list  -  Biojava-l at lists.open-bio.org
http://lists.open-bio.org/mailman/listinfo/biojava-l










More information about the Biojava-l mailing list