Skip to content

contaminating python2 code in python3 build? #3

Open
@acvill

Description

@acvill

Congratulations on your recent publication in BMC Genomics. I would like to use MetaRon, but there appears to be conflicting information between the MetaRon paper and this repository. The paper states that MetaRon requires Python 3, but the installation prerequisites in this repository state Python 2.7 is needed. Further, your most recent commit is named "python3", so I went ahead with a Python 3 installation.

After resolving an indentation issue...

$ source /programs/miniconda3/bin/activate metaron-2.0
$ metaron --help
  File "/programs/miniconda3/envs/metaron-2.0/bin/metaron", line 234
    gene_name_scaf, strand, gene_st, gene_end, file_name, scaftig_name, gene_name, scaf_name4dict = data_extraction(gene_file, gene_pred_tool)
    ^
IndentationError: unexpected indent

... the --help option now works.

$ source /programs/miniconda3/bin/activate metaron-2.0
$ metaron --help
usage: metaron [-h] [-n SAMPLE] [-p PROCESS] [-rt READ_TYPE] [-rl READ_LENGTH]
               [-pe1 PAIRED_1] [-pe2 PAIRED_2] [-pm PAIRED_MERGED] [-i IGP]
               [-j ISC] [-t TOOL] [-o OUTPUT]

optional arguments:
  -h, --help            show this help message and exit
  -n SAMPLE, --sample SAMPLE
                        Sample name without any dot, underscore or dash
  -p PROCESS, --process PROCESS
                        1. ago: assembly gene prediction and operon prediciton
                        2. op: operon prediction only. If 'ago', please
                        provide the following parameters:
                        -n,-rl,-rt,[-pe1,pe2|-pm],
  -rt READ_TYPE, --read_type READ_TYPE
                        Enter read type. 'merge' if the reads are paired-end
                        in two file. 'paired' if the reads are paired-end in
                        one file.
  -rl READ_LENGTH, --read_length READ_LENGTH
                        Enter 'l'if read length is longer than 128 bases and
                        'r' if read length is shorter than 128 bases
  -pe1 PAIRED_1, --paired_1 PAIRED_1
                        Enter enter paired read file 1
  -pe2 PAIRED_2, --paired_2 PAIRED_2
                        Enter enter paired read file 2
  -pm PAIRED_MERGED, --paired_merged PAIRED_MERGED
                        Enter the paired end read file if both pairedend reads
                        are in one file
  -i IGP, --igp IGP     Select the gene prediction .tab file generated via
                        MetageneMark or Prodigal
  -j ISC, --isc ISC     Select the file containing all scaftigs
  -t TOOL, --tool TOOL  Enter 1 for MetaGeneMark, 2 for Prodigal
  -o OUTPUT, --output OUTPUT
                        Enter output destination folder

But running both the example data and my own data through the op process lead to additional errors.

Error 1

$ metaron --sample ERR022075 --process op --igp /home/metaron/data/ERR022075 --isc /home/metaron/data/ERR022075_scaffold.fa --tool 2 --output ./out/
All parameters checked
Sample name:     ERR022075
OUTPUT DIRECTORY:     ./out/MetaRon_ERR022075
config_file_check start
/programs/miniconda3/envs/metaron-2.0/bin
config_file_check completed
********************************** METAGENOMIC OPERON PREDICTION **********************************
Formatting assembly file
Traceback (most recent call last):
  File "/programs/miniconda3/envs/metaron-2.0/bin/metaron", line 1659, in <module>
    main()
  File "/programs/miniconda3/envs/metaron-2.0/bin/metaron", line 233, in main
    gff2tab(sample_name)
  File "/programs/miniconda3/envs/metaron-2.0/bin/metaron", line 444, in gff2tab
    writer.writerows(zoo)
TypeError: a bytes-like object is required, not 'str'

It seems like this error with writer.writerows() is documented in StackOverflow: TypeError: a bytes-like object is required, not 'str' in python and CSV

Note that my config.txt file reads:

NNPP2.2_path=/home/metaron/NNPP2.2/bin/fa2TDNNpred-PRO.linux

which points to my local installation of NNPP2.2. I've confirmed that the standalone NNPP2.2 program works fine.

In the absence of a config file, I see a second error that also looks to be caused by python3 trying to compile python2 code:

Error 2

Traceback (most recent call last):
  File "/programs/miniconda3/envs/metaron-2.0/bin/metaron", line 1659, in <module>
    main()
  File "/programs/miniconda3/envs/metaron-2.0/bin/metaron", line 180, in main
    config_file_check()
  File "/programs/miniconda3/envs/metaron-2.0/bin/metaron", line 1615, in config_file_check
    NNPP2_path = raw_input('Enter path for NNPP2.2 directory test2')
NameError: name 'raw_input' is not defined

Again, StackOverflow: How do I use raw_input in Python 3

So, should metaron-2.0 be compiled and run in a python2 environment, despite the documentation in the paper and elsewhere that metaron is written in python3?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions