csbio / BEAN-counter

Other
1 stars 2 forks source link

File "./process_screen.py", line 46, in <module> import compressed_file_opener as cfo ImportError: No module named compressed_file_opener #3

Open Owuorgpo opened 5 years ago

Owuorgpo commented 5 years ago

Hi, For some reason, I keep getting this error when running the process_screen.py. Are these part of the BEAN packages? I am unable to find a way to install them in my system. import compressed_file_opener as cfo import cg_file_tools as cg_file import cluster_dataset_wrappers as clus_wrap from cg_common_functions import get_sample_table, parse_yaml from version_printing import update_version_file

RussianImperialScott commented 5 years ago

Hi Peter!

If you're having issues importing those modules, my first guess would be that the BARSEQ_PATH variable is not pointing to the main BEAN-counter directory. The BEAN-counter scripts use this variable to know where to look for the modules that you're having trouble importing at the moment. So I can better help, are you running this on linux, mac, or windows?

I need to update the README page, but we published a protocol earlier this year containing much more detailed instructions here: https://doi.org/10.1038/s41596-018-0099-1. If you do not have access to the journal, please let me know and I can send you a copy (there should also be a free version of the protocol posted to PubMed Central within a few weeks).

Thanks! Scott

Owuorgpo commented 5 years ago

Thanks for that quick response, I am using Linux and technically trying to submit the job to a cluster as I cannot run it locally. I have followed the instruction from the Readme file to put the BARSEQ_PATH to my directory but maybe am doing it wrong. I don’t mind sharing the script. I have the published protocol (one of the best in this area, kudos) and I find the interaction scoring approach fit for my experiment. Thanks

Regards Peter

From: Scott Simpkins Sent: Wednesday, September 25, 2019 6:24 PM To: csbio/BEAN-counter Cc: Peter Oluoch; Author Subject: Re: [csbio/BEAN-counter] File "./process_screen.py", line 46, in import compressed_file_opener as cfo ImportError: No modulenamed compressed_file_opener (#3)

Hi Peter! If you're having issues importing those modules, my first guess would be that the BARSEQ_PATH variable is not pointing to the main BEAN-counter directory. The BEAN-counter scripts use this variable to know where to look for the modules that you're having trouble importing at the moment. So I can better help, are you running this on linux, mac, or windows? I need to update the README page, but we published a protocol earlier this year containing much more detailed instructions here: https://doi.org/10.1038/s41596-018-0099-1. If you do not have access to the journal, please let me know and I can send you a copy (there should also be a free version of the protocol posted to PubMed Central within a few weeks). Thanks! Scott — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

RussianImperialScott commented 5 years ago

Oh awesome, glad that this is (hopefully) useful! Perhaps the BARSEQ_PATH environment variable is not being set properly in the job submission process? I can certainly take a look at your script to see what might be happening.

Owuorgpo commented 5 years ago

Sure, Attached is the script

Regards Peter

From: Scott Simpkins Sent: Wednesday, September 25, 2019 6:38 PM To: csbio/BEAN-counter Cc: Peter Oluoch; Author Subject: Re: [csbio/BEAN-counter] File "./process_screen.py", line 46, in import compressed_file_opener as cfo ImportError: No modulenamed compressed_file_opener (#3)

Oh awesome, glad that this is (hopefully) useful! Perhaps the BARSEQ_PATH environment variable is not being set properly in the job submission process? I can certainly take a look at your script to see what might be happening. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

RussianImperialScott commented 5 years ago

I don't think the script came through as an attachment. Is it short enough to paste in a comment?

Owuorgpo commented 5 years ago

Here is how am setting my bash script:

!/usr/bin/env bash

SBATCH -J SeekDeep

SBATCH --time=12:00:00

SBATCH --nodes=2

SBATCH --tasks-per-node=8

SBATCH -o SeekDeep-%j.out

SBATCH -e SeekDeep-%j.err

setting BARSEQ_PATH variable path

export PATH=path/to/BEAN-counter/master_scripts:$PATH export BARSEQ_PATH=path/to/BEAN-counter/master_scripts

I am then calling the pipeline here: ./process_screen.py config_file.yaml

And here is how the config_file.yaml has been edited. _output_folder: output sample_table_file: sample_table/sample_table_filtered.txt lane_location_file: config_files/lane_locations.txt amplicon_struct_file: config_files/amplicon_struct.yaml gene_barcodefile: barcodes/barcodes.txt

RussianImperialScott commented 5 years ago

Ah! Use

export BARSEQ_PATH=path/to/BEAN-counter/

instead of

export BARSEQ_PATH=path/to/BEAN-counter/master_scripts

Owuorgpo commented 5 years ago

Thanks! Funny that the process_screen.py only moved two lines and failed to load packages again after changing as indicated above. ImportError: No module named fastcluster

Owuorgpo commented 5 years ago

@RussianImperialScott I figured this out. Was just missing some of the python packages. Now the pipeline is working but for some reason, it is not working with lane files. See error below KeyError: 'lane'

params = yaml.load(f) clustering lane1 z-score matrix... could not find 'lane1' zscore matrix clustering lane2 z-score matrix... could not find 'lane2' zscore matrix clustering lane3 z-score matrix... could not find 'lane3' zscore matrix clustering lane4 z-score matrix... could not find 'lane4' zscore matrix clustering lane5 z-score matrix... could not find 'lane5' zscore matrix clustering lane6 z-score matrix... could not find 'lane6' zscore matrix