transcript / samsa2

SAMSA pipeline, version 2.0. An open-source metatranscriptomics pipeline for analyzing microbiome data, built around DIAMOND and customizable reference databases.
GNU General Public License v3.0
53 stars 36 forks source link

AttributeError: module 'time' has no attribute 'clock' #62

Closed ARW-UBT closed 3 years ago

ARW-UBT commented 3 years ago

Hello,

Samsa2 processed the sequences up to step 4 then closed with the following error: Any idea what the message "AttributeError: module 'time' has no attribute 'clock'" means?

Thank you for you suggestions... Best,

Reported 6916065 pairwise alignments, 6916065 HSSPs. 6916065 queries aligned. diamond v0.8.38.100 | by Benjamin Buchfink buchfink@gmail.com Check http://github.com/bbuchfink/diamond for updates.

CPU threads: 24

Scoring parameters: (Matrix=custom Lambda=0.267 K=0.041 Penalties=11/1) DB sequences = 68433538 DB sequences used = 1491836 DB letters = 23559584414 Generating output... [8.35409s] RefSeq DIAMOND annotations completed at: Mon May 10 10:34:39 CEST 2021 Traceback (most recent call last): File "/home/weig/Tools/samsa2/python_scripts/DIAMOND_analysis_counter.py", line 53, in t0 = time.clock() AttributeError: module 'time' has no attribute 'clock' 'python /home/weig/Tools/samsa2/python_scripts/DIAMOND_analysis_counter.py -I /home/weig/Tools/samsa2/samsa-data/C03-Exp002-Tm-PS/step_4_output/control_SFB-MP-000067.merged.RefSeq_annotated -D /home/weig/Tools/samsa2/full_databases/RefSeq_bac.fa -O' exited with non-zero status 1

transcript commented 3 years ago

Ah, it looks like time.clock() was removed in Python 3.8. I'll probably update these to time.time() instead; you could make the swap yourself if you don't want to wait for me to push the changes.

transcript commented 3 years ago

Okay, see commit baa352c - time.clock() is now replaced by time.time(). I don't have Python 3.8 locally, but test this and reopen if there are still issues.

ARW-UBT commented 3 years ago

I have changed time.clock to time.time also in lines 87, 98, 112, and 185 in addition to line 53. Restarted the master script again, but it seems that the entire analyses are repeated from the very beginning, although the checkpoints file existed in the input dir. I will see if this applies only to the trimmomatic step or to all other steps, too. Unfortunately, the script failed after 7 days. Are there other py scripts which should be edited for time.time?

ARW-UBT commented 3 years ago

Sorry, I have overlooked that you did change this also in other scripts (#61). I assume the easiest way is to replace the local files with yours from python_scripts, right? Those modified a few hours ago. Thanks for your help!

transcript commented 3 years ago

Hi, yes, I went ahead and pushed a new commit with time.clock() replaced in all Python files. The easiest solution is to pull the new files and relaunch.

For the master_script.sh, you can always comment out the already-completed steps, or create an edited version of the file and delete the steps that have already been run. There is some limited step-checking, but especially if you are re-pulling the repo, it makes sense to manually cut the steps that have already been completed.