anchor.diff:                  | InclusionThreshold pList      -> pList |> List.map InclusionThresholdOptions.make       |> List.concat
                   | ModelSpecificThreshold pList  -> pList |> List.map ModelSpecificThresholdOptions.make   |> List.concat
                   | AccelerationHeuristics pList  -> pList |> List.map AccelerationHeuristicsOptions.make   |> List.concat
  -                | Miscellaneous   pList         -> pList |> List.map MiscellaneousOptions.make            |> List.concat+                | Miscellaneous   pList         -> pList |> List.map MiscellaneousOptions.make            |> List.concat
  +
  +        let runHMMscanAsync (bcContext:BioContainer.BcContext) (opt:HMMscanParams list) = 
  +            //Usage: hmmscan [-options] <hmmdb> <seqfile>
  +            let hmmDB     = 
  +                opt 
  +                |> List.filter (fun p -> match p with |InputHMMDB _ -> true |_ -> false)
  +                |> fun x -> if List.isEmpty x then
  +                                failwith "no input hmm db given"
  +                            else 
  +                                HMMscanParams.makeCmdWith bcContext.Mount x.[0]
  +
  +            let inSeq     = 
  +                opt 
  +                |> List.filter (fun p -> match p with |InputSequenceFile _ -> true |_ -> false)
  +                |> fun x -> if List.isEmpty x then
  +                                failwith "no input sequence file given"
  +                            else 
  +                                HMMscanParams.makeCmdWith bcContext.Mount x.[0]
  +
  +            let options = opt |> List.filter (fun p -> match p with |InputHMMDB _ |InputSequenceFile _ -> false |_ -> true)
  +            let cmds = (options |> List.map (HMMscanParams.makeCmdWith bcContext.Mount))
  +            let tp = ("hmmscan"::(cmds |> List.concat))@hmmDB@inSeq
  +
  +            printfn "Starting process hmmscan\r\nparameters:"
  +            printfn "%s" hmmDB.[0]
  +            printfn "%s" inSeq.[0]
  +            cmds |> List.iter (fun op -> printfn "\t%s" (String.concat " " op))
  +
  +            async {
  +                    let! res = BioContainer.execAsync bcContext tp           
  +                    return res
  + 
  +            }
  +
  +        ///hmmscan is used to search protein sequences against collections of protein profiles.
  +        ///For each sequence in seqfile, use that query sequence to search the target database
  +        ///of profiles in hmmdb, and output ranked lists of the profiles with the most significant
  +        ///matches to the sequence
  +        let runHMMscan (bcContext:BioContainer.BcContext) (opt:HMMscanParams list) =
  +            runHMMscanAsync bcContext opt
  +            |> Async.RunSynchronously
  +
  +
  +    ///hmmpress - prepare a profile database for hmmscan
  +    module HMMpress =
  +        
  +        type HMMpressParams = 
  +            ///HMM profile to construct the binary compressed datafiles from
  +            | HMMInputFile of string
  +            ///overwrites any previous hmmpress’ed datafiles
  +            | ForceOverwirite 
  +
  +            static member makeCmd =
  +                function
  +                | HMMInputFile path     -> [path]
  +                | ForceOverwirite       -> ["-f"]
  +
  +            static member makeCmdWith (m:MountInfo) =
  +                let cPath p = (MountInfo.containerPathOf m p)
  +                function
  +                | HMMInputFile path     -> [cPath path]
  +                | ForceOverwirite       -> ["-f"]
  +
  +        let runHMMpressAsync (bcContext:BioContainer.BcContext) (opt:HMMpressParams list) = 
  +            //Usage: hmmpress [options] hmmfile
  +            let hmm     = 
  +                opt 
  +                |> List.filter (fun p -> match p with |HMMInputFile _ -> true |_ -> false)
  +                |> fun x -> if List.isEmpty x then
  +                                failwith "no input hmm db given"
  +                            else 
  +                                HMMpressParams.makeCmdWith bcContext.Mount x.[0]
  +
  +            let options = opt |> List.filter (fun p -> match p with |HMMInputFile _ -> false |_ -> true)
  +            let cmds = (options |> List.map (HMMpressParams.makeCmdWith bcContext.Mount))
  +            let tp = ("hmmpress"::(cmds |> List.concat))@hmm
  +
  +            printfn "Starting process hmmpress\r\nparameters:"
  +            printfn "%s" hmm.[0]
  +            cmds |> List.iter (fun op -> printfn "\t%s" (String.concat " " op))
  +
  +            async {
  +                    let! res = BioContainer.execAsync bcContext tp           
  +                    return res
  + 
  +            }
  +
  +        ///Constructs binary compressed datafiles for hmmscan, starting from a profile database
  +        ///hmmfile in standard HMMER3 format. The hmmpress step is required for hmmscan to work.
  +        let runHMMpress (bcContext:BioContainer.BcContext) (opt:HMMpressParams list) =
  +            runHMMpressAsync bcContext opt
  +            |> Async.RunSynchronously
  +
  +
  +    module HMMconvert =
  +
  +    //Usage: hmmconvert [-options] <hmmfile>
  +
  +    //Options:
  +    //  -h           : show brief help on version and usage
  +    //  -a           : ascii:  output models in HMMER3 ASCII format  [default]
  +    //  -b           : binary: output models in HMMER3 binary format
  +    //  -2           : HMMER2: output backward compatible HMMER2 ASCII format (ls mode)
  +    //  --outfmt <s> : choose output legacy 3.x file formats by name, such as '3/a'
  +
  +        type OutputFormatOptions = 
  +            | ASCII
  +            | Binary
  +            | HMMER2
  +
  +            static member make = function
  +                | ASCII     -> ["-a"]
  +                | Binary    -> ["-b"]
  +                | HMMER2    -> ["-2"]
  +
  +        type HMMconvertParams =
  +            | HMMInputFile of string
  +            | OutputFormat of OutputFormatOptions list
  +            | LegacyFormat of string
  +
  +            static member make = function
  +                | HMMInputFile path     -> [path]
  +                | OutputFormat pList    -> pList |> List.map OutputFormatOptions.make |> List.concat
  +                | LegacyFormat f        -> ["--outfmt"; f]
  +
  +            static member makeCmdWith (m:MountInfo) =
  +                let cPath p = (MountInfo.containerPathOf m p)
  +                function
  +                | HMMInputFile path     -> [cPath path]
  +                | OutputFormat pList    -> pList |> List.map OutputFormatOptions.make |> List.concat
  +                | LegacyFormat f        -> ["--outfmt"; f]
  +
  +        let runHMMconvertAsync (bcContext:BioContainer.BcContext) (opt:HMMconvertParams list) = 
  +        //Usage: hmmconvert [options] hmmfile
  +            let hmm     = 
  +                opt 
  +                |> List.filter (fun p -> match p with |HMMInputFile _ -> true |_ -> false)
  +                |> fun x -> if List.isEmpty x then
  +                                failwith "no input hmm given"
  +                            else 
  +                                HMMconvertParams.makeCmdWith bcContext.Mount x.[0]
  +
  +            let options = opt |> List.filter (fun p -> match p with |HMMInputFile _ -> false |_ -> true)
  +            let cmds = (options |> List.map (HMMconvertParams.makeCmdWith bcContext.Mount))
  +            let tp = ("hmmconvert"::(cmds |> List.concat))@hmm
  +
  +            printfn "Starting process hmmconvert\r\nparameters:"
  +            printfn "%s" hmm.[0]
  +            cmds |> List.iter (fun op -> printfn "\t%s" (String.concat " " op))
  +
  +            async {
  +                    let! res = BioContainer.execAsync bcContext tp           
  +                    return res
  + 
  +            }
  +
  +        ///The hmmconvert utility converts an input profile file to different HMMER formats
  +        let runHMMconvert (bcContext:BioContainer.BcContext) (opt:HMMconvertParams list) =
  +            runHMMconvertAsync bcContext opt
  +            |> Async.RunSynchronously
positive.code: 
  
          let runHMMalignAsync (bcContext:BioContainer.BcContext) (opt:HMMalignParams list) = 
              //Usage: hmmbuild [-options] <hmmfile_out> <msafile> -> filter for in/out and move them to the end
              let hmm     = 
                  opt 
                  |> List.filter (fun p -> match p with |InputHMMFile _ -> true |_ -> false)
  
negative.code:             //Usage: hmmsearch [options] <hmmfile> <seqdb>
  
          let runHMMsearchAsync (bcContext:BioContainer.BcContext) (opt:HMMsearchParams list) = 
              //hmmsearch [options] hmmfile seqdb
              let hmm     = 
                  opt 
                  |> List.filter (fun p -> match p with |InputHMMFile _ -> true |_ -> false)
  