Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
  • 5 commits
  • 5 files changed
  • 0 commit comments
  • 1 contributor
View
2  HMMArby.hs
@@ -71,7 +71,7 @@ instance Arbitrary HMMNode where
where toScoreVec = U.fromList . map toScore
instance Arbitrary TProbs where
- arbitrary = TProbs <$> p <*> p <*> p <*> p <*> p <*> p <*> p <*> p <*> p
+ arbitrary = mkTransProbs <$> p <*> p <*> p <*> p <*> p <*> p <*> p
where p = arbitrary
-- Fix this so that only legal transitions are allowed.
View
1  HMMProps.hs
@@ -21,6 +21,7 @@ hmmProps = [ ("ubProp", property ubProp)
, ("buProp", property buProp)
, ("blockNoMergeProp", property blockNoMergeProp)
, ("mergeMergeProp", property mergeMergeProp)
+ , ("Viterbi admissible", property viterbiAdmissible)
]
View
13 LazySearchModel.hs
@@ -125,7 +125,8 @@ unHistory (History a) = a
-- history. It requires as a precondition that the input be infinite
-- and that the first state be useful.
-- @ start stop.tex
-type SearchStop a = [CCosted (Utility (Scored a))] -> History a
+type SearchStop pt =
+ [CCosted (Utility (Scored pt))] -> History pt
-- @ end stop.tex
@@ -197,7 +198,7 @@ everyPt sg cost startPt = do
tagged <- zipWithM costedUtility successors [succ cost..]
let (useless, CCosted (Useful newPt) newCost : _) =
span (isUseless . unCCosted) tagged
- ((CCosted (Useful startPt) cost : useless) ++) <$>
+ (++) (CCosted (Useful startPt) cost : useless) <$>
everyPt sg newCost newPt
where costedUtility pt cost =
utility sg move >>= \u -> return $ CCosted u cost
@@ -208,10 +209,10 @@ everyPt sg cost startPt = do
--------------------------------------------------------
-- @ start search.tex
-search :: RandomGen r
- => SearchStrategy pt r -> Rand r (History pt)
-search (SS strat test) =
- fmap test . everyPt strat 0 =<< pt0 strat
+search :: RandomGen r => SearchGen pt r -> SearchStop pt
+ -> Rand r (History pt)
+search strat test =
+ return . test =<< everyPt strat 0 =<< pt0 strat
-- @ end search.tex
data FullSearchStrategy placement r =
View
33 MRFTypes.hs
@@ -8,7 +8,7 @@ module MRFTypes
, Exposure(..), mkExposure
, Direction(..), mkDirection
, BetaStrand(..), BetaPosition, BetaResidue(..), BetaPair(..)
- , TProb(..), TProbs(..)
+ , TProb(..), TProbs, m_m, m_i, m_d, i_m, i_i, d_m, d_d, b_m, m_e
, mkTransProb, mkTransProbs
, mkScore
, showBetas
@@ -53,28 +53,29 @@ data StateLabel = Mat | Ins | Del | Beg | End
| BMat -- keeping secrets from our readers...
deriving (Show, Ord, Eq, Enum, Ix)
--- @ start tprobs.tex
+-- @ start tprob-tprobs.tex
+newtype TProb = TProb { logProbability :: Score }
+-- @ end tprob-tprobs.tex
+ deriving (Show)
+
+-- @ start tprob-tprobs.tex
data TProbs = TProbs
{ m_m :: TProb, m_i :: TProb, m_d :: TProb
, i_m :: TProb, i_i :: TProb
- , d_m :: TProb, d_d :: TProb
--- @ end tprobs.tex
+-- @ end tprob-tprobs.tex
+ ---GROSS HACKERY (these are in the middle to prevent a bad page break in the paper)
, b_m :: TProb -- XXX aren't these just taking up space in the cache lines?
, m_e :: TProb
--- @ start tprobs.tex
- }
--- @ end tprobs.tex
+-- @ start tprob-tprobs.tex
+ , d_m :: TProb, d_d :: TProb }
+-- @ end tprob-tprobs.tex
deriving (Show)
--- mkTransProbs :: [Score] -> TProbs
-mkTransProbs t0 t1 t2 t3 t4 t5 t6 = TProbs t0 t1 t2 t3 t4 t5 t6
- (mkTransProb Beg Mat negLogZero)
- (mkTransProb Mat End negLogZero)
-
--- @ start tprob.tex
-newtype TProb = TProb { logProbability :: Score }
--- @ end tprob.tex
- deriving (Show)
+-- | Don't ask. Probably something foul to do with HMMER
+mkTransProbs :: TProb -> TProb -> TProb -> TProb -> TProb -> TProb -> TProb -> TProbs
+mkTransProbs t0 t1 t2 t3 t4 t5 t6 =
+ TProbs t0 t1 t2 t3 t4 nlz nlz t5 t6 -- gross, gross, gross
+ where nlz = TProb negLogZero
mkTransProb :: StateLabel -> StateLabel -> Score -> TProb
mkTransProb f t s = TProb s
View
3  Perturb.hs
@@ -433,12 +433,15 @@ distinctPerturbations p1 p2 (Plan7 ss) =
where bs = blockify ss
disjoint s s' = Set.null $ s `Set.intersection` s'
+shrinkPred p = fmap (all p . shrink) arbitrary
+
perturbProps :: [(String, Property)]
perturbProps = [ ("diagonal", property diagonalProp)
, ("diagonalCount", property diagonalsCount)
, ("good-metrics", property goodMetrics)
, ("nop7dups", property noP7Dups)
, ("plan7gen", property isPlan7Prop)
+ , ("plan7gen-shrink", property $ shrinkPred $ isPlan7Prop)
, ("rightMoversPermutes", property rightMoversPermutesProp)
, ("allMoversInvariant",
property $ preservesInvariants $ withStates allMovers)

No commit comments for this range

Something went wrong with that request. Please try again.