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

JSON and HTML reports are not generated if a directory is given to --json and --html options #40

Closed
thbtmntgn opened this issue Mar 12, 2018 · 4 comments

Comments

@thbtmntgn
Copy link

It's not really a bug but JSON and HTML reports are not generated if a directory is given to --json and --html options.

I wanted to generate JSON and HTML reports into a specific directory with by default names.
I just gave a directory to --json and --html options but it did not generate the reports.

Maybe it's possible to create --output_directory option (current directory by default) so that we just have to change names with --out1, --out2, --json and --html options. Just an idea 🙂 !

@sfchen
Copy link
Member

sfchen commented Mar 13, 2018

But actually this can be done with --json <dir/fastp.json> --html <dir/fastp.html>.

fastp will throw an error and quit immediately if you specify a existing folder name directly.

@thbtmntgn
Copy link
Author

Yes yes of course, it was just an idea!

By default names were ok for me so I just try to give a directory to these 2 options and it did not work.

Thanks for your answer!

@sfchen sfchen closed this as completed Jun 27, 2018
@guidohooiveld
Copy link

guidohooiveld commented Jul 17, 2018

Likely a stupid question, but since I am struggling with something similar:

How to generate a report if I am using for <dir> a character string that is composed of a directory name + fastq name? Thus e.g. 'samplenumber/fastqname'?

My file setup:

workingdir
    seqdata
        - sample1
            --file1.fq.gz
        - sample 2
            --file2.fq.gz


    pfast_out

In the working directory I am executing fastp in a loop using:

#!/bin/bash
find $PWD/seqdata \( -name '*.fq.gz' -or -name '*.fq' \) -print0 | while read -d $'\0' fn
do
echo "Processing sample ${fn}"
fastp -i ${fn} -p -w 4  --json $PWD/pfast_out/${fn}/fastp.json --html $PWD/pfast_out/${fn}/fastp.html
done

The directory pfast_out (in workingdir) is created by me before starting pfast, but the *.json and *.html files are not generated??

Output names are: /workingdir/pfast_out/seqdata/sample1/file1.fq.gz/fastp.json, etc.

I think that since the sub-directory in bold doesn't exists when the files have to be written, the*.json and *.html files are not generated...
How to achieve this?

Thanks for any suggestions!

@guidohooiveld
Copy link

For the archive; to answer my own question:
after 2nd thought the solution was quite simple: before calling fastp I only had to add a command to create a new directory:
mkdir -p $PWD/fastp_out/${fn}
That was all....

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

3 participants