@@ -65,7 +65,7 @@ def parser(args):
65
65
assert len (args .in_bam )== 2
66
66
tid_to_qval_compact = pool .map (
67
67
_child_get_permutation_fdr ,
68
- [ (unibam_file , multibam_file , child_gene_list [i ], gene_annot , args .qval_cutoff , max_iter , ~ (args .unstranded == 'unstranded' ), 'fdr' , random_state )
68
+ [ (unibam_file , multibam_file , child_gene_list [i ], gene_annot , args .qval_cutoff , max_iter , ~ (args .lib_type == 'unstranded' ), 'fdr' , random_state )
69
69
for i in range (args .nthread )
70
70
])
71
71
@@ -75,7 +75,7 @@ def parser(args):
75
75
unique_tid_to_qval , combined_tid_to_qval = unpack_tid_to_qval (tid_to_qval_compact )
76
76
else :
77
77
unique_tid_to_qval , combined_tid_to_qval = _child_get_permutation_fdr (
78
- (unibam_file , multibam_file , gene_list , gene_annot , args .qval_cutoff , max_iter , ~ (args .unstranded == 'unstranded' ), 'fdr' , random_state )
78
+ (unibam_file , multibam_file , gene_list , gene_annot , args .qval_cutoff , max_iter , ~ (args .lib_type == 'unstranded' ), 'fdr' , random_state )
79
79
)
80
80
81
81
#pickle.dump(unique_tid_to_qval, open(tmp_dir+'/unique_to_qval.pdata','wb'), -1)
@@ -119,7 +119,7 @@ def parser(args):
119
119
_ , signal_qval , gene_name = peak
120
120
signal , qval = signal_qval
121
121
f .write ( narrowPeak_formatter % (chr , start , end , gene_name , 'combined' , strand , signal , qval ) )
122
- if args .unstranded :
122
+ if args .lib_type == ' unstranded' :
123
123
cmd = ''' sort -k1,1 -k2,2n %s/all_permutation_peaks.bed |awk '{OFS="\t "; print $1,$2,$3,$4":"$7":"$9,$5,$6}'| bedtools merge -d -1 -i stdin -c 4,5,6 -o collapse,collapse,distinct > %s''' % (output_dir , os .path .join (output_dir ,'narrow_peak.permutation.bed' ) )
124
124
else :
125
125
cmd = ''' sort -k1,1 -k2,2n %s/all_permutation_peaks.bed |awk '{OFS="\t "; print $1,$2,$3,$4":"$7":"$9,$5,$6}'| bedtools merge -s -d -1 -i stdin -c 4,5,6 -o collapse,collapse,distinct > %s''' % (output_dir , os .path .join (output_dir ,'narrow_peak.permutation.bed' ) )
0 commit comments