text: user4001: 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? 
  
  user272: If you are interested in a particular viral sequence, it seems wasteful to request bams that are aligned to the human genome, but you could request bams aligned to the human genome with unaligned reads retained. As an alternative, you can generate unaligned bams, where all of the same reads are present that would be present in a fastq but in a bam format. You can revert this to a fastq or align the fastq directly to a viral reference yourself. Aligning to small references is fast. 
  
  user96: Most read aligners will report unaligned reads as well, which presumably will include your viral sequences. I would ask them to formally confirm that the BAM files will contain unaligned reads before choosing that option.
  
original_text: 4001: <p>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.</p>
  
  <p>The thing is, we must speak with the sequencing company regarding what format we'd like the files and must choose between <code>.bam</code> and <code>.fastq</code> - both would be extra $. Usually I'd choose <code>.bam</code> 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 <code>samtools</code> - or any other program - to convert the <code>.bam</code> files to <code>.fastq</code>, 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 <code>.fastq</code> files directly? </p>
   272: <p>If you are interested in a particular viral sequence, it seems wasteful to request bams that are aligned to the human genome, but you could request bams aligned to the human genome with unaligned reads retained. As an alternative, you can generate unaligned bams, where all of the same reads are present that would be present in a fastq but in a bam format. You can revert this to a fastq or align the fastq directly to a viral reference yourself. Aligning to small references is fast. </p>
   96: <p>Most read aligners will report unaligned reads as well, which presumably will include your viral sequences. I would ask them to formally confirm that the BAM files will contain unaligned reads before choosing that option.</p>
  