Thanks to visit codestin.com
Credit goes to github.com

Skip to content

samtools not indexing in csi #217

@altuffin

Description

@altuffin

Description of the bug

Despite using the --bam_csi_index flag, samtools index is still trying to index in bai, crashing the pipeline.

Command used and terminal output

# Input

nextflow run nf-core/rnavar -r 1.1.0 -resume \
    --input samplesheet.csv \
    --outdir RNAvar01/ \
    --fasta $SCRATCH/04.Ref/genome.fa.gz \
    --gtf $SCRATCH/04.Ref/genome.gtf \
    --bam_csi_index \
    -profile cropdiversityhpc \
    --skip_baserecalibration \
    --multiqc_title RNAvar01 \

# Output

ERROR ~ Error executing process > 'NFCORE_RNAVAR:RNAVAR:FASTQ_ALIGN_STAR:BAM_SORT_STATS_SAMTOOLS_GENOME:SAMTOOLS_INDEX (T06_2A)'

Caused by:
  Process `NFCORE_RNAVAR:RNAVAR:FASTQ_ALIGN_STAR:BAM_SORT_STATS_SAMTOOLS_GENOME:SAMTOOLS_INDEX (T06_2A)` terminated with an error exit status (1)


Command executed:

  samtools \
      index \
      -@ 1 \
       \
      T06_2A.bam
  
  cat <<-END_VERSIONS > versions.yml
  "NFCORE_RNAVAR:RNAVAR:FASTQ_ALIGN_STAR:BAM_SORT_STATS_SAMTOOLS_GENOME:SAMTOOLS_INDEX":
      samtools: $(echo $(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*$//')
  END_VERSIONS

Command exit status:
  1

Command output:
  (empty)

Command error:
  INFO:    Environment variable SINGULARITYENV_TMPDIR is set, but APPTAINERENV_TMPDIR is preferred
  INFO:    Environment variable SINGULARITYENV_NXF_TASK_WORKDIR is set, but APPTAINERENV_NXF_TASK_WORKDIR is preferred
  INFO:    Environment variable SINGULARITYENV_NXF_DEBUG is set, but APPTAINERENV_NXF_DEBUG is preferred
  [E::hts_idx_check_range] Region 536967197..536967331 cannot be stored in a bai index. Try using a csi index
  [E::sam_index] Read 'LH00235:454:22TTTTLT4:1:2467:1307:1869' with ref_name='Chr1T', ref_length=575865044, flags=163, pos=536967198 cannot be indexed
  samtools index: failed to create index for "T06_2A.bam": Numerical result out of range

Relevant files

No response

System information

nextflow version 25.04.6.5954, HPC, slurm, singularity

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions