text: user842: I have 446 whole Klebsiella Pneumoniae genomes I want to build a phylogenetic tree from. After reading about constructing phylogenetic trees it seems the only option for large numbers of genomes is to isolate a gene with low variability from generation to generation and use this gene to build a tree. For example Lars Jensen recommends using "16S rRNA [or] all ribosomal-protein-coding genes" https://www.biostars.org/p/1930/. What program isolates these genes of interest from the whole genome fasta files and can put them into a multiple alignment file? Or outputs them in a formate ready for a multiple alignment program such as Muave? The reason I say a multiple alignment file is because this it the type of file most phylogenetic tree programs take (I.E. clonalframe).
  
  user581: There are a lot of ways to do this. I suggest using Prokka/Roary to produce a core genome alignment. There's a useful tutorial on the Roary website:
  for file in *
  do
      prokka --kingdom Bacteria --outdir "${file%%.*}"  --genus Listeria --locustag "${file%%.*}" "$file"
      mv "${file%%.*}"/PROKKA_07052017.gff GFF/"${file%%.*}".gff # use current date
  done
  roary -f Alignment -e -n -v GFF/*.gff
  
  Alignment/core_gene_alignment.aln can be used as input for phylogenetic analyses
  
  user982: Extract desired gene sequences using standalone blast 
  Simply provide a reference database with your desired output. 
  Set up your command and away you go. You can set the search up with a for loop for a batch of sequences. Command may look like 
  for f in *.fasta; do
     f=$(basename $f .fasta)
     blastn \
     -outfmt "6 sseqid qseq %" \
     -query $f.fasta \
     -subject reference.fna \
     > out/$f.fas
  done
  
  Watch the output as blast will spit out the gene as detected in + or - sense. If you want to only gather positive sense use -strandoption. 
  The default output I have here is tab output which requires a few sed commands to make into fasta.
  sed -i \
  -e 's/\s*$//g' \
  -e 's/^/>/g'  \
  -e 's/\s\+/\n/g' \
  *.fas 
  
  Online alignment servers are an easy way to align small datasets e.g. EBI
  
original_text: 842: <p>I have 446 whole Klebsiella Pneumoniae genomes I want to build a phylogenetic tree from. After reading about constructing phylogenetic trees it seems the only option for large numbers of genomes is to isolate a gene with low variability from generation to generation and use this gene to build a tree. For example Lars Jensen recommends using "16S rRNA [or] all ribosomal-protein-coding genes" <a href="https://www.biostars.org/p/1930/" rel="noreferrer">https://www.biostars.org/p/1930/</a>. What program isolates these genes of interest from the whole genome fasta files and can put them into a multiple alignment file? Or outputs them in a formate ready for a multiple alignment program such as Muave? The reason I say a multiple alignment file is because this it the type of file most phylogenetic tree programs take (I.E. clonalframe).</p>
   581: <p>There are a lot of ways to do this. I suggest using Prokka/Roary to produce a core genome alignment. There's a useful tutorial on the <a href="https://sanger-pathogens.github.io/Roary/" rel="nofollow noreferrer">Roary</a> website:</p>
  
  <pre><code>for file in *
  do
      prokka --kingdom Bacteria --outdir "${file%%.*}"  --genus Listeria --locustag "${file%%.*}" "$file"
      mv "${file%%.*}"/PROKKA_07052017.gff GFF/"${file%%.*}".gff # use current date
  done
  roary -f Alignment -e -n -v GFF/*.gff
  </code></pre>
  
  <p>Alignment/core_gene_alignment.aln can be used as input for phylogenetic analyses</p>
   982: <p>Extract desired gene sequences using <a href="https://blast.ncbi.nlm.nih.gov/Blast.cgi" rel="nofollow noreferrer">standalone blast</a> </p>
  
  <p>Simply provide a reference database with your desired output. 
  Set up your command and away you go. You can set the search up with a for loop for a batch of sequences. Command may look like </p>
  
  <pre><code>for f in *.fasta; do
     f=$(basename $f .fasta)
     blastn \
     -outfmt "6 sseqid qseq %" \
     -query $f.fasta \
     -subject reference.fna \
     &gt; out/$f.fas
  done
  </code></pre>
  
  <p>Watch the output as blast will spit out the gene as detected in + or - sense. If you want to only gather positive sense use <code>-strand</code>option. 
  The default output I have here is tab output which requires a few sed commands to make into fasta.</p>
  
  <pre><code>sed -i \
  -e 's/\s*$//g' \
  -e 's/^/&gt;/g'  \
  -e 's/\s\+/\n/g' \
  *.fas 
  </code></pre>
  
  <p>Online alignment servers are an easy way to align small datasets e.g. <a href="http://www.ebi.ac.uk/Tools/msa/" rel="nofollow noreferrer">EBI</a></p>
  