Answers.Body: <p>I am not familiar with Gviz, but I am familiar with a variety of tools for visualizing genome features. At the scale of entire microbial genomes, the primary sequence itself is an overwhelming amount of information and can't really be visualized in a meaningful way by itself. I mean, you could color the nucleotides, but few patterns in DNA can be discerned by an unassisted human eye.</p>
  
  <p>What we're typically interested in are features encoded in the genome sequence: protein-coding genes, non-coding RNAs, transposable elements, regulatory elements, binding sites, epigenetic modifications, and so on. A particular scientist is usually only interested in a subset of these features, based on what particular questions they are investigating. In your comment you say you "<em>would like to annotate protein coding regions and compare them to other genomes</em>", so it seems like we're on the same page here.</p>
  
  <p>Visualization tools often display the genome linearly (even, for example, if it's a circular bacterial chromosome), zoomed out so that the nucleotide sequence isn't visible, and overlayed with boxes, arrows, or other glyphs representing the genes or other features of interest. Here are some examples:</p>
  
  <ul>
  <li><a href="https://bioinformatics.stackexchange.com/q/5171/96">This question thread</a> contains images generated with the <a href="http://genometools.org/annotationsketch.html" rel="nofollow noreferrer">GenomeTools AnnotationSketch program</a> (<code>gt sketch</code> command).</li>
  <li>The UCSC genome browser which provides web-based access to <a href="https://genome.ucsc.edu/cgi-bin/hgTracks?db=hg38&amp;lastVirtModeType=default&amp;lastVirtModeExtraState=&amp;virtModeType=default&amp;virtMode=0&amp;nonVirtPosition=&amp;position=chr1%3A11102837%2D11267747&amp;hgsid=706397415_aaU7aADCAPm3vbNa7iTImwAxTqcu" rel="nofollow noreferrer">dynamic displays of the human genome</a> and many other mammalian genomes.</li>
  <li>The <a href="http://software.broadinstitute.org/software/igv/" rel="nofollow noreferrer">IGV browser</a> can be downloaded and easily run on your personal laptop or desktop computer.</li>
  <li>I'm not familiar with <a href="https://bioconductor.org/packages/release/bioc/html/Gviz.html" rel="nofollow noreferrer">Gviz</a>, but it definitely looks like it belongs in this class of tools.</li>
  </ul>
  
  <p>In each of these cases, the visualization software is not doing the work to determine the positions of the genes and other genome features. This was done independently using tools designed for this task, storing the information in an <strong>annotation</strong> file in <a href="https://github.com/The-Sequence-Ontology/Specifications/blob/master/gff3.md" rel="nofollow noreferrer">GFF3</a>, <a href="http://mblab.wustl.edu/GTF22.html" rel="nofollow noreferrer">GTF</a>, or <a href="https://genome.ucsc.edu/FAQ/FAQformat.html#format1" rel="nofollow noreferrer">BED</a> format. The visualization tools need both the genome sequence (in Fasta format) and one or more annotation files (in GFF3, GTF, or BED format) to make meaningful visualizations.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-11T15:33:57.263Z
Answers.Text: I am touching on genomics in a project. So I am quite new to the field and don't really know what is possible, feasible. Thanks a lot for your answer. I am working with bacterial genomes.
Answers.UserDisplayName: Soerendip
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-11T16:32:30.760Z
Answers.Text: I use prokka to annotate the genome.
Answers.UserDisplayName: Soerendip
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-11T17:12:26.267Z
Answers.Text: Prokka should create a GFF3 file, which you can use with the Fasta file to visualize your genome. But of course, you're not the first person to annotate *S. aureus*, so you may also consider downloading a reference annotation for the species from NCBI RefSeq.
Answers.UserDisplayName: Daniel Standage
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-11T17:45:46.790Z
Answers.Text: We will generate lots of genomes that we will have to annotate though. S aureus is not S aureus. There is a spectrum of phenotypes, they all have a different genome. And we will also not be limited to SA. The question here is not how to annotate the genome, but rather the steps necessary to visualize something.
Answers.UserDisplayName: Soerendip
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-11T17:54:24.903Z
Answers.Text: Great. That type of background is very useful to include in the original question, so that the community knows how to focus their answers. I hope this helped!
Answers.UserDisplayName: Daniel Standage
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-11T18:03:00.260Z
Answers.Text: I added it to the main question. Thanks for your comment.
Answers.UserDisplayName: Soerendip
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-11T15:11:09.627Z
Answers.LastActivityDate: 2019-01-11T15:11:09.627Z
Answers.UserDisplayName: Daniel Standage
Body: <p>I downloaded the genome of Staph aureus as DNA sequence from NCBI. I would like to visualize it using Gviz. Is Gviz the right tool to visualize genomes? What are the necessary steps from the sequence file to an object that can be used in Gviz? I searched the user guide and the reference manual. It is stated that it is possible to use fasta file, but not how to use them.</p>
  
  <p>We will generate lots of genomes that we will have to annotate and compare. S aureus is not S aureus. There is a spectrum of phenotypes, they all have a different genomes. And we will also not be limited to SA. The question here is not how to annotate the genome, but rather the steps necessary to visualize something and get going. It is my first steps with genomic data, I don't even know what makes sense.</p>
  
  <p>Here is the head of the file:</p>
  
  <pre><code>&gt;NC_007795.1 Staphylococcus aureus subsp. aureus NCTC 8325 chromosome, complete genome
  CGATTAAAGATAGAAATACACGATGCGAGCAATCAAATTTCATAACATCACCATGAGTTTGGTCCGAAGCATGAGTGTTT
  ACAATGTTCGAACACCTTATACAGTTCTTATACATACTTTATAAATTATTTCCCAAACTGTTTTGATACACTCACTAACA
  GATACTCTATAGAAGGAAAAGTTATCCACTTATGCACATTTATAGTTTTCAGAATTGTGGATAATTAGAAATTACACACA
  AAGTTATACTATTTTTAGCAACATATTCACAGGTATTTGACATATAGAGAACTGAAAAAGTATAATTGTGTGGATAAGTC
  GTCCAACTCATGATTTTATAAGGATTTATTTATTGATTTTTACATAAAAATACTGTGCATAACTAATAAGCAAGATAAAG
  TTATCCACCGATTGTTATTAACTTGTGGATAATTATTAACATGGTGTGTTTAGAAGTTATCCACGGCTGTTATTTTTGTG
  TATAACTTAAAAATTTAAGAAAGATGGAGTAAATTTATGTCGGAAAAAGAAATTTGGGAAAAAGTGCTTGAAATTGCTCA
  AGAAAAATTATCAGCTGTAAGTTACTCAACTTTCCTAAAAGATACTGAGCTTTACACGATTAAAGATGGTGAAGCTATCG
  TATTATCGAGTATTCCTTTTAATGCAAATTGGTTAAATCAACAATATGCTGAAATTATCCAAGCAATCTTATTTGATGTT
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-01-11T13:30:55.080Z
Comments.Text: *what* do you want to visualize? the proteins, the GC content, some other features etc.?
Comments.UserDisplayName: Chris_Rands
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-01-11T13:40:29.257Z
Comments.Text: Ultimately, I would like to annotate protein coding regions and compare them to other genomes.
Comments.UserDisplayName: Soerendip
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-01-11T13:57:08.750Z
Comments.Text: What have you tried to do? Which code have you tried and what errors and message you got?
Comments.UserDisplayName: llrs
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-01-11T17:48:07.330Z
Comments.Text: I would like to visualize annotated genes and compare a set of genomes.
Comments.UserDisplayName: Soerendip
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-01-14T09:01:54.140Z
Comments.Text: This question seems too broad. Could you expand what do you want to compare in a set of genomes, or what type of annotation do you want to see (coding regions or proteins or ORF?)? Also please decide if your question is about seeing annotations OR compare a set of genomes (to compare genomes one would usually calculate some metrics in each genome and compare them). Remember you can [edit] the question.
Comments.UserDisplayName: llrs
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-01-18T17:05:39.453Z
Comments.Text: It is not broad. It is very specific. I am looking for an example to plot SOMETHING with Gviz. An example, for someone who has never used it before.
Comments.UserDisplayName: Soerendip
Tags: <r><genome><visualization><gviz>
Title: How to plot genomic.fna fasta file in R using Gviz?
ThreadText: # How to plot genomic.fna fasta file in R using Gviz?
  
  (Asked by: username_0 on 2019-01-11)
  
  I downloaded the genome of Staph aureus as DNA sequence from NCBI. I would like to visualize it using Gviz. Is Gviz the right tool to visualize genomes? What are the necessary steps from the sequence file to an object that can be used in Gviz? I searched the user guide and the reference manual. It is stated that it is possible to use fasta file, but not how to use them.
  
  We will generate lots of genomes that we will have to annotate and compare. S aureus is not S aureus. There is a spectrum of phenotypes, they all have a different genomes. And we will also not be limited to SA. The question here is not how to annotate the genome, but rather the steps necessary to visualize something and get going. It is my first steps with genomic data, I don't even know what makes sense.
  
  Here is the head of the file:
  
  ```
  >NC_007795.1 Staphylococcus aureus subsp. aureus NCTC 8325 chromosome, complete genome
  CGATTAAAGATAGAAATACACGATGCGAGCAATCAAATTTCATAACATCACCATGAGTTTGGTCCGAAGCATGAGTGTTT
  ACAATGTTCGAACACCTTATACAGTTCTTATACATACTTTATAAATTATTTCCCAAACTGTTTTGATACACTCACTAACA
  GATACTCTATAGAAGGAAAAGTTATCCACTTATGCACATTTATAGTTTTCAGAATTGTGGATAATTAGAAATTACACACA
  AAGTTATACTATTTTTAGCAACATATTCACAGGTATTTGACATATAGAGAACTGAAAAAGTATAATTGTGTGGATAAGTC
  GTCCAACTCATGATTTTATAAGGATTTATTTATTGATTTTTACATAAAAATACTGTGCATAACTAATAAGCAAGATAAAG
  TTATCCACCGATTGTTATTAACTTGTGGATAATTATTAACATGGTGTGTTTAGAAGTTATCCACGGCTGTTATTTTTGTG
  TATAACTTAAAAATTTAAGAAAGATGGAGTAAATTTATGTCGGAAAAAGAAATTTGGGAAAAAGTGCTTGAAATTGCTCA
  AGAAAAATTATCAGCTGTAAGTTACTCAACTTTCCTAAAAGATACTGAGCTTTACACGATTAAAGATGGTGAAGCTATCG
  TATTATCGAGTATTCCTTTTAATGCAAATTGGTTAAATCAACAATATGCTGAAATTATCCAAGCAATCTTATTTGATGTT
  
  ```
  
  **Tags:** r, genome, visualization, gviz
  
  > **Comments:**
  > **username_1**: *what* do you want to visualize? the proteins, the GC content, some other features etc.?  
  > **username_0**: Ultimately, I would like to annotate protein coding regions and compare them to other genomes.  
  > **username_2**: What have you tried to do? Which code have you tried and what errors and message you got?  
  > **username_0**: I would like to visualize annotated genes and compare a set of genomes.  
  > **username_2**: This question seems too broad. Could you expand what do you want to compare in a set of genomes, or what type of annotation do you want to see (coding regions or proteins or ORF?)? Also please decide if your question is about seeing annotations OR compare a set of genomes (to compare genomes one would usually calculate some metrics in each genome and compare them). Remember you can [edit] the question.  
  > **username_0**: It is not broad. It is very specific. I am looking for an example to plot SOMETHING with Gviz. An example, for someone who has never used it before.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_3 on 2019-01-11. Score: 2
  
  I am not familiar with Gviz, but I am familiar with a variety of tools for visualizing genome features. At the scale of entire microbial genomes, the primary sequence itself is an overwhelming amount of information and can't really be visualized in a meaningful way by itself. I mean, you could color the nucleotides, but few patterns in DNA can be discerned by an unassisted human eye.
  
  What we're typically interested in are features encoded in the genome sequence: protein-coding genes, non-coding RNAs, transposable elements, regulatory elements, binding sites, epigenetic modifications, and so on. A particular scientist is usually only interested in a subset of these features, based on what particular questions they are investigating. In your comment you say you "*would like to annotate protein coding regions and compare them to other genomes*", so it seems like we're on the same page here.
  
  Visualization tools often display the genome linearly (even, for example, if it's a circular bacterial chromosome), zoomed out so that the nucleotide sequence isn't visible, and overlayed with boxes, arrows, or other glyphs representing the genes or other features of interest. Here are some examples:
  
  * [This question thread](https://bioinformatics.stackexchange.com/q/5171/96) contains images generated with the [GenomeTools AnnotationSketch program](http://genometools.org/annotationsketch.html) (`gt sketch` command).
  * The UCSC genome browser which provides web-based access to [dynamic displays of the human genome](https://genome.ucsc.edu/cgi-bin/hgTracks?db=hg38&lastVirtModeType=default&lastVirtModeExtraState=&virtModeType=default&virtMode=0&nonVirtPosition=&position=chr1%3A11102837%2D11267747&hgsid=706397415_aaU7aADCAPm3vbNa7iTImwAxTqcu) and many other mammalian genomes.
  * The [IGV browser](http://software.broadinstitute.org/software/igv/) can be downloaded and easily run on your personal laptop or desktop computer.
  * I'm not familiar with [Gviz](https://bioconductor.org/packages/release/bioc/html/Gviz.html), but it definitely looks like it belongs in this class of tools.
  
  In each of these cases, the visualization software is not doing the work to determine the positions of the genes and other genome features. This was done independently using tools designed for this task, storing the information in an **annotation** file in [GFF3](https://github.com/The-Sequence-Ontology/Specifications/blob/master/gff3.md), [GTF](http://mblab.wustl.edu/GTF22.html), or [BED](https://genome.ucsc.edu/FAQ/FAQformat.html#format1) format. The visualization tools need both the genome sequence (in Fasta format) and one or more annotation files (in GFF3, GTF, or BED format) to make meaningful visualizations.
  
  > **Comments:**
  > **username_0**: I am touching on genomics in a project. So I am quite new to the field and don't really know what is possible, feasible. Thanks a lot for your answer. I am working with bacterial genomes.  
  > **username_0**: I use prokka to annotate the genome.  
  > **username_3**: Prokka should create a GFF3 file, which you can use with the Fasta file to visualize your genome. But of course, you're not the first person to annotate *S. aureus*, so you may also consider downloading a reference annotation for the species from NCBI RefSeq.  
  > **username_0**: We will generate lots of genomes that we will have to annotate though. S aureus is not S aureus. There is a spectrum of phenotypes, they all have a different genome. And we will also not be limited to SA. The question here is not how to annotate the genome, but rather the steps necessary to visualize something.  
  > **username_3**: Great. That type of background is very useful to include in the original question, so that the community knows how to focus their answers. I hope this helped!  
  > **username_0**: I added it to the main question. Thanks for your comment.  
  
  ---
  
  