[Biojava-l] Why am I getting ClassCastExceptions

Sylvain Foisy sylvain.foisy at bioneq.qc.ca
Fri May 2 13:37:15 EDT 2003


Hi,

I am looking for motifs in promoter regions of genes as read from the
massive *.gbk files from the human genome. When a hit is found in a
region forward of a gene, I am seeking the CDS that is inside this gene
and I want the full info on that CDS:

//Part of the code. leCDSHolder keeps the CDS folder feature found like
//this:
// FeatureFilter leSpan=new FeatureFilter.ContainedByLocation(span);
// FeatureHolder leSpanHolder=seq.filter(leSpan);
// FeatureFilter leCDS=new FeatureFilter.ByType("CDS");
// FeatureHolder leCDSHolder=leSpanHolder.filter(leCDS);
 for (Iterator iterZ=leCDSHolder.features();iterZ.hasNext(); )
 {
	System.out.println("+ Corresponding CDS");
        Feature featZ=(Feature)iterZ.next();
        Annotation annotY=featZ.getAnnotation();
 
       Set lesAnnot=annotY.keys();
       Iterator iterY=lesAnnot.iterator();
                            
        while(iterY.hasNext()){
          String laProp=(String)iterY.next();
          String laPropVal=(String)annotY.getProperty(laProp);//***
          System.out.println("+ \t\t"+laProp+": "+laPropVal);
        }

When I run this, I get the following execution:

++++++++
+ Seq. 1
+	NT_010641 Homo sapiens chromosome 17 genomic contig.
+
++++++++
++ Hit 1
++++++++
+ Nom du gene: LOC348211
+ Position du gene: [8850703,8856937]
+
+ Corresponding CDS
+ 		gene: LOC348211
+ 		protein_id: XP_302684.1
java.lang.ClassCastException
	at IndianaGene.main(IndianaGene.java:186)//The line with ***

For different chr, this exception will occured after a protein_id, a
db_xref, etc. I am guessing that the files are at fault but I do not
know why. Are they fixable? I am using biojava-live ant his exception
occurs both with my Mac laptop and my RH box, both running Java 1.4.1.

As usual, any help would be appreciated

Sylvain
 
--------------------------------------------------------
Sylvain Foisy, Ph. D.
Directeur operations - Project Manager
BioneQ - Reseau quebecois de bio-informatique
U de Montreal / Genome-Quebec
Pav. Andre-Aisenstadt, Local 4351
Montreal, QC H3T 1J8
Telephone: (514) 343-6111 x.4066
Courriel: sylvain.foisy at bioneq.qc.ca
-------------------------------------------------------



More information about the Biojava-l mailing list