Beispiel #1
0
def create_deamid_mat(tripeps, D, t):
    trps_data = np.array(
        [tuple(['NA', 'NA', trp, 0, 0, trp]) for trp in tripeps],
        dtype=[('prot_id', '<U60'), ('prot_name', '<U10'), ('tripep', 'U3'),
               ('position', 'i4'), ('corr_pos', 'i4'), ('string', '<U45')])
    counts = None
    rel_ints = None

    Ydata = {'times': t}
    sim_mat = deamidationMatrix(D=D,
                                Ydata=Ydata,
                                counts=counts,
                                rel_ints=rel_ints,
                                trps_data=trps_data)

    return sim_mat
Beispiel #2
0
type = 'cat'

reader = evidenceBatchReader(datapath,
                             byPos=True,
                             qt=False,
                             sf_exp=sf_exp,
                             exclude=exclude_data)

data = reader.readBatch()

sampleTripeps = data.get_sampleTripeps(sampleInfo,
                                       protsInfo,
                                       norm_type='simple',
                                       filter=None)

deamid_mat = deamidationMatrix(sampleTripeps, sampleInfo, header)

# Filter out non-helical positions
deamid_mat = deamid_mat.filter_tripeps(deamid_mat.trps_data['position'] < 1193)

# Remove glue samples
samples_filter = deamid_mat.Ydata[key] != 'Glue'
deamid_mat = deamid_mat.filter_samples(samples_filter)

# Correct positions
deamid_mat.correct_pos(protsInfo)
# Merge by position
deamid_mat = deamid_mat.merge_by_pos(corr=True)
# Apply period
n_period = deamid_mat.stagger_pos(l_period=234)
# Sort by corr_pos