Body: <p>I did illumina read mapping based on a particular gene sequence (reference sequence) using the following command,</p>
  
  <pre><code>bowtie2-build -f ref_gene.fasta ref_index &amp;&amp; bowtie2 -p 4 -N 1 -t -x ref_index -1 genome_R1.fastq -2 genome_R2.fastq -S tal.sam &amp;&amp; samtools view -bS tal.sam | samtools sort - -o tal.bam &amp;&amp; samtools mpileup -uf ref_gene.fasta tal.bam | bcftools call -c | vcfutils.pl vcf2fq &gt; cns.fastq &amp;&amp; seqtk seq -aQ64 -q20 -n N cns.fastq &gt; contig.fasta
  </code></pre>
  
  <p>It maps the reads according to the reference sequence and yields, exactly same length of aligned/assembled sequences. But, I need obtain the unaligned overlapping read bases at the both end (reverse and forward end)  Please see the image for better understanding. </p>
  
  <p><a href="https://i.sstatic.net/IsJOl.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/IsJOl.png" alt="image of the reference gene and the extended read"></a></p>
  
  <p>Is there any way to get the same?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-09-27T13:17:36.860Z
Comments.Text: You're not going to get vastly different replies here than [Biostars](https://www.biostars.org/p/400132/) or [github](https://github.com/dpryan79/SE-MEI/issues/5).
Comments.UserDisplayName: Devon Ryan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-09-27T21:42:16.793Z
Comments.Text: @DevonRyan sniper!
Comments.UserDisplayName: d_kennetz
Tags: <sam><read-mapping><assembly><reads>
Title: How to obtain the extended unaligned bases of the read in reference based genome assembly?
ThreadText: # How to obtain the extended unaligned bases of the read in reference based genome assembly?
  
  (Asked by: username_0 on 2019-09-27)
  
  I did illumina read mapping based on a particular gene sequence (reference sequence) using the following command,
  
  ```
  bowtie2-build -f ref_gene.fasta ref_index && bowtie2 -p 4 -N 1 -t -x ref_index -1 genome_R1.fastq -2 genome_R2.fastq -S tal.sam && samtools view -bS tal.sam | samtools sort - -o tal.bam && samtools mpileup -uf ref_gene.fasta tal.bam | bcftools call -c | vcfutils.pl vcf2fq > cns.fastq && seqtk seq -aQ64 -q20 -n N cns.fastq > contig.fasta
  
  ```
  
  It maps the reads according to the reference sequence and yields, exactly same length of aligned/assembled sequences. But, I need obtain the unaligned overlapping read bases at the both end (reverse and forward end) Please see the image for better understanding.
  
  [![image of the reference gene and the extended read](https://i.sstatic.net/IsJOl.png)](https://i.sstatic.net/IsJOl.png)
  
  Is there any way to get the same?
  
  **Tags:** sam, read-mapping, assembly, reads
  
  > **Comments:**
  > **username_1**: You're not going to get vastly different replies here than [Biostars](https://www.biostars.org/p/400132/) or [github](https://github.com/dpryan79/SE-MEI/issues/5).  
  > **username_2**: @username_1 sniper!  
  
  ---
  
  ## 0 answers
  
  