[Biojava-l] Sequence object size: the sequel...
Schreiber, Mark
mark.schreiber@agresearch.co.nz
Sat, 19 Oct 2002 13:31:12 +1300
Hi -
This is almost certainy because the memory allocated to the JVM at start up has been exceeded by importing such a large sequence.
A simple solution is to allocate more memory to your JVM using the -Xms option:
java -Xms1024M WECBFinder
this will start your program with 1024M (1G) allocated to the JVM stack. Consult you JVM extended features help for the exact syntaxt for your JVM.
- Mark
-----Original Message-----
From: Sylvain Foisy [mailto:sylvain.foisy@bioneq.qc.ca]
Sent: Sat 19/10/2002 3:52 a.m.
To: biojava-l@biojava.org
Cc:
Subject: [Biojava-l] Sequence object size: the sequel...
Hi,
I found why my program would crash with IndexOutOfBound error. I now
have a different problem. Here is my little program for parsing genomic
contigs as found at ftp://ftp.ncbi.nlm.nih.gov/genomes/H_sapiens. I am
using the .fa file for each chromosome.
import java.io.*;
import org.biojava.bio.symbol.*;
import org.biojava.bio.seq.*;
import org.biojava.bio.seq.io.*;
public class WECBFinder
{
public static void main(String[] args)throws IOException
{
BufferedReader inFile;
PrintWriter outFile;
Sequence seq;
String sequence=" ";
String lePath=" ";
int chr;
int nbSequences=0;
try
{
System.out.println("Programme de recuperation de sequences
provenant du genome humain");
System.out.print("Entrer le chromosome desire: ");
BufferedReader stdin=new BufferedReader(new
InputStreamReader(System.in));
chr=Integer.parseInt(stdin.readLine());
System.out.println("Recuperation de la sequence du chromosome "+
chr);
lePath="/databanks/h_sapiens_chr/hs_chr"+chr+".fa";
inFile=new BufferedReader(new FileReader(lePath));
SequenceIterator stream=SeqIOTools.readFastaDNA(inFile);
while(stream.hasNext())
{
seq=stream.nextSequence();
System.out.println(seq.getName());
System.out.println(seq.subStr(1,10));
System.out.println(seq.subStr(seq.length()-9,seq.length()));
nbSequences++;
}
System.out.println("Fin de la lecture du fichier contenant le
chromosome "+chr);
System.out.println("Nbre de sequences individuelles dans le
fichier: "+nbSequences);
}
catch (Exception e)
{
System.err.println(e);
e.printStackTrace();
}
}
}
If I try with chromosome 18, it works very well. When I am using
chromosome 22, I get a java.lang.OutOfMemoryError message. My machine
has 1GB of RAM; I tried it on a 2 GB machine and it works.
Anybody knows a way to make Sequence objects smaller of to circumvent
this problem? I am writing each Sequence object to its own file and then
flushing it to make space for the next one...
I plead guilty: I am considering myself pretty new using BioJava.
Cordially
Sylvain
_______________________________________________
Biojava-l mailing list - Biojava-l@biojava.org
http://biojava.org/mailman/listinfo/biojava-l
=======================================================================
Attention: The information contained in this message and/or attachments
from AgResearch Limited is intended only for the persons or entities
to which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipients is prohibited by AgResearch
Limited. If you have received this message in error, please notify the
sender immediately.
=======================================================================