# Frequency of specific viral sequence in .BAM or .fastq

I was wondering if anyone had any experience 'counting' the frequency of a particular viral sequence in an individual's fastq sequence. So basically, counting the number of occurrences of a particular sequence given someone's fastq file.

The thing is, we must speak with the sequencing company regarding what format we'd like the files and must choose between .bam and .fastq - both would be extra \$. Usually I'd choose .bam out of convenience but I was wondering, given that it has already been aligned the human genome I might not be able to proceed with this 'counting' process. So, my question is: if I were to use samtools - or any other program - to convert the .bam files to .fastq, is there any possibility that I could lose such information - e.g. viral seqs - that would have otherwise been available should I have just gotten the .fastq files directly?

• Rule of thumb is: never go with FASTQ if you can avoid it, it’s a net waste of space. Post-alignment BAMs are as small, or smaller, than gzipped FASTQ, despite containing more information. May 2, 2019 at 18:09