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

gff3_fix error #135

Open
Rhinogradentia opened this issue Apr 17, 2024 · 2 comments
Open

gff3_fix error #135

Rhinogradentia opened this issue Apr 17, 2024 · 2 comments

Comments

@Rhinogradentia
Copy link

Hi,

I tried to run gff3_fix an ran in following error

Before I of course ran QC:

gff3_QC -g in.gff3 -f in.fasta -i -o QC-Check.out -s QC_Check.stats

Afterwards I extracted only the wrong phases into wrongPhase.out

grep "Wrong phase"  QC-Check.out > wrongPhase.out

It looks like this:

head wrongPhase.out
Line_num        Error_code      Error_level     Error_tag
['Line 1030']   Ema0006 Info    [Wrong phase 1, should be 0]
['Line 1102']   Ema0006 Info    [Wrong phase 2, should be 0]
['Line 2797']   Ema0006 Info    [Wrong phase 1, should be 0]
['Line 3384']   Ema0006 Info    [Wrong phase 0, should be 1]
['Line 3408']   Ema0006 Info    [Wrong phase 2, should be 0]
['Line 3414']   Ema0006 Info    [Wrong phase 0, should be 1]
['Line 3504']   Ema0006 Info    [Wrong phase 1, should be 2]
['Line 3528']   Ema0006 Info    [Wrong phase 1, should be 0]
['Line 3530']   Ema0006 Info    [Wrong phase 0, should be 1]
['Line 3552']   Ema0006 Info    [Wrong phase 2, should be 0]

Then running gff3_fix:

gff3_fix -qc_r wrongPhase.out -g in.gff3 -og out.gff3
INFO     Checking QC report file (wrongPhase.out)...
INFO     Checking GFF3 file (in.gff3)...
INFO     Reading QC report file: (wrongPhase.out)...

INFO     Reading GFF3 file: (in.gff3)...

Traceback (most recent call last):
  File "/home/user/.local/bin/gff3_fix", line 8, in <module>
    sys.exit(script_main())
  File "/home/user/.local/lib/python3.10/site-packages/gff3tool/bin/gff3_fix.py", line 95, in script_main
    gff3_fix.fix.main(gff3=gff3, output_gff=args.output_gff, error_dict=error_dict, line_num_dict=line_num_dict, logger=logger_stderr)
  File "/home/user/.local/lib/python3.10/site-packages/gff3tool/lib/gff3_fix/fix.py", line 686, in main
    fix_phase(gff3=gff3, error_list=error_dict[error_code], line_num_dict=line_num_dict, logger=logger)
  File "/home/user/.local/lib/python3.10/site-packages/gff3tool/lib/gff3_fix/fix.py", line 424, in fix_phase
    phase = list(map(int,re.findall(r'\d',line_num_dict[sorted_CDS_list[0]['line_index']+1]['Ema0006']))[1])
TypeError: 'map' object is not subscriptable

The error stays the same when the complete report file is input.

I'm running this in a conda environment :

python --version
Python 3.12.0

Also tried it in a non-conda environment:

python --version
Python 2.7.18

gff3_fix --version
gff3_fix 2.1.0

gff3_QC --version
gff3_QC 2.1.0

What could be the problem here? Thank you a lot in advance.
Best,
Nadine

@mpoelchau
Copy link
Contributor

Thanks for reaching out @Rhinogradentia . I can't see anything wrong with your wrongPhase.out file. I'm curious whether the python3 version is too high - could you try the same command in a conda environment with python 3.7?

If that doesn't work, it would be great if you could attach the gff3 and fasta files so I can troubleshoot, or email them to i5k@ars.usda.gov

@Rhinogradentia
Copy link
Author

Rhinogradentia commented Apr 22, 2024

Hi,

I found time to test it with python 3.7 - ther same error occurs. Unfortunately I can't share the input files at the moment. I will try to find the source of the error myself.

# fresh install conda environment with python 3.7
 conda create --name py3.7 python=3.7
source activate py3.7
(py3.7) user $ pip install gff3tool
/home/user/miniconda3/envs/py3.7/bin/gff3_fix

python --version
Python 3.7.12

gff3_fix -qc_r WrongPhase.txt -g in.gff3 -og out.gff3
INFO     Checking QC report file (WrongPhase.txt)...
INFO     Checking GFF3 file (in.gff3)...
INFO     Reading QC report file: (WrongPhase.txt)...

INFO     Reading GFF3 file: (in.gff3)...

Traceback (most recent call last):
  File "/home/user/.local/bin/gff3_fix", line 8, in <module>
    sys.exit(script_main())
  File "/home/user/.local/lib/python3.10/site-packages/gff3tool/bin/gff3_fix.py", line 95, in script_main
    gff3_fix.fix.main(gff3=gff3, output_gff=args.output_gff, error_dict=error_dict, line_num_dict=line_num_dict, logger=logger_stderr)
  File "/home/user/.local/lib/python3.10/site-packages/gff3tool/lib/gff3_fix/fix.py", line 686, in main
    fix_phase(gff3=gff3, error_list=error_dict[error_code], line_num_dict=line_num_dict, logger=logger)
  File "/home/user/.local/lib/python3.10/site-packages/gff3tool/lib/gff3_fix/fix.py", line 424, in fix_phase
    phase = list(map(int,re.findall(r'\d',line_num_dict[sorted_CDS_list[0]['line_index']+1]['Ema0006']))[1])
TypeError: 'map' object is not subscriptable

Thanks for trying to help.

Best,
Nadine

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

2 participants