From 6a8c4de25a0059d010a2a41420747a849f9214b9 Mon Sep 17 00:00:00 2001 From: Venkat Malladi <Venkat.Malladi@utsouthwestern.edu> Date: Thu, 2 Mar 2017 11:34:02 -0600 Subject: [PATCH] Update pysam to account for new syntax. --- rpkm_gro.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpkm_gro.py b/rpkm_gro.py index ee3c56a..732206e 100755 --- a/rpkm_gro.py +++ b/rpkm_gro.py @@ -62,7 +62,7 @@ def rpkm_strand(peak_file,aln_file,exp_name,columns): columns.append(exp_name) ## RPKM = numReads / (geneLength/1000 * totalNumReads/1,000,000 ) peak_counts = peak_file.multi_bam_coverage(bams=[aln_file],s=True) - total_counts = reduce(lambda x, y: x + y, [ int(l.rstrip('\n').split('\t')[2]) for l in pysam.idxstats(aln_file,split_lines=True))]) + total_counts = reduce(lambda x, y: x + y, [ int(l.rstrip('\n').split('\t')[2]) for l in pysam.idxstats(aln_file,split_lines=True)]) rpkm = peak_counts.each(normalized_to_length, 6, float(math.pow(10,9))/float(total_counts)).saveas("test.bed") rpkm_df = rpkm.to_dataframe() #os.remove('test.bed') -- GitLab