I'm using subprocesss.run() to run samtools command in python. The code is as below:
result = subprocess.run(['samtools', 'faidx', 'hg38.fa.gz', 'chr1:169699712-169699719'], check=True, stdout = subprocess.PIPE)
and I got the following problem:
CalledProcessError: Command '['samtools', 'faidx', 'hg38.fa.gz', 'chr1:169699712-169699719']' died with <Signals.SIGABRT: 6>.
The samtools command ran successfully in terminal, but failed in subprocess.run.
Does anyone know the cause of the bug? Thank you so much.