iCLIP.distance.corr_profile¶
-
iCLIP.distance.corr_profile(profile1, profile2, nspread, profile2_ready=False)¶ Calculate the spearmans correlation coefficient btween two (possibly extended) cross-link profiles.
Parameters: - profile2 (profile1,) – Cross-link profiles. Index is positions, value is counts.
- nspread (int) – Number of bases to extend each profile in each direction
- profile2_ready (bool, optional) – Has profile2 already been reindexed and spread (see below)
Returns: Spearmans correlation coefficient between the two profiles
Return type: float
Notes
During each call profile is reindexed so that bases with no cross-links are included in the index, and cross-links sites are extended.
As this is a slow process, and it is imagined that if randomisaitons are applied to profile1, but profile2 is held constant, it would be more efficent to apply this only once to profile2 and compare it to many randomisaitons of profile1. If profile2_read=True, it is assumed that profile2 is already supplied with 0 count positions indexed and cross-links extended. The can be achieved with:
profile2 = profile2.reindex(range(start, end)) profile2 = profile2.fillna(x) profile2 = profile2.spread(profile2, nspread)A known flaw in this measure of the relationship between two profiles is that if profiles contain many 0s, even if the 0s are in the same positions, the correlation will be low.