Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bedToPsl error #3

Closed
VernLee opened this issue Jan 2, 2019 · 6 comments
Closed

bedToPsl error #3

VernLee opened this issue Jan 2, 2019 · 6 comments

Comments

@VernLee
Copy link

VernLee commented Jan 2, 2019

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
Copy link

pwwang commented Jan 2, 2019

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

chmod +x bin/bedToPsl

@belgravia
Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link
Author

VernLee commented Jan 3, 2019

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
Copy link
Collaborator

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
Copy link
Author

VernLee commented Jan 8, 2019

Works great now, thanks for that :)

Vern

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants