Skip to content
New issue

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

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

Already on GitHub? # to your account

Capture sambamba output and pipe to logfile #157

Open
robinandeer opened this issue Oct 26, 2015 · 4 comments
Open

Capture sambamba output and pipe to logfile #157

robinandeer opened this issue Oct 26, 2015 · 4 comments
Assignees

Comments

@robinandeer
Copy link
Contributor

If one runs sambamba through chanjo it would be awesome if the STDOUT/ERR would redirect to the same logfiles, don't you think?

@moonso
Copy link
Contributor

moonso commented Oct 26, 2015

Sure I'll fix this

@moonso
Copy link
Contributor

moonso commented Oct 26, 2015

If I understand correct this is already done. If chanjo is run with a log file the sambamba output will be written here.
See:

def run_sambamba(bam_file, region_file, outfile=None, cov_treshold=()):
    """Run sambamba from chanjo."""
    logger = logging.getLogger(__name__)
    logger = logging.getLogger("chanjo.sambamba")
    log_stream = get_log_stream(logger)
    sambamba_call = [
        "sambamba",
        "depth",
        "region",
        "--regions",
        region_file,
        bam_file
    ]

The logstream-handler should take care of this...

@robinandeer
Copy link
Contributor Author

Indeed, it does seem like it should already handle this.. Can you think of a reason why the "chanjo.sambamba" logger wouldn't be bound to a file handler? That's the only reason I see why it doesn't work :P

@moonso
Copy link
Contributor

moonso commented Oct 26, 2015

I think that the log handler sets up a FileHandler when init_log is called with a file.
Otherwise the sambamba logging will be printed to stderr as expected

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

No branches or pull requests

2 participants