BigelowLab / edna-dada2

Maine eDNA dada2
0 stars 0 forks source link

Transition to using quality_profile_pairs instead of plot_qualityProfiles #9

Closed robinsleith closed 3 years ago

btupper commented 3 years ago

Is this more for you than me?

robinsleith commented 3 years ago

Yeah, just helping myself stay organized

robinsleith commented 3 years ago

But now I am confused. If we are doing "auto" we should output the plots with the fit function drawn on them. It doesnt look like quality_profile_pairs outputs plots? Which function outputs the plots with the fit line?

robinsleith commented 3 years ago

And how do we pass cutoff_params to quality_profile_pairs so that overlap alarm etc incorporate the score from the yaml (32) not the default (30). @btupper I might need your help here.

robinsleith commented 3 years ago

@btupper would you have time Friday to try to get this into the workflow? I will take a stab before then but would be good to touch base.

btupper commented 3 years ago

Sure - how about 10 (after cafe code?)

btupper commented 3 years ago

replace ok <- dada2::plotQualityProfile(x, ...) on https://github.com/BigelowLab/dadautils/blob/main/R/dada2.R#L280 with dadautils::quality_profile_drawing(x, ...)

btupper commented 3 years ago

OK - reinstall both charlier and dadautils packages. Then use quality_profile_pairs()

EDNA = Sys.getenv("EDNA")
devtools::install(file.path(EDNA, "packages", "charlier"), up = FALSE)
devtools::install(file.path(EDNA, "packages", "dadautils"), up = FALSE)
robinsleith commented 3 years ago

I tried replacing dadautils::plot_qualityProfiles with quality_profile_pairs(fq_files) in the workflow but no output files were created, do I need to specify that as an option?

robinsleith commented 3 years ago

And when I try just using quality_profile_drawing I get the following

Error in if (x$opts$aggregate) { : argument is of length zero
Calls: main -> quality_profile_drawing
btupper commented 3 years ago

What config file did you use? I would like to step through the script /mnt/storage/data/edna/dada/projects/robin_foo/dada_project/dada2_18S.R

btupper commented 3 years ago

Oh, I found them! They need to be placed by default in the parent directory of the fastq files. I'll fix that.

/mnt/storage/data/edna/dada/projects/robin_foo/dada_project/cutadapt/quality_profiles.pdf /mnt/storage/data/edna/dada/projects/robin_foo/dada_project/cutadapt/overlap.csv

I'm going to bump them over to process.

Also, I am thinking it might be best in your your workflow script to explicitly provide plot_filename and overlap_filename rather than use the default.

robinsleith commented 3 years ago

Added the following to the workflow


quality_profile_pairs(fq_files, plot_filename=file.path(CFG$output_path, "quality_profiles.pdf"), 
                        overlap_filename=file.path(CFG$output_path, "overlap.csv"))```