convert standard analysis pipelines to use bam format natively
[erange.git] / ReadDataset.py
index 9a795c8cde5c5ba6d257da963ebf4c32f7d6e42d..dffa76de9436f4379f42ba2175bec17fc1a8fa59 100644 (file)
@@ -6,11 +6,10 @@ import re
 import sys
 import pysam
 from array import array
-from commoncode import getReverseComplement
+from commoncode import getReverseComplement, isSpliceEntry
 
 currentRDSVersion = "3.0"
 
-
 class ReadDatasetError(Exception):
     pass
 
@@ -68,7 +67,7 @@ class MaxCoordFinder(ReadCounter):
 
 
 
-class BamReadDataset():
+class ReadDataset():
     """ Class for storing reads from experiments. Assumes that custom scripts
     will translate incoming data into a format that can be inserted into the
     class using the insert* methods. Default class subtype ('DNA') includes
@@ -454,7 +453,7 @@ class BamReadDataset():
                 newrow["chrom"] = chrom
 
             if withPairID:
-                newrow["pairID"] = pairID
+                newrow["pairID"] = pairReadSuffix[1:]
 
             try:
                 resultsDict[dictKey].append(newrow)
@@ -973,16 +972,6 @@ def getReadSense(reverse):
     return sense
 
 
-def isSpliceEntry(cigarTupleList):
-    isSplice = False
-    for operation,length in cigarTupleList:
-        if operation == 3:
-            isSplice = True
-            break
-
-    return isSplice
-
-
 def getSpliceRightStart(start, cigarTupleList):
     offset = 0