def replace(origbamfile, mutbamfile, outbamfile, seed=None): ''' open .bam file and call replacereads ''' origbam = pysam.Samfile(origbamfile, 'rb') mutbam = pysam.Samfile(mutbamfile, 'rb') outbam = pysam.Samfile(outbamfile, 'wb', template=origbam) rr.replaceReads(origbam, mutbam, outbam, keepqual=True, seed=seed) origbam.close() mutbam.close() outbam.close()
def replace(origbamfile, mutbamfile, outbamfile, seed=None): """ open .bam file and call replacereads """ origbam = pysam.Samfile(origbamfile, "rb") mutbam = pysam.Samfile(mutbamfile, "rb") outbam = pysam.Samfile(outbamfile, "wb", template=origbam) rr.replaceReads(origbam, mutbam, outbam, keepqual=True, seed=seed) origbam.close() mutbam.close() outbam.close()
def replace(origbamfile, mutbamfile, outbamfile, excludefile): ''' open .bam file and call replacereads ''' origbam = pysam.Samfile(origbamfile, 'rb') mutbam = pysam.Samfile(mutbamfile, 'rb') outbam = pysam.Samfile(outbamfile, 'wb', template=origbam) rr.replaceReads(origbam, mutbam, outbam, excludefile=excludefile, allreads=True) origbam.close() mutbam.close() outbam.close()
def replace(origbamfile, mutbamfile, outbamfile, excludefile, keepsecondary=False): ''' open .bam file and call replacereads ''' origbam = pysam.Samfile(origbamfile, 'rb') mutbam = pysam.Samfile(mutbamfile, 'rb') outbam = pysam.Samfile(outbamfile, 'wb', template=origbam) rr.replaceReads(origbam, mutbam, outbam, excludefile=excludefile, allreads=True, keepsecondary=keepsecondary) origbam.close() mutbam.close() outbam.close()
def replace(origbamfile, mutbamfile, outbamfile, excludefile, keepsecondary=False, seed=None): ''' open .bam file and call replacereads ''' origbam = pysam.Samfile(origbamfile, 'rb') mutbam = pysam.Samfile(mutbamfile, 'rb') outbam = pysam.Samfile(outbamfile, 'wb', template=origbam) rr.replaceReads(origbam, mutbam, outbam, excludefile=excludefile, allreads=True, keepsecondary=keepsecondary, seed=seed) origbam.close() mutbam.close() outbam.close()
def replace(origbamfile, mutbamfile, outbamfile, excludefile, keepsecondary=False, seed=None): """ open .bam file and call replacereads """ origbam = pysam.Samfile(origbamfile, "rb") mutbam = pysam.Samfile(mutbamfile, "rb") outbam = pysam.Samfile(outbamfile, "wb", template=origbam) rr.replaceReads( origbam, mutbam, outbam, excludefile=excludefile, allreads=True, keepsecondary=keepsecondary, seed=seed ) origbam.close() mutbam.close() outbam.close()