[Biojava-l] Biojava-l Digest, Vol 105, Issue 2
Muhammad Tariq Pervez
tariq_cp at hotmail.com
Mon Oct 10 16:27:27 UTC 2011
Yes, the issue was also faced by me.
I also highlighted the solution.
The solution has also been uploaded/updated in SVN.
Muhammad Tariq Pervez
PhD Scholar
> From: biojava-l-request at lists.open-bio.org
> Subject: Biojava-l Digest, Vol 105, Issue 2
> To: biojava-l at lists.open-bio.org
> Date: Wed, 5 Oct 2011 12:00:04 -0400
>
> Send Biojava-l mailing list submissions to
> biojava-l at lists.open-bio.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://lists.open-bio.org/mailman/listinfo/biojava-l
> or, via email, send a message with subject or body 'help' to
> biojava-l-request at lists.open-bio.org
>
> You can reach the person managing the list at
> biojava-l-owner at lists.open-bio.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Biojava-l digest..."
>
>
> Today's Topics:
>
> 1. NullPointerException when using
> Alignments.getMultipleSequenceAlignment (Hannes Brandst?tter-M?ller)
> 2. Re: NullPointerException when using
> Alignments.getMultipleSequenceAlignment (Hannes Brandst?tter-M?ller)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Wed, 5 Oct 2011 09:41:57 +0200
> From: Hannes Brandst?tter-M?ller <biojava at hannes.oib.com>
> Subject: [Biojava-l] NullPointerException when using
> Alignments.getMultipleSequenceAlignment
> To: biojava-l at lists.open-bio.org
> Message-ID:
> <CAPXi2mnpLujT=dvEQkLxFpih1sv6pe_-vob2vJJd-axOu4jr_w at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Hello!
>
> I tried to follow http://biojava.org/wiki/BioJava:CookBook3:MSA, but
> when I run it, I get:
>
> java.util.concurrent.ExecutionException: java.lang.NullPointerException
> at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222)
> at java.util.concurrent.FutureTask.get(FutureTask.java:83)
> at org.biojava3.alignment.Alignments.getListFromFutures(Alignments.java:282)
> at org.biojava3.alignment.Alignments.runPairwiseScorers(Alignments.java:602)
> at org.biojava3.alignment.Alignments.getMultipleSequenceAlignment(Alignments.java:173)
>
> What could I be doing wrong?
>
> (
> on the cookbook page, there is also an import missing:
> import org.biojava3.alignment.Alignments;
> )
> -> then the cookbook runs, but my code does not
>
> private static void processFile(String filename) {
> try {
> FileInputStream inStream = new FileInputStream(filename);
> FastaReader<DNASequence, NucleotideCompound> fastaReader =
> new FastaReader<DNASequence, NucleotideCompound>(
> inStream,
> new GenericFastaHeaderParser<DNASequence,
> NucleotideCompound>(),
> new DNASequenceCreator(DNACompoundSet.getDNACompoundSet()));
> LinkedHashMap<String, DNASequence> b = fastaReader.process();
>
> List<DNASequence> sequences = new ArrayList<DNASequence>();
> for (Entry<String, DNASequence> entry : b.entrySet()) {
> if (sequences.size() < 5) {
> sequences.add(entry.getValue());
> }
> System.out.println(entry.getValue());
> }
>
> Profile<DNASequence, NucleotideCompound> profile =
> Alignments.getMultipleSequenceAlignment(sequences);
> System.out.printf("Clustalw:%n%s%n", profile);
>
> ConcurrencyTools.shutdown();
> } catch (Exception ex) {
> Logger.getLogger(App.class.getName()).log(Level.SEVERE, null, ex);
> }
> }
>
>
> ------------------------------
>
> Message: 2
> Date: Wed, 5 Oct 2011 10:50:33 +0200
> From: Hannes Brandst?tter-M?ller <biojava at hannes.oib.com>
> Subject: Re: [Biojava-l] NullPointerException when using
> Alignments.getMultipleSequenceAlignment
> To: biojava-l at lists.open-bio.org
> Message-ID:
> <CAPXi2mnRE07CAtbUV6bTB8G7wHzSkK543GrB8dc7s4JoUzkp=Q at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Hi!
>
> I read the sequence from a fasta file.
>
> FileInputStream inStream = new FileInputStream(filename);
> FastaReader<DNASequence, NucleotideCompound> fastaReader =
> new FastaReader<DNASequence, NucleotideCompound>(
> inStream,
> new GenericFastaHeaderParser<DNASequence,
> NucleotideCompound>(),
> new DNASequenceCreator(DNACompoundSet.getDNACompoundSet()));
> LinkedHashMap<String, DNASequence> b = fastaReader.process();
>
> and then use
> List<DNASequence> sequences = new ArrayList<DNASequence>();
> for (Entry<String, DNASequence> entry : b.entrySet()) {
> sequences.add(entry.getValue());
> }
>
> to get the required list of DNA sequences.
>
> I noticed in an earlier discussion, there was some talk about this too
> (3-4 months ago, perhaps) and something about a possible fix in SVN.
> when will it be released on the maven server?
>
> Hannes
>
> On Wed, Oct 5, 2011 at 10:46, Hashem Koohy <hk3 at sanger.ac.uk> wrote:
> > Hi Hannes,
> > It seems to me it doesn't like your ?dna Sequence!
> > Is your sequence in the following format?
> >
> > Sequence dnaSeq = DNATools.createDNASequence("acccgggttttacagt", "id");
> >
> > Good luck
> > Hashem
> >
> > On 05/10/2011 08:41, "Hannes Brandst?tter-M?ller" <biojava at hannes.oib.com>
> > wrote:
> >
> >> Hello!
> >>
> >> I tried to follow http://biojava.org/wiki/BioJava:CookBook3:MSA, but
> >> when I run it, I get:
> >>
> >> java.util.concurrent.ExecutionException: java.lang.NullPointerException
> >> at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222)
> >> at java.util.concurrent.FutureTask.get(FutureTask.java:83)
> >> at org.biojava3.alignment.Alignments.getListFromFutures(Alignments.java:282)
> >> at org.biojava3.alignment.Alignments.runPairwiseScorers(Alignments.java:602)
> >> at
> >> org.biojava3.alignment.Alignments.getMultipleSequenceAlignment(Alignments.java
> >> :173)
> >>
> >> ?What could I be doing wrong?
> >>
> >> (
> >> on the cookbook page, there is also an import missing:
> >> import org.biojava3.alignment.Alignments;
> >> )
> >> -> then the cookbook runs, but my code does not
> >>
> >> private static void processFile(String filename) {
> >> ? ? ? ? try {
> >> ? ? ? ? ? ? FileInputStream inStream = new FileInputStream(filename);
> >> ? ? ? ? ? ? FastaReader<DNASequence, NucleotideCompound> fastaReader =
> >> ? ? ? ? ? ? ? ? ? ? new FastaReader<DNASequence, NucleotideCompound>(
> >> ? ? ? ? ? ? ? ? ? ? inStream,
> >> ? ? ? ? ? ? ? ? ? ? new GenericFastaHeaderParser<DNASequence,
> >> NucleotideCompound>(),
> >> ? ? ? ? ? ? ? ? ? ? new
> >> DNASequenceCreator(DNACompoundSet.getDNACompoundSet()));
> >> ? ? ? ? ? ? LinkedHashMap<String, DNASequence> b = fastaReader.process();
> >>
> >> ? ? ? ? ? ? List<DNASequence> sequences = new ArrayList<DNASequence>();
> >> ? ? ? ? ? ? for (Entry<String, DNASequence> entry : b.entrySet()) {
> >> ? ? ? ? ? ? ? ? if (sequences.size() < 5) {
> >> ? ? ? ? ? ? ? ? ? ? sequences.add(entry.getValue());
> >> ? ? ? ? ? ? ? ? }
> >> ? ? ? ? ? ? ? ? System.out.println(entry.getValue());
> >> ? ? ? ? ? ? }
> >>
> >> ? ? ? ? ? ? Profile<DNASequence, NucleotideCompound> profile =
> >> Alignments.getMultipleSequenceAlignment(sequences);
> >> ? ? ? ? ? ? System.out.printf("Clustalw:%n%s%n", profile);
> >>
> >> ? ? ? ? ? ? ConcurrencyTools.shutdown();
> >> ? ? ? ? } catch (Exception ex) {
> >> ? ? ? ? ? ? Logger.getLogger(App.class.getName()).log(Level.SEVERE, null, ex);
> >> ? ? ? ? }
> >> ? ? }
> >> _______________________________________________
> >> Biojava-l mailing list ?- ?Biojava-l at lists.open-bio.org
> >> http://lists.open-bio.org/mailman/listinfo/biojava-l
> >
> > -------------------------------
> > Hashem Koohy
> > PhD
> > Postdoctoral Fellow,
> > Sanger Institute,
> > Cambridge
> > Mobile: 07515425433
> >
> >
> >
> >
> > --
> > ?The Wellcome Trust Sanger Institute is operated by Genome Research
> > ?Limited, a charity registered in England with number 1021457 and a
> > ?company registered in England with number 2742969, whose registered
> > ?office is 215 Euston Road, London, NW1 2BE.
> >
>
>
>
> ------------------------------
>
> _______________________________________________
> Biojava-l mailing list - Biojava-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/biojava-l
>
>
> End of Biojava-l Digest, Vol 105, Issue 2
> *****************************************
More information about the Biojava-l
mailing list