bhattlab / phanta

Workflow to rapidly quantify taxa from all domains of life, directly from short-read human gut metagenomes
MIT License
60 stars 9 forks source link

Issue with Sample File #40

Closed amgroth closed 10 months ago

amgroth commented 10 months ago

I'm trying to run samples through the pipeline and keep running into the same error when submitting through slurm.

"KeyErrorin line 42 of /Adam/phanta/Snakefile: 'sample_file' File "/Adam/phanta/Snakefile", line 42, in "

I have my samples in a three column tab delimitated file named "sample_file.txt" in the same directory as the Snakemake file. Do you have any insight on what could be causing this error?

Thanks!

meenachakra commented 10 months ago

Hi Adam, could you please share what you entered in the config file for the sample_file?

amgroth commented 10 months ago

/Adam/phanta/sample_file.txt

I wasn't totally clear from the Readme if I needed to include the name of the file or just the path to the directory with the file.

meenachakra commented 10 months ago

Path to the file is great, just to clarify you have the following line in your config, right?

sample_file: /Adam/phanta/sample_file.txt

amgroth commented 10 months ago

Yep, copied below. sample_file: /Adam/phanta/sample_file.txt

The reads I'm referencing in the sample file are in a different directory than the phanta config file and sample file. Is that an issue?

meenachakra commented 10 months ago

Interesting! I really am not sure why this is happening. Having the reads in a different directory shouldn't be an issue as long as you have the full path to them...

What's your full command?

amgroth commented 10 months ago

I realized on issue I had with the command I was running. I had an extra \ in the code. But after fixing that I have a slightly different problem. The run command is copied below and the error I am getting follows that

"sbatch --wrap="snakemake -s /Adam/phanta/Snakefile --configfile /Adam/phanta/config.yaml --jobs 99 --cores 1 --max-threads 16""

Error: SystemExitin line 24 of /Adam/phanta/Snakefile: All samples must be paired or single ended. File "/Adam/phanta/Snakefile", line 42, in File "/Adam/phanta/Snakefile", line 24, in get_sample_reads 143D183 /working_files/CART_Novaseq/May_23/143D183_TAAGGCGA-TCGCATAA_S1_L004_R1_001.fastq.gz /working_files/CART_Novaseq/May_23/143D183_TAAGGCGA-TCGCATAA_S1_L004_R2_001.fastq.gz

148d115 /working_files/CART_Novaseq/May_23/148d115_TAAGGCGA-AGAGGATA_S2_L004_R1_001.fastq.gz /working_files/CART_Novaseq/May_23/148d115_TAAGGCGA-AGAGGATA_S2_L004_R2_001.fastq.gz

yipinto commented 10 months ago

Hi Adam, It seems that the samples file is not parsed well. Can you check your sample file format- tab separated, endline at the last line, and no hidden characters or empty lines. Let me know if that helps

amgroth commented 10 months ago

Thanks for you help with this! I was able to fix my sample file and the program is running correctly now.

yipinto commented 10 months ago

Perfect. Good luck. Let us know if you need any further help