[Biojava-l] Reading SCF files

Nick England nickengland at gmail.com
Tue Feb 19 09:53:14 UTC 2013


I get the same error message, it looks like a bug in BioJava parsing
comments from SCF files. My SCF files load fine, but they don't have
comments inside.

Has anyone else seen this problem before?

- Nick

On 18 February 2013 19:48, Janier J. Ramírez
<jjramirez at estudiantes.uci.cu>wrote:

> Traying to read this SCF file, I get the following errors and warnings,
> the fail is at:
>
>  Chromatogram scf = ChromatogramFactory.create(stream);
>
> Warning: the code set (2) is not specifically supported.  (It may still
> work, though.)
> Exception in thread "main" java.lang.IllegalArgumentException: Can't skip
> backwards: (newOffset==0) < (offset==128)
>         at org.biojava.bio.program.scf.SCF$Parser.skipTo(SCF.java:424)
>         at
> org.biojava.bio.program.scf.SCF$Parser.parseComments(SCF.java:384)
>         at org.biojava.bio.program.scf.SCF$Parser.parse(SCF.java:372)
>         at
> org.biojava.bio.program.scf.SCF$ParserFactory.parse(SCF.java:206)
>         at org.biojava.bio.program.scf.SCF.load(SCF.java:149)
>         at org.biojava.bio.program.scf.SCF.create(SCF.java:133)
>         at
> org.biojava.bio.chromatogram.ChromatogramFactory.create(ChromatogramFactory.java:117)
>         at javaapplication1.NewClass.main(NewClass.java:44)
>
>
> And this is my code
>
> public class NewClass {
>
>     public static void main(String[] args)
>             throws Exception {
>         JFileChooser fileChooser = new JFileChooser();
>         fileChooser.setDialogTitle("Abrir");
>         fileChooser.setMultiSelectionEnabled(true);
>
>         int a = JFileChooser.APPROVE_OPTION;
>
>         fileChooser.setFileFilter(new Filtro("scf", ""));
>         if (a == fileChooser.showOpenDialog(null)) {
>
>             File file = fileChooser.getSelectedFile();
>             InputStream stream = new FileInputStream(file);
>
>             Chromatogram scf = ChromatogramFactory.create(stream);
>  /***Here is the fail***/
>
>             stream.close();
>             Alignment data = scf.getBaseCalls();
>             String seq = data.symbolListForLabel("dna").seqString();
>         }
>
>     }
> }
>
> Thanks
>
> ----- Mensaje original -----
> De: "Nick England" <nickengland at gmail.com>
> Para: "Janier J. Ramírez" <jjramirez at estudiantes.uci.cu>
> CC: biojava-l at lists.open-bio.org
> Enviados: Lunes, 18 de Febrero 2013 5:13:12
> Asunto: Re: [Biojava-l] Reading SCF files
>
> Janier,
>
> Here is a snippet which should read in SCF files for you, you will have to
> have BioJava 1.0 for this to work.
>
> File file = new File(String "your path here");
> InputStream stream = new FileInputStream(file);
> Chromatogram scf= ChromatogramFactory.create(stream);
> stream.close();
> Alignment data = scf.getBaseCalls();
> String seq=data.symbolListForLabel("dna").seqString();
>
> Cheers,
>
> Nick
>
>
>
> On 18 February 2013 05:09, Janier J. Ramírez <
> jjramirez at estudiantes.uci.cu > wrote:
>
>
> Yes that's ok, Now I need an example of how given the path of the scf
> file, get the secuence, to them parse it to fasta, or if I can do it
> directly from scf to fasta.
>
> Thanks for your time
>
>
> _______________________________________________
> 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