import ReadDataset
from commoncode import getConfigParser, getConfigOption, getConfigBoolOption, getConfigIntOption
+VERSION = "1.0"
def main(argv=None):
if not argv:
argv = sys.argv
- verstring = "makeBamFromRds: version 1.0"
- print verstring
+ print "makeBamFromRds: version %s" % VERSION
doPairs = False
for chrom in chromRemoveList:
chromList.remove(chrom)
- header = {"HD": {"VN": "1.0"}}
+ header = {"HD": {"VN": VERSION}}
if referenceSequenceList:
header["SQ"] = referenceSequenceList
pass
else:
for read in spliceDict[chrom]:
- if fastaSequenceDict.has_key(chrom):
+ if chrom in fastaSequenceDict:
read["sense"], noncanonical = fixSpliceSense(fastaSequenceDict[chrom], read["startR"], read["stopL"], read["sense"])
noncanonicalSplices += noncanonical
alignedRead.rname = outfile.references.index(chrom)
- if outputDict.has_key("startL"):
+ if "startL" in outputDict:
startL = outputDict["startL"] - 1
stopL = outputDict["stopL"] - 1
startR = outputDict["startR"] - 1
alignedRead.pos = outputDict["start"] - 1
alignedRead.cigar = [(0, readlength)]
+ #TODO: add sequence info
+ #cistematic.core.retrieveSequence(genome, chrom, start, stop, sense="F", db="")
+ #ooooo. let's do this with PyGr
+
+ #TODO: add quality - max for each base, but default is to not include just like current
+ # rdsToFastq() sets everything to max
+
if paired:
if pairID == "1":
alignedRead.is_read1 = True
else:
pass
- if outputDict.has_key("mismatch"):
+ if "mismatch" in outputDict:
mismatchTag = getMismatches(outputDict["mismatch"])
if mismatchTag:
tagList.append(("MD", str(mismatchTag)))
spliceJunction = string.join([leftJunctionSig, rightJunctionSig], "")
spliceJunction = spliceJunction.upper()
print spliceJunction
- if spliceSense.has_key(spliceJunction):
+ if spliceJunction in spliceSense:
sense = spliceSense[spliceJunction]
else:
noncanonical += 1