Skip to content

Commit

Permalink
ENH samtools_view is only available in samtools v0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
unode committed Dec 13, 2018
1 parent 55aa365 commit 5d66989
Showing 1 changed file with 21 additions and 11 deletions.
32 changes: 21 additions & 11 deletions NGLess/StandardModules/Samtools.hs
Original file line number Diff line number Diff line change
Expand Up @@ -235,17 +235,27 @@ samtools_view_function = Function
}

loadModule :: T.Text -> NGLessIO Module
loadModule _ =
return def
{ modInfo = ModInfo "stdlib.samtools" "0.1"
, modCitations = [citation]
, modFunctions = [samtools_sort_function, samtools_view_function]
, modTransform = sortOFormat >=> checkUnique
, runFunction = \case
"samtools_sort" -> executeSort
"samtools_view" -> executeView
other -> \_ _ -> throwShouldNotOccur ("samtools runction called with wrong arguments: " ++ show other)
}
loadModule v
| v == "0.0" = return def
{ modInfo = ModInfo "stdlib.samtools" "0.0"
, modCitations = [citation]
, modFunctions = [samtools_sort_function]
, modTransform = sortOFormat >=> checkUnique
, runFunction = \case
"samtools_sort" -> executeSort
other -> \_ _ -> throwShouldNotOccur ("samtools runction called with wrong arguments: " ++ show other)
}
| v == "0.1" = return def
{ modInfo = ModInfo "stdlib.samtools" "0.1"
, modCitations = [citation]
, modFunctions = [samtools_sort_function, samtools_view_function]
, modTransform = sortOFormat >=> checkUnique
, runFunction = \case
"samtools_sort" -> executeSort
"samtools_view" -> executeView
other -> \_ _ -> throwShouldNotOccur ("samtools runction called with wrong arguments: " ++ show other)
}
| otherwise = throwScriptError ("samtools module version " ++ T.unpack v ++ " doesn't exist")
where
citation = T.concat
["'The Sequence Alignment/Map format and SAMtools' "
Expand Down

0 comments on commit 5d66989

Please sign in to comment.