DRAGMAP icon indicating copy to clipboard operation
DRAGMAP copied to clipboard

Reading from stdin

Open vladsavelyev opened this issue 4 years ago • 2 comments

Hi,

Wondering if it would be possible to support reading input fastq from stdin? It would facilitate re-alignment from a coordinate-sorted BAM/CRAM with Bazam, as well as sharding for distributed alignment.

Currently DRAGMAP throws an error when using -1 - or -1 /dev/stdin:

$ cat reads.fastq | dragen-os -r /ref/dragmap -1 - --interleaved=1 > result.sam
Failed to parse the options: /opt/conda/conda-bld/dragmap_1632766926290/work/src/lib/options/DragenOsOptions.cpp(298): Throw in function virtual void dragenos::options::DragenOsOptions::postProcess(boost::program_options::variables_map&)
Dynamic exception type: boost::wrapexcept<dragenos::common::InvalidOptionException>
std::exception::what: fastq-file1 or bam-input must point to an existing fastq file

vladsavelyev avatar Jan 25 '22 04:01 vladsavelyev

As a temporary workaround, you could theoretically use a named pipe, e.g. the following for your example:

dragen-os -r /ref/dragmap -1 <(cat reads.fastq) --interleaved=1 > result.sam

niemasd avatar Feb 04 '22 15:02 niemasd

@niemasd, unfortunately, that doesn't work either.

vladsavelyev avatar Feb 06 '22 08:02 vladsavelyev