This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How can I plot alignment between fastq reads and reference sequence?

I have a fastq file and a fasta file with one sequence. I want to plot a figure to show all the reads in fastq file aligned to the fasta file as shown in the figure below. I want to plot for both plus and minus strands. How can I do this (preferably using R)? Thank you for your help. Plot I want: https://ibb.co/eV7EDx

alignment

1 answer

Just a suggestion:

  1. Align your fastq files against the fasta file, perhaps using bwa or bowtie2 outside of R.
  2. Read the resulting BAM files into R using the GenomicAlignments Bioconductor package.
  3. Visualize data using the Gviz Bioconductor package.

Thank you Sean for your answer. So for the first step, should I just extract the aligned bam file from bowtie alignment?

You just need to align the reads and use that bam file.

Got it. Thank you so much.

Log in to answer this question.