BrooksLabUCSC / flair

Full-Length Alternative Isoform analysis of RNA
Other
207 stars 71 forks source link

bedToPsl error #3

Closed VernLee closed 5 years ago

VernLee commented 5 years ago

Hi,

I am attempting to analyse some Nanopore direct RNA sequencing reads using flair but appear to be stuck at the correction/collapse steps. Specifically, I cannot obtain the psl of corrected reads for further analysis. Below is my command and the error message.

python flair.py correct -f /Users/vvernlee/Downloads/ToxoDB-39_TgondiiME49.gff -q /Users/vvernlee/Downloads/flair-master/T2.bed\ -c chromsize.tsv

...

Traceback (most recent call last): File "flair.py", line 98, in subprocess.call([path+'bin/bedToPsl', args.c, args.o+'.corrected.bed', args.o+'.corrected.unnamed.psl']) File "/anaconda3/lib/python3.6/subprocess.py", line 267, in call with Popen(*popenargs, **kwargs) as p: File "/anaconda3/lib/python3.6/subprocess.py", line 709, in init restore_signals, start_new_session) File "/anaconda3/lib/python3.6/subprocess.py", line 1344, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) OSError: [Errno 8] Exec format error: 'bin/bedToPsl'

The corrected bed file is obtained but when I attempt to use it for flair collapse, I obtain:

Collapsing isoforms Traceback (most recent call last): File "bin/collapse_isoforms_precise.py", line 304, in singleexon[chrom] = add_se(singleexon[chrom], tss, tes, line) File "bin/collapse_isoforms_precise.py", line 104, in add_se for coord in sedict.keys(): RuntimeError: dictionary changed size during iteration Filtering isoforms usage: script.py collapsed.psl (default/comprehensive/ginormous) filtered.psl [tolerance] mv: rename /Users/vvernlee/Downloads/flair-master/flair.corrected.firstpass.filtered.psl to /Users/vvernlee/Downloads/flair-master/flair.corrected.firstpass.psl: No such file or directory usage: script.py psl genome.fa outfilename Aligning reads to first-pass isoform reference [ERROR] failed to open file '/Users/vvernlee/Downloads/flair-master/flair.corrected.firstpass.fa' Counting isoform expression Filtering isoforms by read coverage Traceback (most recent call last): File "bin/match_counts.py", line 9, in for line in open(sys.argv[2]): FileNotFoundError: [Errno 2] No such file or directory: '/Users/vvernlee/Downloads/flair-master/flair.corrected.firstpass.psl' Removing intermediate files/done rm: /Users/vvernlee/Downloads/flair-master/flair.corrected.firstpass.fa: No such file or directory

Any help would be much appreciated. Vern

pwwang commented 5 years ago

I guess this is because bin/bedToPsl is not executable. Would you try:

chmod +x bin/bedToPsl
belgravia commented 5 years ago

Hi Vern,

It seems like there could be an error with the collapse_isoforms_precise.py script. Even so, it's hard to tell because bedToPsl is not working for you and it needs work for the collapse to perform as expected. For simplicity, it's best to supply a psl to flair-collapse. You could try what pwwang has suggested (thanks pwwang!) and double check that you can execute the script in your command line. Maybe this is an issue with python.

Once the conversion is working properly and you can give flair-collapse a psl file of corrected reads, I can address those issues here. Also if you/I figure out why bedToPsl doesn't work for you, maybe I will sub in a different conversion script instead so flair can work with more users.

-Alison

belgravia commented 5 years ago

Hi Vern,

So I have just included another script in bin called bed_to_psl.py that should work with the wrapper better, and not have issues working on different peoples' systems. You should convert your corrected bed to psl using that script (syntax: python bed_to_psl.py chromsizes.txt corrected.bed corrected.psl) and feed that psl to the collapse step. Let me know how that goes.

-Alison

VernLee commented 5 years ago

Thanks for all the responses. Unfortunately, chmod does not work; bedToPsl is already listed as executable. I'm not sure why the issue persist.

bed_to_psl.py does however work perfectly. I have tried feeding the psl file to the collapse step but the same error crops up. Below is the command and error message.

5210D-112517-M:flair-master2 leev1$ python flair.py collapse -r /Users/leev1/Downloads/flair-master2/mergedt.fastq -q /Users/leev1/Downloads/flair-master2/corrected.psl -g /Users/leev1/Downloads/flair-master2/ToxoDB39Genome.fasta -m /Users/leev1/Downloads/minimap2-master Collapsing isoforms Traceback (most recent call last): File "bin/collapse_isoforms_precise.py", line 304, in singleexon[chrom] = add_se(singleexon[chrom], tss, tes, line) File "bin/collapse_isoforms_precise.py", line 104, in add_se for coord in sedict.keys(): RuntimeError: dictionary changed size during iteration Filtering isoforms usage: script.py collapsed.psl (default/comprehensive/ginormous) filtered.psl [tolerance] mv: rename /Users/leev1/Downloads/flair-master2/corrected.firstpass.filtered.psl to /Users/leev1/Downloads/flair-master2/corrected.firstpass.psl: No such file or directory usage: script.py psl genome.fa outfilename Aligning reads to first-pass isoform reference [ERROR] failed to open file '/Users/leev1/Downloads/flair-master2/corrected.firstpass.fa' Counting isoform expression Filtering isoforms by read coverage Traceback (most recent call last): File "bin/match_counts.py", line 9, in for line in open(sys.argv[2]): FileNotFoundError: [Errno 2] No such file or directory: '/Users/leev1/Downloads/flair-master2/corrected.firstpass.psl' Removing intermediate files/done rm: /Users/leev1/Downloads/flair-master2/corrected.firstpass.fa: No such file or directory

Thanks Vern

belgravia commented 5 years ago

Hi Vern,

I have pushed a newer version of the script that should fix the issue to comply with python 3 :) Please try it out and let me know if there's any other issues with it now.

-Alison

VernLee commented 5 years ago

Works great now, thanks for that :)

Vern