Extract molecular Index (Split) / Dictionnaire


In [98]:
import HTSeq

dictio = {}

for read in HTSeq.FastqReader("EditFastq"):
    molecularIndex = read.name.split(":")[-1]
    print molecularIndex
    
    if not molecularIndex in dictio :
        dictio[molecularIndex] = []   
    dictio[molecularIndex].append(read)

print len (dictio["GAGGAAACTG"][0])


GAGGAAACTG
TGAGAGAATC
TATGAGGGAG
GAAGGATGAT
TGTGAGAGAG
GAGGAAACTG
GAGGAAACTG
GAGGAAACTG
GAGGAAACTG
GAGGAAACTG
100

In [ ]: