[Biojava-l] Problems with Annotations

Sylvain Foisy sylvain.foisy at bioneq.qc.ca
Tue Feb 25 15:30:10 EST 2003


Hi,

I want to scan portions of sequences for motifs. I am trying to modify the
annotation for the sequence so that each time a motif is found, I get a new
annotation of the form "Motif x"+original annotation. It works when I print
it on the terminal with System.out but when I try to save the sequences with
the modified annotation, my written file only contains the original
annotation.

My code:

Sequence uneFenetre=new SubSequence(seq,position,fin);
Annotation annot2=uneFenetre.getAnnotation();
String descrip=(String) annot2.getProperty("description");
                   
//Stuff removed for the sake of clarity
                  
if (m.find()==true)
{
    System.out.print("\tEureka!!\t"+m.group());
    nbMotif++;

String hit=" Seek"+nbMotif+descrip;

annot2.setProperty("description",hit);
dbHits.addSequence(uneFenetre);//A SequenceDB that contains all the hits
System.out.println((String)annot2.getProperty("description"));

}

PrintStream aCreer = new PrintStream( new FileOutputStream(pathHits));
SeqIOTools.writeFasta(aCreer,dbHits);
aCreer.close();


I tried also the ViewSequence trick of BioJava in anger to change the name
rather than the annotation. It is not working either.

Any inputs would be appreciated

Sylvain


=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
Sylvain Foisy, Ph. D
Directeur - operations / Project Manager
BioneQ - Reseau quebecois de bioinformatique
Universite de Montreal/Genome-Quebec

Addresse postale:
Universite de Montreal
Dept de biochimie
C.P. 6128, succ. Centre-Ville
Montreal, QC
H3C 3J7

Tel.: (514) 343-6111 x.4066

E-Mail:sylvain.foisy at bioneq.qc.ca
=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=





More information about the Biojava-l mailing list