Fixing Haskell Bioinformatic Library

Thanks Ketil

En días pasados arregle un problema con una librería escrita en Haskell para análisis bioinformatico y le sugerí al desarrollador ( Ketil ) sobre la solución y bueno..la tomo en cuenta y yo aprendí Haskell😉

Blog original: http://blog.malde.org/index.php/the-haskell-bioinformatics-library/

Solución:

you will need to download and to install tagsoup 0.4

download from here:

http://hackage.haskell.org/package/tagsoup-0.4

then,  use following commands to install it :

runhaskell Setup configure
runhaskell Setup configure – -user
runhaskell Setup build
runhaskell Setup install

download bio-0.4 haskell source packages, then edit bio.cabal file like this:

Build-Depends: base>=3 && =1.2.0.0, binary, tagsoup= 0.9.1, containers, array,
parallel, parsec, random, old-time, mtl

QuickCheck to >=1.2 and tagsoup =1.2.0.0: using QuickCheck-2.1.0.3
Dependency tagsoup <=0.4: using tagsoup-0.4

ok, now install biohaskell lib using:

runhaskell Setup configure – -user
runhaskell Setup build

opps !!  you will see following error :

[18 of 43] Compiling Bio.Sequence.TwoBit ( Bio/Sequence/TwoBit.hs, dist/build/Bio/Sequence/TwoBit.o )

Bio/Sequence/TwoBit.hs:37:31:
Module `Test.QuickCheck’ does not export `check’

Fix ?, let’s do it,  open Bio/Sequence/TwoBit.hs haskell source file and locate line 37 with your vi or emacs editor

by default you will see:

import Test.QuickCheck hiding (check) — QC 1.0
– – import Test.QuickCheck hiding ((.&.)) — QC 2.0

please,  apply changes like :

– – import Test.QuickCheck hiding (check) — QC 1.0
import Test.QuickCheck hiding ((.&.)) — QC 2.0

this change is because I am using QuickCheck 2

ok, good , we are try to build once again :

runhaskell Setup build

opps error again :

[35 of 43] Compiling Bio.Util.TestBase ( Bio/Util/TestBase.hs, dist/build/Bio/Util/TestBase.o )

Bio/Util/TestBase.hs:81:4:
`coarbitrary’ is not a (visible) method of class `Arbitrary’

Bio/Util/TestBase.hs:85:4:
`coarbitrary’ is not a (visible) method of class `Arbitrary’

Bio/Util/TestBase.hs:90:4:
`coarbitrary’ is not a (visible) method of class `Arbitrary’

Bio/Util/TestBase.hs:98:4:
`coarbitrary’ is not a (visible) method of class `Arbitrary’

Bio/Util/TestBase.hs:105:4:
`coarbitrary’ is not a (visible) method of class `Arbitrary’

Bio/Util/TestBase.hs:109:4:
`coarbitrary’ is not a (visible) method of class `Arbitrary’

Bio/Util/TestBase.hs:117:4:
`coarbitrary’ is not a (visible) method of class `Arbitrary’

Bio/Util/TestBase.hs:125:4:
`coarbitrary’ is not a (visible) method of class `Arbitrary’

Bio/Util/TestBase.hs:132:4:
`coarbitrary’ is not a (visible) method of class `Arbitrary’

you will need to edit bio.cabal, find Bio.Util.TestBase and delete it then save file.

runhaskell Setup install
Installing library in $HOME/.cabal/lib/bio-0.4/ghc-6.12.1
Registering bio-0.4…

ls $HOME/.cabal/lib/bio-0.4/ghc-6.12.1/
Bio HSbio-0.4.o libHSbio-0.4.a

ready, that’s all

ketil, what’s your opinion ?

2 thoughts on “Fixing Haskell Bioinformatic Library

  1. Hey, you need to tell me about posts like this! There’s a new version of bio out, hopefully it fixes these issues (mostly by limiting versions of its dependencies) – if you try it out, let me know how it goes.

    Basically the problem is library dependencies – when I specify libraries bio depends on (“Build-Depends” in the file bio.cabal), I specify them open-ended, requiring only a minimum version. When new versions arrive, you can build bio against them, and usually the new version will be faster and have fewer bugs. Sometimes, something changes that breaks stuff:

    QuickCheck 2 removed the coarbitrary method from the Arbitrary class. Later, they also added instances for Word8 (something I had defined in bio). Tagsoup – at version 0.8, I think – changed the type of a tag.

    Anyway: if things don’t work the way you expect, don’t hesitate to email me (ketil (a) malde . org).

    -K

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s