Safe Haskell | None |
---|---|
Language | Haskell2010 |
- class BEDLike b where
- data BED = BED {
- _chrom :: !ByteString
- _chromStart :: !Int
- _chromEnd :: !Int
- _name :: !(Maybe ByteString)
- _score :: !(Maybe Double)
- _strand :: !(Maybe Bool)
- data BED3 = BED3 !ByteString !Int !Int
- data NarrowPeak = NarrowPeak {}
- 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 :: BEDLike b => Int -> b -> [b]
- splitBedBySize :: BEDLike b => Int -> b -> [b]
- splitBedBySizeLeft :: BEDLike b => Int -> b -> [b]
- splitBedBySizeOverlap :: BEDLike 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] -> Conduit b1 m b1
- intersectBedWith :: (BEDLike b1, BEDLike b2, Monad m) => ([b2] -> a) -> [b2] -> Conduit b1 m (b1, a)
- intersectSortedBed :: (BEDLike b1, BEDLike b2, Monad m) => Sorted (Vector b2) -> Conduit b1 m b1
- intersectSortedBedWith :: (BEDLike b1, BEDLike b2, Monad m) => ([b2] -> a) -> Sorted (Vector b2) -> Conduit b1 m (b1, a)
- isOverlapped :: (BEDLike b1, BEDLike b2) => b1 -> b2 -> Bool
- mergeBed :: (BEDLike b, Monad m) => [b] -> Source m b
- mergeBedWith :: (BEDLike b, Monad m) => ([b] -> a) -> [b] -> Source m a
- mergeSortedBed :: (BEDLike b, Monad m) => Sorted (Vector b) -> Source m b
- mergeSortedBedWith :: (BEDLike b, Monad m) => ([b] -> a) -> Sorted (Vector b) -> Source m a
- splitOverlapped :: BEDLike b => ([b] -> a) -> [b] -> [(BED3, a)]
- hReadBed :: (BEDLike b, MonadIO m) => Handle -> Source m b
- hReadBed' :: (BEDLike b, MonadIO m) => Handle -> m [b]
- readBed :: (BEDLike b, MonadIO m) => FilePath -> Source m b
- readBed' :: (BEDLike b, MonadIO m) => FilePath -> m [b]
- hWriteBed :: (BEDLike b, MonadIO m) => Handle -> Sink b m ()
- hWriteBed' :: (BEDLike b, MonadIO m) => Handle -> [b] -> m ()
- writeBed :: (BEDLike b, MonadIO m) => FilePath -> Sink b m ()
- writeBed' :: (BEDLike b, MonadIO m) => FilePath -> [b] -> m ()
- fetchSeq :: (BioSeq DNA a, MonadIO m) => Genome -> Conduit BED m (Either String (DNA a))
- fetchSeq' :: (BioSeq DNA a, MonadIO m) => Genome -> [BED] -> m [Either String (DNA a)]
- motifScan :: (BEDLike b, MonadIO m) => Genome -> [Motif] -> Bkgd -> Double -> Conduit b m BED
- getMotifScore :: MonadIO m => Genome -> [Motif] -> Bkgd -> Conduit BED m BED
- getMotifPValue :: Monad m => Maybe Double -> [Motif] -> Bkgd -> Conduit BED m BED
- 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).
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
chrom :: b -> ByteString Source #
Field accessor
chromStart :: b -> Int Source #
bedName :: b -> Maybe ByteString Source #
bedScore :: b -> Maybe Double Source #
bedStrand :: b -> Maybe Bool Source #
convert :: BEDLike b' => b' -> b Source #
Return the size of a bed region.
BED6 format
BED6 format, as described in http://genome.ucsc.edu/FAQ/FAQformat.html#format1.7
BED3 format
BED3 !ByteString !Int !Int |
NarrowPeak format
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 :: BEDLike b => Int -> b -> [b] Source #
split a bed region into k consecutive subregions, discarding leftovers
splitBedBySize :: BEDLike b => Int -> b -> [b] Source #
split a bed region into consecutive fixed size subregions, discarding leftovers
splitBedBySizeLeft :: BEDLike b => Int -> b -> [b] Source #
split a bed region into consecutive fixed size subregions, including leftovers
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] -> Conduit b1 m b1 Source #
return records in A that are overlapped with records in B
intersectBedWith :: (BEDLike b1, BEDLike b2, Monad m) => ([b2] -> a) -> [b2] -> Conduit b1 m (b1, a) Source #
intersectSortedBed :: (BEDLike b1, BEDLike b2, Monad m) => Sorted (Vector b2) -> Conduit b1 m b1 Source #
return records in A that are overlapped with records in B
intersectSortedBedWith :: (BEDLike b1, BEDLike b2, Monad m) => ([b2] -> a) -> Sorted (Vector b2) -> Conduit b1 m (b1, a) Source #
mergeSortedBedWith :: (BEDLike b, Monad m) => ([b] -> a) -> Sorted (Vector b) -> Source m a 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 :: (BEDLike b, MonadIO m) => Handle -> Source m b Source #
Read records from a bed file handler in a streaming fashion.
readBed :: (BEDLike b, MonadIO m) => FilePath -> Source m b Source #
Read records from a bed file in a streaming fashion.
Utilities
fetchSeq :: (BioSeq DNA a, MonadIO m) => Genome -> Conduit BED m (Either String (DNA a)) Source #
retreive sequences
motifScan :: (BEDLike b, MonadIO m) => Genome -> [Motif] -> Bkgd -> Double -> Conduit b m BED Source #
Identify motif binding sites
getMotifScore :: MonadIO m => Genome -> [Motif] -> Bkgd -> Conduit BED m BED Source #
Retrieve motif matching scores