nanofilt icon indicating copy to clipboard operation
nanofilt copied to clipboard

no log file output

Open hugs314 opened this issue 3 years ago • 18 comments

run nanofilt and add --logfile file options, but no log file output

hugs314 avatar Apr 26 '21 10:04 hugs314

Could you maybe add some more information?

wdecoster avatar Apr 26 '21 11:04 wdecoster

I ran this command and expecting the log file to be output, but the log file was not output. "NanoFilt --readtype 1D --quality 7 --length 100 --logfile RS3_HS_Hela_siCTL.log RS3_HS_Hela_siCTL.fastq > RS3_HS_Hela_siCTL.filter.fastq"

hugs314 avatar Apr 26 '21 12:04 hugs314

Do you have write permission to the current directory? Did you get the filtered fastq file?

wdecoster avatar Apr 26 '21 14:04 wdecoster

Yes,I have permission to the directory, and I get the filtered fastq file, but no log file

hugs314 avatar Apr 27 '21 00:04 hugs314

Our team is having this same issue. NanoFilt outputs a trimmed read but the logfile is nowhere to be seen.

NanoFilt --logfile full/path/to/cwd/trim_1.log --quality 10 SRR12142658.fastq > SRR12142658_trimmed1.fastq `

Are there any updates on this bug?

LRFreeborn avatar Sep 21 '21 20:09 LRFreeborn

Which NanoFilt version are you running?

wdecoster avatar Sep 22 '21 07:09 wdecoster

Which NanoFilt version are you running?

2.8.0; installed with conda

LRFreeborn avatar Sep 29 '21 23:09 LRFreeborn

Same bug found here, running NanoFilt 2.8.0 from the quay Biocontainer (which I believe is built on conda) via Singularity. Definitely have write permissions and get an output file, but no log file. I put NanoFilt through its paces, so it should have something to report.

$ touch newfile
$ echo $?
0
$ rm newfile
$ gunzip < sample.fastq.gz | NanoFilt --logfile sample.nanofilt.log \
> --length 50 \
> --maxlength 10000 \
> --quality 6 \
> --minGC 0.01 \
> --maxGC 0.99 \
> --headcrop 1 \
> --tailcrop 1 | \
> gzip -9 > sample.trimmed.fastq.gz
$ [ -f sample.trimmed.fastq.gz ]
$ echo $?
0
$ [ -f sample.nanofilt.log ]
$ echo $?
1

MillironX avatar Oct 25 '21 21:10 MillironX

I can confirm we have the same issue. This answer suggests to prepend the logging command

logging.basicConfig(
    format='%(asctime)s %(message)s',
    filename="logfile.txt",
    level=logging.DEBUG)

with

for handler in logging.root.handlers[:]:
    logging.root.removeHandler(handler)

I tested this in jupyter-lab and it solved the issue.

veghp avatar Dec 16 '21 14:12 veghp

Are there any news about this error? it would be great if the log files will be written. I have tried the solution offered in the last comment and added this snippet just before the command in utils.py, but I still don't get any log files.

def start_logging(logfile):
    try:
        for handler in logging.root.handlers[:]:
                logging.root.removeHandler(handler)
        logging.basicConfig(
            format='%(asctime)s %(message)s',
            filename=logfile,
            level=logging.INFO)
    except PermissionError:

I have also changed the permissions to 777 for testing reasons, but no log files are written.

yeroslaviz avatar May 11 '22 08:05 yeroslaviz

Are there any news about this error? I have tried the solution offered in the last comment and added this snippet just before the command in utils.py, but I still don't get any log files.And an error occurred. image So I canceled these two lines of code.

DaShaCHun123 avatar May 19 '22 07:05 DaShaCHun123

Are there any news about this error? I have tried the solution offered in the last comment and added this snippet just before the command in utils.py, but I still don't get any log files.And an error occurred. image So I canceled these two lines of code.

This seems to be a problem with the indentations. I didn't get this error after adding the two lines. You need to make sure, that you keep the rows in the correct format.

yeroslaviz avatar May 19 '22 07:05 yeroslaviz

Thank you. The problem has been solved and the result file has been generated image

DaShaCHun123 avatar May 19 '22 09:05 DaShaCHun123

So how did you get the log file? my script still doesn't produce it?

yeroslaviz avatar May 19 '22 09:05 yeroslaviz

@yeroslaviz Is to add two lines of code according to the method you use. Execute the following command: gunzip -c reads.fastq.gz | NanoFilt -q 10 | gzip > highQuality-reads.fastq.gz

DaShaCHun123 avatar May 19 '22 09:05 DaShaCHun123

Ok I have now a log file. But is this correct to have only one line in the log file?

2022-06-29 14:48:17,621 NanoFilt finished.

I don't have anymore output here.

yeroslaviz avatar Jun 29 '22 12:06 yeroslaviz

If everything went as expected, without any errors, then that is indeed the output in the log file that you would expect.

wdecoster avatar Jun 29 '22 12:06 wdecoster

thanks for the help. I guess it can be closed now.

yeroslaviz avatar Jun 29 '22 13:06 yeroslaviz