ngmlr icon indicating copy to clipboard operation
ngmlr copied to clipboard

Writing reference index to directory without writing permission: segmentation fault

Open wdecoster opened this issue 6 years ago • 3 comments

Hi,

It took me a while before I realised what the issue was, but when ngmlr tries to write the index ("Writing encoded reference to ...") to a directory to which I don't have writing permission I get a segmentation fault (core dumped) error.

Perhaps this problem could get a nicer error message? Or perhaps an option to specify where to write the index to. It's obviously easy to fix by making a symbolic link of the reference fasta to the current directory.

Cheers, Wouter

wdecoster avatar Jul 10 '17 15:07 wdecoster

Hi Wouter,

thanks for the feedback. I'll try adding a proper error message for this.

Cheers, Philipp

philres avatar Jul 12 '17 13:07 philres

A late follow up on this...

I used the following command: (changed path to reference directory)

zcat fastq/*.fastq.gz | ngmlr --verbose -x ont -t 48 -r /path/to/dir/withoutwritepermission/genome_hg19.fa | samtools sort -o ngmlr_d6843_PromethION_20180207.bam -

and received this as output

ngmlr 0.2.6 (build: Feb  5 2018 15:35:54, start: 2018-02-12.11:45:06)
Contact: [email protected]
Wrinting output (SAM) to stdout
Encoding reference sequence.
Size of reference genome 3101 Mbp (max. 68719 Mbp)
Allocating 1550944936 (3101807213) bytes for the reference.
BinRef length: 1550944891ll (elapsed 653.038025)
0 reference sequences were skipped (length < 10).
Writing encoded reference to /path/to/dir/withoutwritepermission/genome_hg19.fa-enc.2.ngm

After this, the program just quits silently. The file /path/to/dir/withoutwritepermission/genome_hg19.fa-enc.2.ngm does not exist since I don't have writing permission to that, but no error was raised. I softlinked the reference fasta to the current directory and used that file, and now it seems to work.

wdecoster avatar Feb 12 '18 11:02 wdecoster

And not entirely related: combining --verbose with writing the output to stdout goes bonkers, with the reads eventually ending up on my terminal.

wdecoster avatar Feb 13 '18 12:02 wdecoster