pedronachtigall / CodAn

CDS prediction in transcripts
Other
23 stars 5 forks source link

remove file error. #11

Closed xiekunwhy closed 2 years ago

xiekunwhy commented 2 years ago

Hi,

Why you remove file without checking existences? grep -n os.remove codan.py 106: os.remove(transcripts+".index") 140: os.remove(outF+"minus.fa") 141: os.remove(outF+"minus.fa.index") 287: os.remove(outF+"ORFs_plus.gtf") 288: os.remove(outF+"ORFs_minus.gtf") 289: os.remove(outF+"minus.fa") 290: os.remove(outF+"minus.fa.index") 291: os.remove(transcripts+".index") All of these may cause error like following when the output directory is empty(or run codan first time). Traceback (most recent call last): File "/Bio/User/kxie/pipeline/geneAnnot/bin/codan/bin/codan.py", line 524, in main() File "/Bio/User/kxie/pipeline/geneAnnot/bin/codan/bin/codan.py", line 506, in main _codanBOTH(options.transcripts, options.output_folder, options.model, options.cpu) File "/Bio/User/kxie/pipeline/geneAnnot/bin/codan/bin/codan.py", line 355, in _codanBOTH _retrieveORFBOTH(transcripts, outF+"minus.fa", outF) File "/Bio/User/kxie/pipeline/geneAnnot/bin/codan/bin/codan.py", line 290, in _retrieveORFBOTH os.remove(outF+"minus.fa.index") FileNotFoundError: [Errno 2] No such file or directory: './02.ccs/codan/minus.fa.index' Would you please disable the removings or check existences first?

Best, Kun

xiekunwhy commented 2 years ago

Sorry, I know why now.