marbl / ModDotPlot

MIT License
101 stars 7 forks source link

Error question #4

Closed Orz-CQ closed 1 year ago

Orz-CQ commented 1 year ago

Hi Alex,

While I am trying this tool, I have met several questions. I installed it by

python -m venv venv
source venv/bin/activate
python setup.py install

and everything runs successfully.

Using /public/home/lanlan/software/ModDotPlot/venv/lib/python3.11/site-packages/MarkupSafe-2.1.2-py3.11-linux-x86_64.egg
Finished processing dependencies for moddotplot==0.4.2

Then I tried the example

moddotplot -i test/Chr1_cen.fa Then it turned to the error message like

  File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/public/home/lanlan/software/ModDotPlot/moddotplot/__main__.py", line 7, in <module>
    sys.exit(main())
             ^^^^^^
  File "/public/home/lanlan/software/ModDotPlot/moddotplot/moddotplot.py", line 154, in main
    paired_bed_file(
TypeError: paired_bed_file() missing 1 required positional argument: 'k'

I thought it could be dealt by adding the -k moddotplot -i test/Chr1_cen.fa --kmer 21 but still return the error massage.

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/public/home/lanlan/software/ModDotPlot/moddotplot/__main__.py", line 7, in <module>
    sys.exit(main())
             ^^^^^^
  File "/public/home/lanlan/software/ModDotPlot/moddotplot/moddotplot.py", line 127, in main
    kmer_list = read_kmers_from_file(i, args.kmer)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/public/home/lanlan/software/ModDotPlot/moddotplot/parse_fasta.py", line 103, in read_kmers_from_file
    all_kmers.append(report_all_kmers(seq.fetch(seq_id), ksize))
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/public/home/lanlan/software/ModDotPlot/moddotplot/parse_fasta.py", line 85, in report_all_kmers
    for kmer in kmers:
  File "/public/home/lanlan/software/ModDotPlot/moddotplot/parse_fasta.py", line 21, in generate_kmers
    mask = (1 << (3*k)) - 1
            ~~^^~~~~~~

How can I fix it?

Thanks, Lan

alexsweeten commented 1 year ago

Hi Lan,

Sorry, I was working on some updates and forgot to push a change to main branch. Please run again with:

git pull
python setup.py install
Orz-CQ commented 1 year ago

I tried the solution and still comes the error messages,

  File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/public/home/lanlan/software/ModDotPlot/moddotplot/__main__.py", line 7, in <module>
    sys.exit(main())
             ^^^^^^
  File "/public/home/lanlan/software/ModDotPlot/moddotplot/moddotplot.py", line 154, in main
    paired_bed_file(
  File "/public/home/lanlan/software/ModDotPlot/moddotplot/static_plots.py", line 96, in paired_bed_file
    create_plots([df], input_name, input_name, seq_length)
TypeError: create_plots() takes 3 positional arguments but 4 were given
Orz-CQ commented 1 year ago

While I tried twice, it finally worked! Thanks!

alexsweeten commented 1 year ago

Great, sorry for the problems. I'll have some continuous integration and tests ready soon to prevent this in the future