1. 程式人生 > >small RNA seq篩選reads長度

small RNA seq篩選reads長度

small RNA seq篩選reads長度,以篩選18~25 nt為例

python

fw = open('out', 'w')
with open('inp', 'r') as fr:
    content = fr.readlines()
    for i in range((len(content) + 1)/4):
        site = 4 * i
        if 16 < len(content[1 + site]) < 25:   #保留長度大於17,小於26的reads
            fw.write(content[0 + site] + content[1 + site] + content[2 + site] + content[3 + site].strip() + '\n')