Re: Reading SCF files

Nick England <[email protected]>
Newsgroups gmane.comp.java.bio.general
Message-ID <CAHKPz+9DEp28sk_rhORK=YFw3sYr77sUsaOarauxzGsJfkrz3g@mail.gmail.com>
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
<[email protected]>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" <[email protected]>
> Para: "Janier J. Ramírez" <[email protected]>
> CC: [email protected]
> 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 <
> [email protected] > 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 - [email protected]
> http://lists.open-bio.org/mailman/listinfo/biojava-l
>
>

_______________________________________________
Biojava-l mailing list  -  [email protected]
http://lists.open-bio.org/mailman/listinfo/biojava-l
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.