Closed dgslos closed 4 months ago
Hi,
Yes, that would be possible, I will put your request on the list :-)
Wouter
Any progress on this? :)
I can't implement chopper in my pipeline. I've tried piping with subprocess.Popen
, but get the same error.
I can't implement chopper in my pipeline. I've tried piping with subprocess.Popen, but get the same error.
That should work, in principle. Which (python?) code leads to that error?
My bad. I found a mistake in my code.
It seems to work doing this:
input1 = 'barcode37.fastq'
cmd_cat = ['cat', input1]
fastq = subprocess.Popen(cmd_cat, stdout=subprocess.PIPE)
cmd_chopper = ['chopper', '-l', '1','-q', '3','--headcrop', '30', '--tailcrop', '30', '--threads', '12']
reads_trim = open('test.fastq', 'w')
chopper = subprocess.Popen(cmd_chopper, stdin=fastq.stdout, stdout=reads_trim)
It seems like you are reinventing a workflow system like snakemake. Maybe that solves the needs that you try to take care of in your python code.
I can also recommend the python shlex
module, which you could use to avoid splitting the arguments in a list:
import shlex
cmd_chopper = shlex.split('chopper -l 1 -q 3 --headcrop 30 --tailcrop 30 --threads 12')
Maybe you could consider adding this functionality to make the use of this tool more straightforward?
@wdecoster Any update of this issue? I also found this enhancement to be very useful. But the latest chopper 0.7.0
still do not have the feature.
If you agree, I would be happy to implement this feature and make a PR.
Oh, that would be great! :)
Implemented thanks to @JMencius! I will make a new release soon.
Wanted behavior: Run chopper directly on input files
I noticed that I can run chopper in a pipe like this:
But it seems I cannot run it directly on the file like this:
Resulting in:
Maybe you could consider adding this functionality to make the use of this tool more straightforward?