Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Path 'analyze' does not exist #19

Closed
Anto007 opened this issue Jul 1, 2021 · 7 comments
Closed

Path 'analyze' does not exist #19

Anto007 opened this issue Jul 1, 2021 · 7 comments

Comments

@Anto007
Copy link

Anto007 commented Jul 1, 2021

I'm sure this is a silly problem with my interpretation of the command-line from the manual but any suggestion would be appreciated here. I ran the below command-line from within the conda environment

pydamage --outdir pydamage_test analyze aligned.bam

and I got this error message: "Error: Invalid value for 'BAM': Path 'analyze' does not exist"

Oddly, doing pydamage aligned.bam generates output but then doing 'pydamage filter pydamage_results.csv' for the output returns the same kind of above error- "Path 'filter' does not exist". It might be also useful to mention in the manual what exact tool and command-lines were used to generate your bam input file. I'm trying to test now with your aligned.bam file that is available on this repository

@maxibor
Copy link
Owner

maxibor commented Jul 1, 2021

Hi @Anto007 ,
Which version of PyDamage are you using ?
The subcommand analyze only appeared from the version 0.6 (not yet released).

You can check the documentation for the current version (0.50beta) here: pydamage.readthedocs.io/en/0.50beta

@Anto007
Copy link
Author

Anto007 commented Jul 2, 2021

Ah I get it now; I'm using 0.50beta version and thank you for your response. This would mean that the filter option won't be available too correct? Also, can you let me know where I can find the pjd value in the output result csv from running the current version? I would appreciate it if you could share here the exact tools/command-lines that you used to generate the sorted and indexed input bam file. Super-interesting tool btw and thank you for bringing this out

@maxibor
Copy link
Owner

maxibor commented Jul 2, 2021

Hey @Anto007 ,
Thanks for your feedback !
What do you mean by the pjd value ?
The content of the csv file is described in the documentation linked above.
Sorting and indexing bam files is done with samtools:

samtools sort yourfile.bam > yourfile.sorted.bam
samtools index yourfile.sorted.bam

@Anto007
Copy link
Author

Anto007 commented Jul 2, 2021

Thanks for your response. By pjd value (sorry I didn't make this clear), I'm referring to the 'p<=0.6' mentioned on the legend of your preprint figure 6. The command-line (bowtie2?) that I was mainly looking for is the one that you used for read mapping to the metagenomic assembly so as to generate the bam file in the first place.

@maxibor
Copy link
Owner

maxibor commented Jul 6, 2021

Hey @Anto007 ,
To filter for , you can use the toolset of your liking (pandas, tidyverse, excel) and look for the damage_model_p column.

By the way, PyDamage 0.6 has been released, so you now have access to the analyze, filter, and cite subcommand !

The bowtie2 command line we used is the following:

bowtie2-build contigs.fa db_name
bowtie2 -x db_name -1 fwd.fastq -2 rev.fastq --very-sensitive -N 1 | samtools view -S -b -F 4 - | samtools sort - > result.sorted.bam

You can see more details here
Cheers,

Maxime

@maxibor maxibor closed this as completed Jul 6, 2021
@Anto007
Copy link
Author

Anto007 commented Jul 6, 2021

Thanks for your response; I was just testing out PyDamage 0.6 from within a conda environment and I'm guessing there's a bug with the filter command? I'm of course aware that filtering can be done anywhere and nobody needs to depend on the pydamage -filter command per se :-) I get the error "FileNotFoundError: [Errno 2] No such file or directory: 'pydamage_results/pydamage_filtered_results.csv' when I run the below command-line from within the pydamage_results subdirectory:

pydamage filter -t 0.67 pydamage_results.csv

When I do head -n3 on pydamage_results.csv, I get the below and so main result file is not empty or anything

reference,predicted_accuracy,null_model_p0,null_model_p0_stdev,damage_model_p,damage_model_p_stdev,damage_model_pmin,damage_model_pmin_stdev,damage_model_pmax,damage_model_pmax_stdev,pvalue,qvalue,RMSE,nb_reads_aligned,coverage,reflen,CtoT-0,CtoT-1,CtoT-2,CtoT-3,CtoT-4,CtoT-5,CtoT-6,CtoT-7,CtoT-8,CtoT-9,CtoT-10,CtoT-11,CtoT-12,CtoT-13,CtoT-14,CtoT-15,CtoT-16,CtoT-17,CtoT-18,CtoT-19
NZ_JHCB02000018.1,1.0,0.013,0.002,0.462,0.098,0.009,0.001,0.043,0.005,0.0,0.0,0.005,3016,0.202,898379,0.042,0.028,0.029,0.007,0.005,0.012,0.013,0.003,0.01,0.002,0.01,0.014,0.015,0.01,0.006,0.01,0.007,0.014,0.008,0.01
NZ_JHCB02000014.1,1.0,0.014,0.002,0.403,0.091,0.009,0.002,0.047,0.005,0.0,0.0,0.005,3545,0.19,1114119,0.044,0.034,0.036,0.011,0.002,0.011,0.012,0.011,0.006,0.004,0.007,0.015,0.011,0.008,0.017,0.009,0.004,0.013,0.011,0.011

The same error "FileNotFoundError: [Errno 2] No such file or directory" when I specified the full path too: pydamage filter -t 0.67 /home/anto/Downloads/pydamage_test_output/pydamage_results.csv

@maxibor
Copy link
Owner

maxibor commented Jul 6, 2021

Hi @Anto007 ,
It's not a bug, it's a feature 😉
To be serious, it's nice to have users who think and use the program differently than I originally thought:
This happened because the default output directory is pydamage_results which you changed in the analyze subcommand by pydamage_test_output, but left to default for the filter subcommand, so it's trying to write in a directory that doesn't exist.

I'll make this more clear and flexible in the next release of PyDamage, thanks for the feedback !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants