1
$\begingroup$

I have 133 aligned and sorted BAM files that I am trying to run through the ref_map.pl script from the STACKS pipeline. My script looks as follows:

module load stacks

ref_map.pl -T 15 --popmap B2_filenames.txt --samples /home/heather/scratch/03_sort_and_map/filtered_and_sorted/B2/ --out-path /home/heather/scratch/ref_map_results/full_data

echo "ref_map.pl for B2 dataset completed"

I keep running into the issue where gstacks is unable to read the BAM files. This is what the log file looks like:

  Configuration for this run:
  Input mode: reference-based
  Population map: 'B2_filenames.txt'
  Input files: 133, e.g. '/home/heather/scratch/03_sort_and_map/filtered_and_sorted/B2/1401-47750.sort_filt.bam'
  Output to: '/home/heather/scratch/ref_map_results/full_data/'
  Model: marukilow (var_alpha: 0.01, gt_alpha: 0.05)

Reading BAM headers...
Processing all loci...
Error: No BAM records.
Error: (At the 0th record in file '/home/heather/scratch/03_sort_and_map/filtered_and_sorted/B2/1401-47754_B2.sort_filt.bam'.)
Aborted.

ref_map.pl: Aborted because the last command failed (1).
Last command executed by ref_map.pl was:
  /cvmfs/soft.computecanada.ca/easybuild/software/2020/avx2/Core/stacks/2.64/bin/gstacks -I /home/heather/scratch/03_sort_and_map/filtered_and_sorted/B2/ -M B2_filenames.txt -O /home/heather/scratch/ref_map_results/full_data -t 15

I checked the BAM file with samtools - the headers look ok, and I don't get any output when I run samtools quickcheck, so I can't quite figure out what is causing the issue. I am following the same pipeline as I did with a previous batch of data and can't understand whats going wrong.

$\endgroup$
2
  • $\begingroup$ "the headers look ok, and I don't get any output when I run samtools quickcheck" - this would be true even if the files contained only headers, no? Do you see alignment info when you look beyond the headers? $\endgroup$
    – Ram RS
    Jul 13 at 18:59
  • $\begingroup$ I keep getting a similar error with the sorted and filtered bam file generated from samtools "Error: 'sample.bam': this is a SAM file (and BAM was specified). $\endgroup$
    – aych
    Jul 18 at 20:32

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.