maickrau / GraphAligner

MIT License
255 stars 30 forks source link

GraphAligner closes named pipe (feature request) #105

Open nrizzo opened 2 weeks ago

nrizzo commented 2 weeks ago

Hello!

GraphAligner is not nice to Unix named pipes for the input reads (see below). I think named pipe compatibility could be useful in pipelines that feed GraphAligner the reads and do not want to store them on disk, would you consider adding a flag parameter about it?

# shell 0
$ mkfifo test/fiforead.fa
$ cat test/read.fa > test/fiforead.fa
$ echo $?
141
# shell 1
$ GraphAligner -g test/graph.gfa -f test/fiforead.fa -a test/aln.gaf -x vg
GraphAligner Branch master commit daec67f67a2f50d648a6aa30cbbe5a2949583061 2024-01-19 10:52:13 +0200
GraphAligner Branch master commit daec67f67a2f50d648a6aa30cbbe5a2949583061 2024-01-19 10:52:13 +0200
Load graph from test/graph.gfa
Build alignment graph
Build minimizer seeder from the graph
Minimizer seeds, length 15, window size 20, density 10
Seed cluster size 1
Extend up to 5 seed clusters
Alignment bandwidth 10
Clip alignment ends with identity < 66%
X-drop DP score cutoff 14705
Backtrace from 10 highest scoring local maxima per cluster
write alignments to test/aln.gaf
Align
# I guess here SIGPIPE happens in shell 0

Execution proceeds as normal if I rerun command cat test/read.fa > test/fiforead.fa in the first shell, and I can't seem to replicate a run where this would not align any read (huh, maybe with fastq?). Culprits are the lines src/Aligner.cpp:810-818 opening and closing the read file, commenting out those lines fixes the problem.

Let me know if you want me to attempt the fork, patch, and pull-request. Thanks! ~Nicola

caineblood commented 2 weeks ago

The above comment asking you to download a file is malware to steal your account; do not under any circumstances download or run it. The post needs to be removed. If you have attempted to run it please have your system cleaned and your account secured immediately.