Skip to content

Commit c20c11f

Browse files
committed
fix bugs
1 parent 3d9cc17 commit c20c11f

File tree

4 files changed

+31
-22
lines changed

4 files changed

+31
-22
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## 2.2.7 (2017-07-20)
2+
3+
Bugfixes:
4+
5+
* fix a display error in assemble step
6+
* fix a bug with "--low-confidence" option in annotate step
7+
18
## 2.2.6 (2016-09-25)
29

310
Bugfixes:

circ2/annotate.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,9 @@ def annotate_fusion(ref_f, out_dir, secondary_flag=0, denovo_flag=0):
120120
left = secondary_exon['left'][gene]
121121
right = secondary_exon['right'][gene]
122122
g, s = gene.split(':')
123-
fus_loc += '\t0\t%s' % s
124-
outf.write('%s\t%s:%s\t%s:%s\n' % (fus_loc, g,
123+
# for avoid dup, use fus_loc_new
124+
fus_loc_new = fus_loc + '\t0\t%s' % s
125+
outf.write('%s\t%s:%s\t%s:%s\n' % (fus_loc_new, g,
125126
left, g,
126127
right))
127128
print('Annotated %d fusion junctions!' % len(total))

circ2/assemble.py

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -149,22 +149,23 @@ def convert_assembly_gtf(out_dir, cufflinks_dir, ref, bb, chrom_size):
149149
symbol = gene_symbol[iso] if iso in gene_symbol else iso
150150
ref_f.write(symbol + '\t' + line)
151151
# convert to bigbed if needed
152-
if bb and which('bedToBigBed') is not None:
153-
print('Convert to BigBed file...')
154-
if not chrom_size: # no chrom size file, search it in tophat folder
155-
chrom_size = '%s/tophat/chrom.size' % out_dir
156-
if not os.path.isfile(chrom_size):
157-
sys.exit('Please offer the path of chrom.size!')
158-
bed_path = '%s/transcripts_ref.bed' % cufflinks_dir
159-
genepred_to_bed(ref_path, bed_path)
160-
sorted_bed_path = '%s/transcripts_ref_sorted.bed' % cufflinks_dir
161-
bed = pybedtools.BedTool(bed_path)
162-
bed = bed.sort()
163-
bed.saveas(sorted_bed_path)
164-
bb_path = '%s/transcripts_ref_sorted.bb' % cufflinks_dir
165-
return_code = os.system('bedToBigBed -type=bed12 %s %s %s' %
166-
(sorted_bed_path, chrom_size, bb_path)) >> 8
167-
if return_code:
168-
sys.exit('Error: cannot convert bed to BigBed!')
169-
else:
170-
print('Could not find bedToBigBed, so skip this step!')
152+
if bb:
153+
if which('bedToBigBed') is not None:
154+
print('Convert to BigBed file...')
155+
if not chrom_size: # no chrom size file, search it in tophat folder
156+
chrom_size = '%s/tophat/chrom.size' % out_dir
157+
if not os.path.isfile(chrom_size):
158+
sys.exit('Please offer the path of chrom.size!')
159+
bed_path = '%s/transcripts_ref.bed' % cufflinks_dir
160+
genepred_to_bed(ref_path, bed_path)
161+
sorted_bed_path = '%s/transcripts_ref_sorted.bed' % cufflinks_dir
162+
bed = pybedtools.BedTool(bed_path)
163+
bed = bed.sort()
164+
bed.saveas(sorted_bed_path)
165+
bb_path = '%s/transcripts_ref_sorted.bb' % cufflinks_dir
166+
return_code = os.system('bedToBigBed -type=bed12 %s %s %s' %
167+
(sorted_bed_path, chrom_size, bb_path)) >> 8
168+
if return_code:
169+
sys.exit('Error: cannot convert bed to BigBed!')
170+
else:
171+
print('Could not find bedToBigBed, so skip this step!')

circ2/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '2.2.6'
1+
__version__ = '2.2.7'

0 commit comments

Comments
 (0)