[Biojava-dev] Extended ABIF Parser and SCF Writer

Richard Holland holland at eaglegenomics.com
Fri Jun 19 15:00:49 UTC 2009


Sorry I haven't been following the thread... what problem is this a
solution for?

thanks,
Richard

On Fri, 2009-06-19 at 09:52 -0500, Franklin Bristow wrote:
> Hi Richard,
> I've written a very small private class that extends ABIFChromatogram.  This
> class has a method that basically copies what you have done in
> ABIFChromatogram when you load a file as an ABIFChromatogram, specifically:
> 
> >         /**
> >          * Create an instance of an ExtendedABIFChromatogram using the
> > supplied
> >          * file. This is meant to be called in lieu of the static create
> > method
> >          * that is found in {@link ABIFChromatogram}.
> >          *
> >          * @param f
> >          *            the ABIF formatted file
> >          * @return an instance of ExtendedABIFChromatogram
> >          * @throws UnsupportedChromatogramFormatException
> >          *             the file supplied is not an ABIF formatted
> > chromatogram
> >          * @throws IOException
> >          *             if an I/O error occurs
> >          */
> >         public ExtendedABIFChromatogram createExtended(File f)
> >                 throws UnsupportedChromatogramFormatException, IOException
> > {
> >             new Parser(f);
> >             return this;
> >         }
> >
> This removes the need for using reflection to alter the accessibility of the
> methods.
> 
> I've attached the updated code to this message, I hope that you will allow
> it through your filters again.  Thanks again for having a look at my code!
> 
> Thanks,
> Franklin
> 
> On Fri, Jun 19, 2009 at 12:23 AM, <mark.schreiber at novartis.com> wrote:
> 
> >
> > Hi Franklin -
> >
> > If there is a good argument for making the protected setBaseCallAlignment
> > method public then we could look at changing this so you don't need to use
> > reflection.  As you say in your code comments this reflection will not work
> > unless the security policy allows it which will not be the case in many
> > systems.
> >
> > Another alternative would be to modify ABIFChromatogram and provide a
> > public method that lets people safely call the setBaseCallAlignment
> > (requires write access to the SVN). Finally you could extend
> > ABIFChromatogram and add a public method that will call the protected method
> > (of course this won't work if the method is private).
> >
> > Nice to see well documented code!
> >
> > - Mark
> >
> > biojava-dev-bounces at lists.open-bio.org wrote on 06/19/2009 10:31:13 AM:
> >
> >
> > > Hi Everyone,
> > > I've just spent the last few days putting together an extended ABIF
> > parser
> > > and and SCF writer.  The parser that I wrote extends the existing
> > ABIFParser
> > > but takes into account much of the information that was made available a
> > few
> > > years ago when ABI released the ABIF File Format specification (
> > > http://www.appliedbiosystems.
> > > com/support/software_community/ABIF_File_Format.pdf).
> > > I've heavily based my code and methods on the perl implementation of the
> > > ABIF parser Bio::Trace::ABIF by Nicola Vitacolonna.
> > >
> > > I also wrote a writer for SCF formatted chromatograms.  I wrote this
> > mostly
> > > using the documentation found in the staden formats documentation (
> > > http://staden.sourceforge.net/manual/formats_unix_2.html and
> > > http://iubio.bio.indiana.edu/soft/molbio/molbio.
> > > old/staden/www_pages/scf-rfc.html
> > > ).
> > >
> > > Finally, I have written a small utility class that will prepare an
> > > ABIFChromatogram for writing out as an SCF formatted file.  This is the
> > > entire reason that I wrote both of the above classes.  I will admit that
> > > there is a pretty nasty hack in the SCFUtils class, but it was the
> > quickest
> > > way I could think of doing what I needed to do.  I use reflection in
> > order
> > > to make a protected method accessible so that I could set the value
> > myself
> > > without having to subclass ABIFChromatogram.  Of course, I would like to
> > > change this but the circumstances under which I have had to write this
> > code
> > > forced me to do it this way for now.
> > >
> > > All of this code is written for Java 5, but if it is necessary to change
> > it
> > > for inclusion into your source tree I will make the change.
> > >
> > > So, I welcome comments and suggestions on how I can improve this to make
> > it
> > > appealing enough to have it included in biojava in the future.
> > >
> > > Since the code is rather long, I've attached it as a zip file.  Andreas
> > told
> > > me that he would keep an eye on the filters for it and would let it
> > through
> > > when he saw it, so hopefully it makes it through okay.
> > >
> > > Thanks everyone for your time!
> > >
> > > --
> > > Franklin
> > > [attachment "ABIFParser.zip" deleted by Mark Schreiber/GP/Novartis]
> > > _______________________________________________
> > > biojava-dev mailing list
> > > biojava-dev at lists.open-bio.org
> > > http://lists.open-bio.org/mailman/listinfo/biojava-dev
> >
> > _________________________
> >
> > CONFIDENTIALITY NOTICE
> >
> > The information contained in this e-mail message is intended only for the
> > exclusive use of the individual or entity named above and may contain
> > information that is privileged, confidential or exempt from disclosure under
> > applicable law. If the reader of this message is not the intended recipient,
> > or the employee or agent responsible for delivery of the message to the
> > intended recipient, you are hereby notified that any dissemination,
> > distribution or copying of this communication is strictly prohibited. If you
> > have received this communication in error, please notify the sender
> > immediately by e-mail and delete the material from any computer.  Thank you.
> >
> 
> 
> 
> _______________________________________________
> biojava-dev mailing list
> biojava-dev at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/biojava-dev
-- 
Richard Holland, BSc MBCS
Operations and Delivery Director, Eagle Genomics Ltd
T: +44 (0)1223 654481 ext 3 | E: holland at eaglegenomics.com
http://www.eaglegenomics.com/




More information about the biojava-dev mailing list