masurca icon indicating copy to clipboard operation
masurca copied to clipboard

POLCA Sorting and indexing alignment error

Open slmiles opened this issue 3 years ago • 7 comments

Hi,

I am trying to run POLCA but I am getting the error ' Sorting and indexing alignment file failed' midway through.

My command is:

polca.sh -a genome.fasta -r "reads.fastq.gz reads2.fastq.gz" -m 1G

and the output is:

/home/ubuntu/miniconda3/envs/trycycler/bin/bwa /home/ubuntu/miniconda3/envs/trycycler/bin/freebayes /home/ubuntu/miniconda3/envs/trycycler/bin/samtools [Thu Jan 13 15:30:04 UTC 2022] Creating BWA index for /home/ubuntu/polypolish/polished.fasta [Thu Jan 13 15:30:09 UTC 2022] Aligning reads to /home/ubuntu/polypolish/polished.fasta [Thu Jan 13 15:32:38 UTC 2022] Sorting and indexing alignment file [Thu Jan 13 15:32:38 UTC 2022] Sorting and indexing alignment file failed

Any idea how to resolve this? Thank you

slmiles avatar Jan 13 '22 16:01 slmiles

me too

liaochenlanruo avatar Feb 22 '22 05:02 liaochenlanruo

Hello,

I am also facing the same issue. I am trying to run POLCA to polish my ONT minion assembly with Illumina reads but it is failing at the indexing step.

My command is:

polca.sh -a genome.fasta -r "reads1.fastq.gz reads2.fastq.gz" -t 16 -m 1G

The output:

[Mon 25 Jul 09:48:08 BST 2022] Creating BWA index for /contigs.fasta [Mon 25 Jul 09:50:01 BST 2022] Aligning reads to /.contigs.fasta [Mon 25 Jul 10:38:21 BST 2022] Sorting and indexing alignment file [Mon 25 Jul 10:38:22 BST 2022] Sorting and indexing alignment file failed

I've used this quite a few times in the past but only recently coming up against this error.

Any help would be appreciated.

Thanks

ls-19 avatar Jul 25 '22 10:07 ls-19

I had the error as well. Reinstalling Masurca with Conda worked for me. https://anaconda.org/bioconda/masurca

termithorbor avatar Sep 19 '22 11:09 termithorbor

Hey, I guess it is just a problem with the samtools version. polca uses the following line to call samtools sort: $SAMTOOLS sort -m $MEM -@ $NUM_THREADS <(samtools view -uhS $BASM.unSorted.sam) $BASM.alignSorted 2>>samtools.err && \

So this is using the old style of giving samtools the output prefix (here $BASM.alignSorted) as second positional argument. According to the samtools documentation history, this is not supported by samtools since version 1.3. So installing a samtools version <= 1.2 should solve this. Probably it would be worth to adjust the polca.sh to use the recent samtools interface using the keyword (-o) argument style

andreott avatar Nov 23 '22 09:11 andreott

Hey, I guess it is just a problem with the samtools version. polca uses the following line to call samtools sort: $SAMTOOLS sort -m $MEM -@ $NUM_THREADS <(samtools view -uhS $BASM.unSorted.sam) $BASM.alignSorted 2>>samtools.err && \

So this is using the old style of giving samtools the output prefix (here ) as second positional argument. According to the samtools documentation history, this is not supported by samtools since version 1.3. So installing a samtools version <= 1.2 should solve this. Probably it would be worth to adjust the polca.sh to use the recent samtools interface using the keyword () argument style$BASM.alignSorted``-o

Yes,it does.To avoid reinstalling Masurca or reinstalling samtools<=1.2,the line code $SAMTOOLS view -uhS $BASM.unSorted.sam |samtools sort -m $M EM -@ $NUM_THREADS -o $BASM.alignSorted.bam 2>>samtools.err & &\ were instead of the original code $SAMTOOLS sort -m $MEM -@ $NUM_THREADS <(samtools view -uhS $BASM.unSorted.sam) $BASM.alignSorted 2>>samtools.err && \.It works well.

fanvanf avatar Dec 29 '22 13:12 fanvanf

I'm still running into this error, despite the patch fix.

vidsvur avatar Apr 11 '24 14:04 vidsvur

Was continuing to experience this same issue in spite of the aforementioned patch. An uninstall and reinstall via conda did the job for me

AceM1188 avatar Apr 17 '24 23:04 AceM1188