[khmer] Unique reverse-complement

Bintu, Bogdan bbintu at fas.harvard.edu
Thu Dec 8 05:16:07 PST 2016


Dear Titus,

Great. This solved it.

Thanks,

Bogdan

From: C. Titus Brown<mailto:ctbrown at ucdavis.edu>
Sent: Wednesday, December 7, 2016 8:33 PM
To: Bintu, Bogdan<mailto:bbintu at fas.harvard.edu>
Cc: khmer at lists.idyll.org<mailto:khmer at lists.idyll.org>
Subject: Re: [khmer] Unique reverse-complement



Hi Bogdan,

apparently we changed things in some of our Makefile refactoring -- since
we don't test this regularly, it went unnoticed!

A "proper" fix will have to wait, but for now you can modify lib/kmer_hash.hh
like so:

% diff --git a/lib/kmer_hash.hh b/lib/kmer_hash.hh
----
index 1c6c86f..5b4f5d3 100644
--- a/lib/kmer_hash.hh
+++ b/lib/kmer_hash.hh
@@ -87,11 +87,7 @@ Contact: khmer-project at idyll.org
 #endif

 // choose wisely between forward and rev comp.
-#ifndef NO_UNIQUE_RC
-#define uniqify_rc(f, r) ((f) < (r) ? (f) : (r))
-#else
 #define uniqify_rc(f,r)(f)
-#endif


 namespace khmer
---

That is, remove the #ifndef, first #define, #else, and #endif from that
file so it just says 'uniqify_rc(f,r)(f)'.

You'll be happy to know that soonish we may have a supported way to do
this at runtime rather than compole time!

--titus

On Thu, Dec 08, 2016 at 12:51:04AM +0000, Bintu, Bogdan wrote:
> P.S.
> I originally started with the indications in the link:
> http://lists.idyll.org/pipermail/khmer/2013-June/000394.html
> Another person was trying to achieve the same thing as I am and had similar issues. He managed to solve the problem
>
> ?by adding -dNO_UNIQUE_RC=1 to CXXFLAGS explicitly?
> in the Makefile in the root khmer folder.
> I did not figure out where exactly to add this. I also do not know whether this person?s reported bug was fixed in later versions.
> Regards,
> Bogdan
>
>
> From: Bintu, Bogdan<mailto:bbintu at fas.harvard.edu>
> Sent: Wednesday, December 7, 2016 4:21 PM
> To: C. Titus Brown<mailto:ctbrown at ucdavis.edu>
> Cc: khmer at lists.idyll.org<mailto:khmer at lists.idyll.org>
> Subject: RE: [khmer] Unique reverse-complement
>
>
> Dear Titus,
>
> Thanks for the prompt reply.
>
> Tried what you suggested but sadly it did not solve it.
>
> Any other suggestion?
>
> Regards,
>
> Bogdan
>
>
>
> From: C. Titus Brown<mailto:ctbrown at ucdavis.edu>
> Sent: Wednesday, December 7, 2016 3:32 PM
> To: Bintu, Bogdan<mailto:bbintu at fas.harvard.edu>
> Cc: khmer at lists.idyll.org<mailto:khmer at lists.idyll.org>
> Subject: Re: [khmer] Unique reverse-complement
>
>
>
> On Wed, Dec 07, 2016 at 08:18:31PM +0000, Bintu, Bogdan wrote:
> > Dear Dr. Brown,
> >
> > I am a graduate student using your khmer package.
> > I am trying to construct a khmer.Countgraph which is not degenerate between a sequence and its reverse complement.
> > More explicitly, in python when running:
> >
> > import Khmer
> > ht = khmer.Countgraph(17,10,1)
> > ht.consume('GGCTTGCTCCAGCCATG')
> > ht.get('CATGGCTGGAGCAAGCC')
> >
> > I would like the last line to return 0.
> >
> > As suggested in a different thread I tired modifying NO_UNIQUE_RC=0 to NO_UNIQUE_RC=1 in lib/Makefile and then run python setup.py install.
> > But this did not solve my issue.
> >
> > Any help would be appreciated.
>
> Hi Bogdan,
>
> thanks for the email!
>
> Can you try doing:
>
> make clean
> python setup.py install
>
> after the modification?  That should work.
>
> thanks,
> --titus
> --
> C. Titus Brown, ctbrown at ucdavis.edu

--
C. Titus Brown, ctbrown at ucdavis.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idyll.org/pipermail/khmer/attachments/20161208/b56e7dbb/attachment.htm>


More information about the khmer mailing list