data/nora2012/make_processed_files.py
def extract_region(matrix, region_start, region_end):
    """
    Extracts a region from a matrix produced by parse_5C_file.
    Returns the reverse and forward restriction fragments in the region
    and the part of the matrix covered by the region
    """
    land = np.logical_and
    region_row_mask = land(matrix[:,0] >= region_start, matrix[:,1] <= region_end)
    region_col_mask = land(matrix[0,:] >= region_start, matrix[1,:] <= region_end)
    region = matrix[region_row_mask]
    region = region[:,region_col_mask]

    region_fors = matrix[region_row_mask, :2]
    region_revs = matrix[:2, region_col_mask]
    fragment_lengths = np.concatenate((region_fors[:,1] - region_fors[:,0],
                                       region_revs[1,:] - region_revs[0,:])).astype(int)

    return region_revs, region_fors, region

    Extracts a region from a matrix produced by parse_5C_file.
    Returns the reverse and forward restriction fragments in the region
    and the part of the matrix covered by the region
    
Extracts a region from a matrix produced by parse_5C_file.
Returns the reverse and forward restriction fragments in the region
and the part of the matrix covered by the region
Extracts a region from a matrix produced by parse_5C_file . Returns the reverse and forward restriction fragments in the region and the part of the matrix covered by the region
def extract_region(matrix, region_start, region_end):
    land = np.logical_and
    region_row_mask = land(matrix[:,0] >= region_start, matrix[:,1] <= region_end)
    region_col_mask = land(matrix[0,:] >= region_start, matrix[1,:] <= region_end)
    region = matrix[region_row_mask]
    region = region[:,region_col_mask]
    region_fors = matrix[region_row_mask, :2]
    region_revs = matrix[:2, region_col_mask]
    fragment_lengths = np.concatenate((region_fors[:,1] - region_fors[:,0],
                                       region_revs[1,:] - region_revs[0,:])).astype(int)
    return region_revs, region_fors, region
def extract_region ( matrix , region_start , region_end ) : land = np . logical_and region_row_mask = land ( matrix [ : , 0 ] >= region_start , matrix [ : , 1 ] <= region_end ) region_col_mask = land ( matrix [ 0 , : ] >= region_start , matrix [ 1 , : ] <= region_end ) region = matrix [ region_row_mask ] region = region [ : , region_col_mask ] region_fors = matrix [ region_row_mask , : 2 ] region_revs = matrix [ : 2 , region_col_mask ] fragment_lengths = np . concatenate ( ( region_fors [ : , 1 ] - region_fors [ : , 0 ] , region_revs [ 1 , : ] - region_revs [ 0 , : ] ) ) . astype ( int ) return region_revs , region_fors , region
Extracts a region from a matrix produced by parse_5C_file.
Extracts a region from a matrix produced by parse_5C_file .
"""
    Extracts a region from a matrix produced by parse_5C_file.
    Returns the reverse and forward restriction fragments in the region
    and the part of the matrix covered by the region
    """
matrix
region_start
region_end