text: user6948: I am trying to follow the Beauclair et al. paper (free version here https://rnajournal.cshlp.org/content/24/10/1285.long) for identifying defective genomes using their DI-tector program.
  According to figure 2 
  Before using the program itself, it is highly recommended to filter my raw read using bwa and then samtools
  Unfortunately I have no idea where to start - I have browsed official bwa and samtools sites, I have installed them using the following commands:
  sudo apt-get update -y
  sudo apt-get install -y bwa
  
  I have indexed my reference genome with the following command (as I read it is required before the analysis)
  bwa index sequence.fasta
  
  Then, I have installed samtools
  cd ..
  wget https://github.com/samtools/samtools/releases/download/1.9/samtools-1.9.tar.bz2
  tar -vxjf samtools-1.9.tar.bz2
  cd samtools-1.9
  make
  sudo apt install samtools
  
  I wonder what will be the further steps to get these "UNMATCHED READS at the end of step i", since Di-tector program takes virus_reference genome (I have it) and these unmatched reads.
  First of all I want to align my .fastq files vs GCF_000001405.39_GRCh38.p13_genomic.fna - what will be the output file? If I got it right - I need this output file to filter with samtools, am I correct?
  If I am not mistaken, the output after samtools will be the .sam file that I will have to put into a DI-tector - correct?
  
  user8749: If you want to keep track of the unmapped reads, I recommend you to use Bowtie2 instead of bwa.
  Start by building an index:
  bowtie2-build genome.fa genome.fa
  
  Then map your reads, using arguments to save unmapped reads in a specific file like this:
  bowtie2 -x genome.fa -1 reads_1.fq -2 reads_2.fq -S bowtie2_mapping.sam --un-conc-gz unmappedreads_%.fq.gz
  
  It will write the alignment as well as unmappedreads_1.fq.gz and unmappedreads_2.fq.gz that you may use in DI-tector.
  
original_text: 6948: <p>I am trying to follow the Beauclair et al. paper (free version here <a href="https://rnajournal.cshlp.org/content/24/10/1285.long" rel="nofollow noreferrer">https://rnajournal.cshlp.org/content/24/10/1285.long</a>) for identifying defective genomes using their DI-tector program.</p>
  <p>According to figure 2 <a href="https://i.stack.imgur.com/8e1SZ.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8e1SZ.jpg" alt="enter image description here" /></a></p>
  <p>Before using the program itself, it is highly recommended to filter my raw read using <strong>bwa</strong> and then <strong>samtools</strong></p>
  <p>Unfortunately I have no idea where to start - I have browsed official bwa and samtools sites, I have installed them using the following commands:</p>
  <pre><code>sudo apt-get update -y
  sudo apt-get install -y bwa
  </code></pre>
  <p>I have indexed my reference genome with the following command (as I read it is required before the analysis)</p>
  <pre><code>bwa index sequence.fasta
  </code></pre>
  <p>Then, I have installed samtools</p>
  <pre><code>cd ..
  wget https://github.com/samtools/samtools/releases/download/1.9/samtools-1.9.tar.bz2
  tar -vxjf samtools-1.9.tar.bz2
  cd samtools-1.9
  make
  sudo apt install samtools
  </code></pre>
  <p>I wonder what will be the further steps to get these &quot;UNMATCHED READS at the end of step i&quot;, since Di-tector program takes virus_reference genome (I have it) and these unmatched reads.</p>
  <p>First of all I want to align my .fastq files vs <code>GCF_000001405.39_GRCh38.p13_genomic.fna</code> - what will be the output file? If I got it right - I need this output file to filter with samtools, am I correct?
  If I am not mistaken, the output after samtools will be the .sam file that I will have to put into a DI-tector - correct?</p>
   8749: <p>If you want to keep track of the unmapped reads, I recommend you to use <a href="http://bowtie-bio.sourceforge.net/bowtie2/manual.shtml" rel="nofollow noreferrer">Bowtie2</a> instead of bwa.
  Start by building an index:</p>
  <pre><code>bowtie2-build genome.fa genome.fa
  </code></pre>
  <p>Then map your reads, using arguments to save unmapped reads in a specific file like this:</p>
  <pre><code>bowtie2 -x genome.fa -1 reads_1.fq -2 reads_2.fq -S bowtie2_mapping.sam --un-conc-gz unmappedreads_%.fq.gz
  </code></pre>
  <p>It will write the alignment as well as unmappedreads_1.fq.gz and unmappedreads_2.fq.gz that you may use in DI-tector.</p>
  