+ resolved an issue with the memory mapping in filterReads
[qpalma.git] / qpalma / tools / parseGff.py
index 8e63918..281a8b9 100644 (file)
@@ -14,6 +14,7 @@ def parse_gff(gff_filename):
    reader = csv.reader(gff_fid, delimiter='\t', quoting=csv.QUOTE_NONE)
 
    allGenes = {}
+   allGenesA = []
    currentGene = None
 
    rx = re.compile('ID=[^;]*;',re.DOTALL)
@@ -33,6 +34,7 @@ def parse_gff(gff_filename):
       if id == 'gene':
          if currentGene != None:
             allGenes[currentGene.id] = currentGene
+            allGenesA.append(currentGene)
          
          desc = rx.search(desc).group()[3:-1]
          #print desc
@@ -81,6 +83,7 @@ def parse_gff(gff_filename):
       elif id == 'pseudogene':
          if currentGene != None:
             allGenes[currentGene.id] = currentGene
+            allGenesA.append(currentGene)
             currentGene = None
       else:
          assert False, 'Error: Unknown identifier \'%s\'' % id
@@ -88,7 +91,7 @@ def parse_gff(gff_filename):
    if currentGene != None:
       allGenes[currentGene.id] = currentGene
 
-   return allGenes
+   return allGenes,allGenesA
 
 
 def createGffPickle(annotFile,pickleFile):