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

Bam files with no unmapped reads fails to sort #2242

Closed
ghost opened this issue Jan 5, 2020 · 2 comments
Closed

Bam files with no unmapped reads fails to sort #2242

ghost opened this issue Jan 5, 2020 · 2 comments
Milestone

Comments

@ghost
Copy link

ghost commented Jan 5, 2020

I have some exomes that I use for testing. One of them is from a mapped whole genome where I took a subset, reverted to fastq, and then removed unpaired reads. Looks like this resulted in there being no unmapped reads.

Looks like this code is where the error is coming from. Since the structure of unmapped reads is empty, it throws this error

Exception in thread "main" java.lang.UnsupportedOperationException: empty.max
	at scala.collection.TraversableOnce$class.max(TraversableOnce.scala:229)
	at scala.collection.AbstractTraversable.max(Traversable.scala:104)
	at org.bdgenomics.adam.rdd.read.AlignmentDataset$$anonfun$sortByReferencePositionAndIndex$1.apply(AlignmentDataset.scala:1036)
	at org.bdgenomics.adam.rdd.read.AlignmentDataset$$anonfun$sortByReferencePositionAndIndex$1.apply(AlignmentDataset.scala:1028)
	at scala.Option.fold(Option.scala:158)
	at org.apache.spark.rdd.Timer.time(Timer.scala:48)

Edit: Actually. I'm getting this error with simulated reads as well. Might be user error

@ghost
Copy link
Author

ghost commented Jan 6, 2020

Sorry. More noise on my end. Typo error with file path and reference. It looks like the library will not complain about a required file not existing.

@ghost ghost closed this as completed Jan 6, 2020
@heuermh
Copy link
Member

heuermh commented Jan 6, 2020

Are there conditions we should be checking for in ADAM and are not? We're relying on Hadoop-BAM and htsjdk upstream doing the right thing in a lot of BAM code paths, and that is not always a safe idea.

@heuermh heuermh added this to the 0.31.0 milestone Jan 6, 2020
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant