Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Null Iterator Error #69

Open
nitishnih opened this issue May 5, 2021 · 6 comments
Open

Null Iterator Error #69

nitishnih opened this issue May 5, 2021 · 6 comments

Comments

@nitishnih
Copy link

Hi,

I recently installed alleleCount v4.2.1 on an HPC cluster using gcc 7.4.0. The installation ran without any problems. However, when testing with example data I receive a long error message, see attached, but here is the top section:

Reading locis
Done reading locis
[E::sam_itr_next] Null iterator
[ERROR] (src/bam_access.c: bam_access_get_position_base_counts:454 errno: No such file or directory) Error detected (-2) when trying to iterate through region.
[ERROR] (./src/alleleCounter.c: main:448 errno: None) Error retrieving stats from bam file for position Y:2934912
*** Error in `alleleCounter': double free or corruption (out): 0x0000000000414b20 ***

The command run was:
alleleCounter -l gender.loci -b test.bam -o test.out

The input files gender.loci and test.bam are from this repository. Running the same command with v4.0.0 works without any errors.

Can you help troubleshoot the problem? Thanks.

@keiranmraine
Copy link
Contributor

Please can you:

  1. Confirm that this is reproducible, the error message states errno: No such file or directory
  2. Provide the complete command line you used
  3. Confirm you input BAM/CRAM header has matching contig naming conventions, message states it is expecting without chr prefix (Y:2934912).

Our internal large-scale CI ran with no errors on the 4.2.1 release.

@nitishnih
Copy link
Author

Thanks for your response, @keiranmraine

  1. I apologize, but I am not exactly sure what you mean when you refer to the error message and reproducibility. I decided to rebuild alleleCount and try the same test again. Here is the full log. Note that certain paths and addresses have been sanitized. To summarize what I show in the log:
  • I set up the cluster environment for building, download alleleCount v4.2.1, run setup.sh
  • Once everything installs, I set up my paths as directed, copy the data from within the repository and run alleleCounter -l gender.loci -b test.bam -o test.out. This is how we tested previous versions of alleleCount installed on our cluster.
  • Once that fails I rerun the same command but with alleleCount v4.0.0. This runs successfully.
  1. The complete command line is alleleCounter -l gender.loci -b test.bam -o test.out

  2. I am not sure about this either, but I ran samtools view -H test.bam and include the output in the full log

Either I am testing the new version of alleleCount incorrectly or I am incorrectly installing the latest version, which differs from how we installed previous versions.

@keiranmraine
Copy link
Contributor

I can confirm a change in the htslib behaviour causes this (1.10 I suspect). I believe it was intended to ensure that applications notice that a contig isn't in the file. We'll have to look into this in more depth.

The problem is that the BAM file that you are using only contains chr 22 (without prefix) but the gender.loci only looks at Y. A BAM file with data for a single chromosome can be processed, BUT a full complement of contigs need to be listed in the @SQ headers due to this

You would need to use the loci_22.txt or loci_snp6.txt files with test.bam, otherwise you aren't testing any counts (although this is run during the install).

@nitishnih
Copy link
Author

Thanks @keiranmraine for the clarification. That makes sense!

@sunnaa0423
Copy link

sunnaa0423 commented Mar 25, 2024

Hi

I got the similar error with alleleCounter(v4.3.0) too!

alleleCounter -l $myPath1/G1000_loci_hg38_chr1.txt -b $myPath2/ABCD_hg38_bwa_sort_rmdup.bam -o out_chr1.txt

And it outputs this info:
Reading locis
Done reading locis
[E::sam_itr_next] Null iterator
[ERROR] (src/bam_access.c: bam_access_get_position_base_counts:454 errno: No such file or directory) Error detected (-2) when trying to iterate through region.
[ERROR] (./src/alleleCounter.c: main:448 errno: None) Error retrieving stats from bam file for position 1:809641
Segmentation fault (core dumped)

Could you please give me some advice?
Thanks

Sunna

@AndyMenzies
Copy link
Contributor

AndyMenzies commented Apr 2, 2024

Could you check the chromosome names between your loci and bam files are consistent. The default for hg38 is to include the chr prefix but your loci file looks to contain position 1:809641 and not chr1:809641

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants