iCLIP.utils.rand_apply¶
-
iCLIP.utils.rand_apply(profile, exon, n, func, keep_dist=False, *args, **kwargs)¶ Randomise a profile multiple times and apply a function to each randomised profile.
Parameters: - profile (pandas.Series) – profile to randomise, as produced by a *_getter function.
- exon (CGAT.GTF.Entry or iCLIP.LiteExon) – Object with :attribute:`start` and :attribute:`end` specifying the boundaries to randomise between.
- n (int) – The number of randomisations to perform
- func (callable) – A function-like object to call on each randomised profile. The profile will be passed as the first argument to the function.
- keep_dist (bool, optional) – Maintain cross-links-per-base distribution when randomising
- **kwargs (*args,) –
Further arguments to func
Returns: Return type depends on the return type of func. Generally a Series with the entries as the same return type as func. However, if func returns Series and all series are of the same length, a pandas.DataFrame may be returned.
Return type: pandas.Series or pandas.DataFrame
See also
randomiseSites()- Does the actual work of randomising.