Open JurMich opened 1 year ago
Did you figure out a solution for this? I'm having a similar issue
Sorry for late reply, I didn't figure the source of issue beyond it being definitely caused by presence of unpaired reads and/or --relaxed option. I circumvented it by filtering unpaired reads (after filtering by samtools to specific loci as in original post) out manually before passing them to bamtofastq without --relaxed option. For me it was feasible as relatively few reads mapped to given loci so it didn't require lot of time/memory. Another option, if you filter to single locus, is to use --locus option in bamtofastq directly (format chrom:start-end is like in samtools). This won't work however if you need to filter reads that map to a list of multiple loci, as in my case.
Hello,
I have .bam file of paired reads that was pre-filtered to specific locus using samtools (ie.):
samtools view -bS possorted_genome_bam.bam -f 2 -F 4 "14:21621800-22552200" "7:142299100-142813500" > possorted_genome_filt.bam
which was indexed afterwards. Now I want to convert it back to fastqs using bamtofastq-1.4.1. Obviously not every read will have its mate, so I wanted to use --relaxed option on resulting .bam. However when I do, I get this error:
Strangely while without --relaxed option bamtofastq does output at least some reads in .fastq files with --relaxed option they are all empty. I am not very familiar with Rust so i am not sure whether this is some kind of bug or I am missing some dependencies. Could you please help me to find out what is happening and how to solve the issue? Sadly, subsetting locus with bamtofastq directly is not an option because bamtofastq doesn't seem to support multiple loci in one command.