Safe Haskell | None |
---|---|
Language | Haskell2010 |
- class BEDLike b where
- class BEDLike b => BEDConvert b where
- data BED
- data BED3
- data NarrowPeak
- npSignal :: Lens' NarrowPeak Double
- npPvalue :: Lens' NarrowPeak (Maybe Double)
- npQvalue :: Lens' NarrowPeak (Maybe Double)
- npPeak :: Lens' NarrowPeak (Maybe Int)
- data BEDExt bed a = BEDExt {}
- _bed :: forall bed a bed. Lens (BEDExt bed a) (BEDExt bed a) bed bed
- _data :: forall bed a a. Lens (BEDExt bed a) (BEDExt bed a) a a
- type BEDTree a = HashMap ByteString (IntervalMap Int a)
- bedToTree :: BEDLike b => (a -> a -> a) -> [(b, a)] -> BEDTree a
- sortedBedToTree :: (BEDLike b, Foldable f) => (a -> a -> a) -> Sorted (f (b, a)) -> BEDTree a
- intersecting :: BEDLike b => BEDTree a -> b -> IntervalMap Int a
- isIntersected :: BEDLike b => BEDTree a -> b -> Bool
- sizeOverlapped :: (BEDLike b1, BEDLike b2) => b1 -> b2 -> Int
- splitBed :: BEDConvert b => Int -> b -> [b]
- splitBedBySize :: BEDConvert b => Int -> b -> [b]
- splitBedBySizeLeft :: BEDConvert b => Int -> b -> [b]
- splitBedBySizeOverlap :: BEDConvert b => Int -> Int -> b -> [b]
- newtype Sorted b = Sorted {
- fromSorted :: b
- sortBed :: BEDLike b => [b] -> Sorted (Vector b)
- intersectBed :: (BEDLike b1, BEDLike b2, Monad m) => [b2] -> ConduitT b1 b1 m ()
- intersectBedWith :: (BEDLike b1, BEDLike b2, Monad m) => (b1 -> [b2] -> a) -> [b2] -> ConduitT b1 a m ()
- intersectSortedBed :: (BEDLike b1, BEDLike b2, Monad m) => Sorted (Vector b2) -> ConduitT b1 b1 m ()
- intersectSortedBedWith :: (BEDLike b1, BEDLike b2, Monad m) => (b1 -> [b2] -> a) -> Sorted (Vector b2) -> ConduitT b1 a m ()
- isOverlapped :: (BEDLike b1, BEDLike b2) => b1 -> b2 -> Bool
- mergeBed :: (BEDConvert b, Monad m) => [b] -> ConduitT i b m ()
- mergeBedWith :: (BEDLike b, Monad m) => ([b] -> a) -> [b] -> ConduitT i a m ()
- mergeSortedBed :: (BEDConvert b, Monad m) => Sorted (Vector b) -> ConduitT i b m ()
- mergeSortedBedWith :: (BEDLike b, Monad m) => ([b] -> a) -> Sorted (Vector b) -> ConduitT i a m ()
- splitOverlapped :: BEDLike b => ([b] -> a) -> [b] -> [(BED3, a)]
- hReadBed :: (BEDConvert b, MonadIO m) => Handle -> ConduitT i b m ()
- hReadBed' :: (BEDConvert b, MonadIO m) => Handle -> m [b]
- readBed :: (BEDConvert b, MonadIO m) => FilePath -> ConduitT i b m ()
- readBed' :: (BEDConvert b, MonadIO m) => FilePath -> m [b]
- hWriteBed :: (BEDConvert b, MonadIO m) => Handle -> ConduitT b o m ()
- hWriteBed' :: (BEDConvert b, MonadIO m) => Handle -> [b] -> m ()
- writeBed :: (BEDConvert b, MonadIO m) => FilePath -> ConduitT b o m ()
- writeBed' :: (BEDConvert b, MonadIO m) => FilePath -> [b] -> m ()
- fetchSeq :: (BioSeq DNA a, MonadIO m) => Genome -> ConduitT BED (Either String (DNA a)) m ()
- fetchSeq' :: (BioSeq DNA a, MonadIO m) => Genome -> [BED] -> m [Either String (DNA a)]
- motifScan :: (BEDLike b, MonadIO m) => Genome -> [Motif] -> Bkgd -> Double -> ConduitT b BED m ()
- getMotifScore :: MonadIO m => Genome -> [Motif] -> Bkgd -> ConduitT BED BED m ()
- getMotifPValue :: Monad m => Maybe Double -> [Motif] -> Bkgd -> ConduitT BED BED m ()
- compareBed :: (BEDLike b1, BEDLike b2) => b1 -> b2 -> Ordering
Documentation
class BEDLike b where Source #
A class representing BED-like data, e.g., BED3, BED6 and BED12. BED format uses 0-based index (see documentation).
class BEDLike b => BEDConvert b where Source #
asBed :: ByteString -> Int -> Int -> b Source #
Construct bed record from chromsomoe, start location and end location
fromLine :: ByteString -> b Source #
Convert bytestring to bed format
toLine :: b -> ByteString Source #
Convert bed to bytestring
BEDConvert NarrowPeak Source # | |
BEDConvert BED3 Source # | |
BEDConvert BED Source # | |
(Default a, Read a, Show a, BEDConvert bed) => BEDConvert (BEDExt bed a) Source # | |
BED6 format, as described in http://genome.ucsc.edu/FAQ/FAQformat.html#format1.7
data NarrowPeak Source #
ENCODE narrowPeak format: https://genome.ucsc.edu/FAQ/FAQformat.html#format12
type BEDTree a = HashMap ByteString (IntervalMap Int a) Source #
sortedBedToTree :: (BEDLike b, Foldable f) => (a -> a -> a) -> Sorted (f (b, a)) -> BEDTree a Source #
Convert a set of sorted bed records to interval tree, with combining function for equal keys.
intersecting :: BEDLike b => BEDTree a -> b -> IntervalMap Int a Source #
splitBed :: BEDConvert b => Int -> b -> [b] Source #
split a bed region into k consecutive subregions, discarding leftovers
splitBedBySize :: BEDConvert b => Int -> b -> [b] Source #
split a bed region into consecutive fixed size subregions, discarding leftovers
splitBedBySizeLeft :: BEDConvert b => Int -> b -> [b] Source #
split a bed region into consecutive fixed size subregions, including leftovers
splitBedBySizeOverlap Source #
:: BEDConvert b | |
=> Int | bin size |
-> Int | overlap size |
-> b | |
-> [b] |
a type to imply that underlying data structure is sorted
Sorted | |
|
sortBed :: BEDLike b => [b] -> Sorted (Vector b) Source #
sort BED, first by chromosome (alphabetical order), then by chromStart, last by chromEnd
intersectBed :: (BEDLike b1, BEDLike b2, Monad m) => [b2] -> ConduitT b1 b1 m () Source #
return records in A that are overlapped with records in B
intersectBedWith :: (BEDLike b1, BEDLike b2, Monad m) => (b1 -> [b2] -> a) -> [b2] -> ConduitT b1 a m () Source #
intersectSortedBed :: (BEDLike b1, BEDLike b2, Monad m) => Sorted (Vector b2) -> ConduitT b1 b1 m () Source #
return records in A that are overlapped with records in B
intersectSortedBedWith :: (BEDLike b1, BEDLike b2, Monad m) => (b1 -> [b2] -> a) -> Sorted (Vector b2) -> ConduitT b1 a m () Source #
mergeSortedBed :: (BEDConvert b, Monad m) => Sorted (Vector b) -> ConduitT i b m () Source #
mergeSortedBedWith :: (BEDLike b, Monad m) => ([b] -> a) -> Sorted (Vector b) -> ConduitT i a m () Source #
splitOverlapped :: BEDLike b => ([b] -> a) -> [b] -> [(BED3, a)] Source #
Split overlapped regions into non-overlapped regions. The input must be overlapped.
This function is usually used with mergeBedWith
.
hReadBed :: (BEDConvert b, MonadIO m) => Handle -> ConduitT i b m () Source #
Read records from a bed file handler in a streaming fashion.
readBed :: (BEDConvert b, MonadIO m) => FilePath -> ConduitT i b m () Source #
Read records from a bed file in a streaming fashion.
hWriteBed' :: (BEDConvert b, MonadIO m) => Handle -> [b] -> m () Source #
Utilities
fetchSeq :: (BioSeq DNA a, MonadIO m) => Genome -> ConduitT BED (Either String (DNA a)) m () Source #
retreive sequences
motifScan :: (BEDLike b, MonadIO m) => Genome -> [Motif] -> Bkgd -> Double -> ConduitT b BED m () Source #
Identify motif binding sites
getMotifScore :: MonadIO m => Genome -> [Motif] -> Bkgd -> ConduitT BED BED m () Source #
Retrieve motif matching scores