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

deepbinner realtime does not quit after sleep 5 #18

Open
thsyd opened this issue Dec 26, 2018 · 3 comments
Open

deepbinner realtime does not quit after sleep 5 #18

thsyd opened this issue Dec 26, 2018 · 3 comments

Comments

@thsyd
Copy link

thsyd commented Dec 26, 2018

Hi,
I hope this has an obvious answer.
I cannot figure out how to get deepbinner to exit its "waiting for new files" mode to continue a bash script/job that I submit to a HPC.

I transfer fast5 files in bulk (not real time) to a HPC and want to run deepbinner -> albacore -> porechop (trim only).
So for fast5 / non basecalled reads deepbinner realtime is the correct approach, right?

Following @rrwick examples (thank you so much for your generosity) i do

where the variables
fast5dirs is an array of foldernames and
NPROCS is number of processes

mkdir demultiplexed_fast5s
for fast5 in ${fast5dirs[*]}; do
     deepbinner realtime --omp_num_threads $NPROCS --in_dir $fast5 --out_dir demultiplexed_fast5s $librarytype
done

and from here let albacore cycle though the barcodeXX folders in the demultiplexed_fast5s folder.

In @rrwick s examples a Ctrl+C is needed from the user to end the deepbinner realtime program. But I cannot figure out how to get this into my bash script.
It might be something with the commands
trap break INT (https://www.unix.com/shell-programming-and-scripting/147781-doing-tail-script-then-return-back-continue-script.html)
and then perhaps sending a SIGINT ? However I am not at a skill level to get this to work.
Has anyone else got a solution working?

Edits: correct display of code block.

@ttubb
Copy link

ttubb commented Jan 24, 2019

Hi,
i'm having a very similar problem caused by the need to manually interrupt the program. For the time being, i use a crude alteration in deepbinners realtime.py script.
I changed this section

                else:
                    print('\nWaiting for new fast5 files (Ctrl-C to stop)', end='',
                         flush=True)
                    waiting = True
            time.sleep(5)

to look like this:

                else:
                    print('\nAll fast5 files processed, exiting')
                    quit()
            time.sleep(5)

This lets me use deepbinner as part of a CWL-Workflow. Note that doing this will make the script useless for the intended "realtime" application where seqencing is still taking place during the execution of deepbinner. Hope it helps!

@elhumble
Copy link

elhumble commented Apr 3, 2019

Hi,
I am having the same problem. I transfer my data to a server where I am running deepbinner through a jobscript. I am using deepbinner realtime as my files are not basecalled. However I am stuck on "waiting for new files" and cannot get deepbinner to exit without deleting the job.

Is there a simple way around this without altering the realtime.py script?

At the moment I am thinking about basecalling first and then running deepbinner classify and bin.

@charlottewright
Copy link

Thank you @ttubb - your fix worked for me when I was having a similar issue.

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

4 participants