MACS3.Signal.Pileup module
Module Description: For pileup functions.
This code is free software; you can redistribute it and/or modify it under the terms of the BSD License (see the file LICENSE included with the distribution).
- MACS3.Signal.Pileup.PosVal(*args, **kwargs)
- MACS3.Signal.Pileup.bool(*args, **kwargs)
- MACS3.Signal.Pileup.c_quick_pileup(*args, **kwargs)
- MACS3.Signal.Pileup.c_single_end_pileup(*args, **kwargs)
- MACS3.Signal.Pileup.c_write_pv_array_to_bedGraph(*args, **kwargs)
- MACS3.Signal.Pileup.clean_up_ndarray(x)
Clean up numpy array in two steps
- MACS3.Signal.Pileup.fix_coordinates(poss, rlength)
Fix the coordinates.
- Return type:
_fake_callable
- MACS3.Signal.Pileup.free(*args, **kwargs)
- MACS3.Signal.Pileup.mean(a, b)
- Return type:
float
- MACS3.Signal.Pileup.naive_call_peaks(pv_array, min_v, max_v=1e+30, max_gap=50, min_length=200)
- MACS3.Signal.Pileup.naive_quick_pileup(sorted_poss, extension)
Simple pileup, every tag will be extended left and right with length extension.
Note: Assumption is that poss has to be pre-sorted! There is no check on whether it’s sorted.
- Return type:
list
- MACS3.Signal.Pileup.over_two_pv_array(pv_array1, pv_array2, func='max')
Merge two position-value arrays. For intersection regions, take the maximum value within region.
pv_array1 and pv_array2 are [p,v] type lists, same as the output from quick_pileup function. ‘p’ and ‘v’ are numpy arrays of int32 and float32.
available operations are ‘max’, ‘min’, and ‘mean’
- Return type:
list
- MACS3.Signal.Pileup.pileup_and_write_pe(petrackI, output_filename, scale_factor=1, baseline_value=0.0)
Pileup a PETrackI object and write the pileup result into a bedGraph file.
This function calls pure C functions from cPosValCalculation.
This function is currently only used macs3 pileup cmd.
- MACS3.Signal.Pileup.pileup_and_write_se(trackI, output_filename, d, scale_factor, baseline_value=0.0, directional=True, halfextension=True)
Pileup a FWTrackI object and write the pileup result into a bedGraph file.
This function calls pure C functions from cPosValCalculation.
This function is currently only used macs3 pileup cmd.
- MACS3.Signal.Pileup.quick_pileup(start_poss, end_poss, scale_factor, baseline_value)
Return pileup given plus strand and minus strand positions of fragments.
A super-fast and simple algorithm proposed by Jie Wang. It will take sorted start positions and end positions, then compute pileup values.
It will return a pileup result in similar structure as bedGraph. There are two numpy arrays:
[end positions, values] or [p,v]
Two arrays have the same length and can be matched by index. End position at index x (p[x]) record continuous value of v[x] from p[x-1] to p[x].
- Return type:
list
- MACS3.Signal.Pileup.se_all_in_one_pileup(plus_tags, minus_tags, five_shift, three_shift, rlength, scale_factor, baseline_value)
Return pileup given 5’ end of fragment at plus or minus strand separately, and given shift at both direction to recover a fragment. This function is for single end sequencing library only. Please directly use ‘quick_pileup’ function for Pair-end library.
It contains a super-fast and simple algorithm proposed by Jie Wang. It will take sorted start positions and end positions, then compute pileup values.
It will return a pileup result in similar structure as bedGraph. There are two python arrays:
[end positions, values] or ‘[p,v] array’ in other description for functions within MACS3.
Two arrays have the same length and can be matched by index. End position at index x (p[x]) record continuous value of v[x] from p[x-1] to p[x].
- Return type:
list