jonahcullen / wags

GNU General Public License v3.0
15 stars 6 forks source link

Error with one_wag #42

Closed tori-rudolph closed 6 months ago

tori-rudolph commented 6 months ago

Hi there! This is my first time working with wags and I keep getting an error while trying to run the one_wag script.

The script I am using is: python /scratch/tr62096/GSD_project/wags/wags/prep_subs.py \ --meta /scratch/tr62096/input.csv \ --fastqs /scratch/tr62096/GSD_project/download_data/ \ --ref canfam4 \ --out /scratch/tr62096/GSD_project/download_data/out \ --bucket RESULTS \ --snake-env snakemake \ --partition batch \ --email tr62096@uga.edu \ --account laclab

The output error I receive is: /scratch/tr62096/GSD_projec/scratch/tr62096/GSD_project/wags/wags/prep_subs.py:377: SyntaxWarning: invalid escape sequence '\ ' " ONE //\ / /\ / /\ / /\ \n" /scratch/tr62096/GSD_project/wags/wags/prepsubs.py:378: SyntaxWarning: invalid escape sequence '_' " _ \:\ / /::\ / /:/ / /:/ \n" /scratch/tr62096/GSD_project/wags/wags/prep_subs.py:379: SyntaxWarning: invalid escape sequence '\ ' " //\ \:\ / /:/\:\ / /:/ /\ / /:/ /\ \n" /scratch/tr62096/GSD_project/wags/wags/prepsubs.py:380: SyntaxWarning: invalid escape sequence '_' " _ \:\ \:\ / /:/~/::\ / /:/_/::\ / /:/ /::\ \n"

I have tried removing the \ or doing \ \ (which I read online would help) in the script above and it does not take care of the above error and creates an additional error of: usage: wags -m -f [-r] -o -b -s -p -e -a [--walltime WALLTIME] [--ref-dir REF_DIR] [--nrun-length NRUN_LENGTH] [--scatter-size SCATTER_SIZE] [--profile PROFILE] [--remote REMOTE] [--sif SIF] [--alias ALIAS] [--no-bqsr] [--left-align] [--sv] [--money] [--pop POP] [--allele-freq ALLELE_FREQ] [-h] wags: error: the following arguments are required: -m/--meta, -f/--fastqs, -o/--out, -b/--bucket, -s/--snake-env, -p/--partition, -e/--email, -a/--account /var/lib/slurmd/job27495980/slurm_script: line 24: --meta: command not found /var/lib/slurmd/job27495980/slurm_script: line 25: --fastqs: command not found /var/lib/slurmd/job27495980/slurm_script: line 26: --ref: command not found /var/lib/slurmd/job27495980/slurm_script: line 27: --out: command not found /var/lib/slurmd/job27495980/slurm_script: line 28: --bucket: command not found

Any information about these errors would be extremely helpful!

jonahcullen commented 6 months ago

Hello! If you have the arguments on separate lines, you will need to use the line continuation symbol \ like

python /scratch/tr62096/GSD_project/wags/wags/prep_subs.py \
--meta /scratch/tr62096/input.csv \
--fastqs /scratch/tr62096/GSD_project/download_data/ \
--ref canfam4 \
--out /scratch/tr62096/GSD_project/download_data/out \
--bucket RESULTS \
--snake-env snakemake \
--partition batch \
--email EMAIL_ADDRESS \
--account laclab

Try that and let me know how it goes!

tori-rudolph commented 6 months ago

Hi Jonah,

I'm not sure why my original code didn't paste correctly because I had the continuation symbol "\" included after every line. But I tried it again by copying and pasting what you provided above. I still received the same error: /scratch/tr62096/GSD_project/wags/wags/prep_subs.py:377: SyntaxWarning: invalid escape sequence '\ ' " ONE /__/\ / /\ / /\ / /\ \n" .... followed by several more lines of this error.

jonahcullen commented 6 months ago

So '\ ' means there is a space after the back slash. In general, copy/pasting is not always the best strategy when working at the command line. Try typing out the full command without any new lines at all, just spaces between arguments.

tori-rudolph commented 6 months ago

Thanks for the advice. I put everything on one line like you suggested: python /scratch/tr62096/GSD_project/wags/wags/prep_subs.py --meta /scratch/tr62096/input.csv --fastqs /scratch/tr62096/GSD_project/download_data/ --ref canfam4 --out /scratch/tr62096/GSD_project/download_data/out --bucket RESULTS --snake-env snakemake --partition batch --email tr62096@uga.edu --account laclab

I still got the same error: /scratch/tr62096/GSD_project/wags/wags/prepsubs.py:380: SyntaxWarning: invalid escape sequence '_' " _ \:\ \:\ / /:/~/::\ / /:/_/::\ / /:/ /::\ \n" /scratch/tr62096/GSD_project/wags/wags/prep_subs.py:381: SyntaxWarning: invalid escape sequence '\ ' " //\ \:\ \:\ //:/ /:/\:\ //:/\/\:\ /__/:/ /:/\:\ \n"

aletko commented 6 months ago

Hi Tori, which version of python do you have? I've experienced strange syntax errors with python 3.12 before. So i suggest to use python 3.11 and see if that solves it for you.

tori-rudolph commented 6 months ago

I am using python 3.10.12

jonahcullen commented 6 months ago

Thanks @aletko! @tori-rudolph would you mind attaching your input.csv file so I can try to replicate this myself?

tori-rudolph commented 6 months ago

Sure! input.csv

jonahcullen commented 6 months ago

Can you activate your environment and then run?

snakemake --version
python --version
jonahcullen commented 6 months ago

This seems to be related to an issue with a change in how f-strings are handled between python and snakemake. The simplest solution (for now) seems to be to downgrade python to 3.10.