Comments (3)
Thanks for the comment and suggestion. It is true that the program will fail with process substitution due to the inability to push back characters to the stream. However, the choice was made to support piping, and your proposed solution breaks that functionality. So if your modified code works for you, good. A better solution would require a bit more thought.
from ngmerge.
Indeed, this is just a feature request and the code I provided was meant to be an example of using gzdopen to avoid closing and reopening the input files. I did not test the modified program with all possible combinations of inputs. For example, my hacks involving fclose
in function runProgram
cause Segmentation fault when running the program with gzipped input files.
However, after omitting those changes, the following commands produced identical output files on my system:
NGmerge -a -1 R1.fastq.gz -2 R2.fastq.gz -o temp1.fastq -i -v -y
zcat R1.fastq.gz | NGmerge -a -1 - -2 R2.fastq.gz -o temp2.fastq -i -v -y
s='H;0~4{g;s/\n//;y/\n/\t/;p;z;h}'; paste -d'\n' <(sed -n -e$s <(zcat R1.fastq.gz)) <(sed -n -e$s <(zcat R2.fastq.gz)) | tr '\t' '\n' | NGmerge -a -1 - -o temp3.fastq -i -v -y
where the last command uses sed
, paste
, and tr
to interleave the input FASTQ files.
So it seems that support for "piping" is not broken.
I agree that a better solution would require a bit more thought, and definitely more testing.
from ngmerge.
I was imprecise when I wrote that support for piping was broken with your modified code. It is the failure to throw an error with a streamed gzip-compressed file:
$ cat zzz3.fq.gz | ./NGmerge_edit -1- -o /dev/null -av
Warning: only one input file specified -- assuming interleaved
Processing files: -,(interleaved)
Fragments (pairs of reads) analyzed: 0
Successfully stitched: 0
Here are the results with the current version of NGmerge:
$ cat zzz3.fq.gz | ./NGmerge -1- -o /dev/null -av
Warning: only one input file specified -- assuming interleaved
Error! Cannot pipe in gzip compressed file (use zcat instead)
$ zcat zzz3.fq.gz | ./NGmerge -1- -o /dev/null -av
Warning: only one input file specified -- assuming interleaved
Processing files: -,(interleaved)
Fragments (pairs of reads) analyzed: 2
Adapters removed: 0
from ngmerge.
Related Issues (20)
- no adapter removal with dovetailed alignments HOT 2
- Reads are good but throws error: "Sequence/quality scores do not match" HOT 4
- is there any option for batch processing? HOT 1
- bioconda install HOT 2
- Merging problem HOT 3
- feature request: use false positive rate instead of error rate? HOT 2
- Documentation Requested for Custom Quality Profile
- Error! Input file does not follow fastq format HOT 2
- (bio)conda recipe needs to be updated
- Error! not matched in input files HOT 2
- Error! Quality scores outside of set range HOT 1
- Error! sample: unknown command-line argument HOT 2
- Error! -2 cannot open file for reading HOT 1
- feature request: ubam input/output? HOT 1
- Undertanding how merged read when bases unmatched HOT 4
- increase highest possible Q value to comply with Aviti high quality data HOT 2
- qual_profile HOT 1
- doesn't easily install on Mac OS HOT 2
- NGmerge failing if read IDs are indicated by a forward slash HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ngmerge.