isovic/racon

--output option?

ranlib opened this issue · 4 comments

I am using racon 1.4.21
I noticed that racon writes output to stdout.
If I redirect the output to a file I find that lines that are not fasta output are included.
See below for an example.
How about a --output option to get the fasta output while error or log messages are still send to stdout?

[racon::Polisher::initialize] loaded target sequences 0.068443 s
[racon::Polisher::initialize] loaded sequences 0.790975 s
[racon::Polisher::initialize] loaded overlaps 0.619227 s
[racon::Polisher::initialize] aligning overlaps [=> ] 0.273249 s^M[racon::Polisher::initialize] aligning overlaps [==> ] 0.273304 s^M[racon::Polisher::initialize] alignin
[racon::Polisher::initialize] transformed data into windows 0.078060 s
[racon::Polisher::polish] generating consensus [=> ] 1.051718 s^M[racon::Polisher::polish] generating consensus [==> ] 1.054752 s^M[racon::Polisher::polish] generating co

contig_1 LN:i:961746 RC:i:563 XC:f:0.989605
TCGCCAAGCTGCGCCTGCTGCTGGTGGAGGAGAAGGCGCGCGGGCTCGGCGTCGGCCGCGCCCTGGTCGAGCAATGCATCCGCGCCGCGCGCGAGAAGGGCTACAAAAAGATGACGCTGTGGACCCAGAGCATCCTGGTCGCCGCGCGCGGCATCTACGCCCGCGCCGGTTTTCAGCGGGTGAAAGAAGAGAAGCATCACAGC

Hello,
the log messages are sent to stderr, while the FASTA is sent to stdout. You can split them with racon <params> > out.fasta 2> log. Hope this helps.

Best regards,
Robert

I had tried that, but it didn't work for me.
I am running racon in a docker image:
docker run --rm -it -v $PWD:/mnt -w /mnt racon:v1.4.21 racon $FASTQ ${OUTPUT}/aln.sam $ASSEMBLY > racon.out
I can grep out the Polisher message lines from racon.out and produce a proper fasta file.
But I think racon would be easier to use if we have an output file option.

I solved my issue: I needed to run docker without the -t option, then stdout and stderr are separate again.

I am glad that it works :)