text: user3093: I want to plot a Ramachandran Plot for around 5000 PDB files in python that is saved in a folder in my system. I am searching for a way to make it without accessing each file by hard-coding each file name. Please tell if there is a way around this.
  
  user191: You could probably use PyRAMA for that. The only problem is that by PyRAMA plots to display, while you probably would like to save to a file.
  One way to get around this is to:
  
  Patch PyRAMA to allow ramachandran function to accept output image filename.
  def ramachandran(file_name_list, output_image=None):
      ...
      plt.tight_layout()
      if output_image is not None:
          plt.savefig(output_file, dpi=300)
      else:
          plt.show()
  
  If this works as expected I would really encourage you to submit a pull-request (or at least open an issue) on github.
  Now you can write your main script:
  from glob import iglob
  
  from rama_lib.ramachandran_calc import ramachandran
  
  
  for pdb_filename in iglob('/my/dir/with/pdb/', '*.pdb'):
      img_filename = pdb_filename.rsplit('.', 1)[0] + '.png'
      ramachandran((pdb_filename,), img_filename)
  
  
  I did not test the code, but I hope you get an idea.
  There are also other ways to make a ramachandran plot in python. Please check: 1, 2, 3.
  
original_text: 3093: <p>I want to plot a Ramachandran Plot for around 5000 PDB files in python that is saved in a folder in my system. I am searching for a way to make it without accessing each file by hard-coding each file name. Please tell if there is a way around this.</p>
   191: <p>You could probably use <a href="https://github.com/gerdos/PyRAMA" rel="nofollow noreferrer">PyRAMA</a> for that. The only problem is that by PyRAMA plots to display, while you probably would like to save to a file.</p>
  
  <p>One way to get around this is to:</p>
  
  <ol>
  <li><p>Patch PyRAMA to allow <code>ramachandran</code> function to accept output image filename.</p>
  
  <pre><code>def ramachandran(file_name_list, output_image=None):
      ...
      plt.tight_layout()
      if output_image is not None:
          plt.savefig(output_file, dpi=300)
      else:
          plt.show()
  </code></pre>
  
  <p>If this works as expected I would really <strong>encourage</strong> you to submit a <strong>pull-request</strong> (or at least open an issue) on github.</p></li>
  <li><p>Now you can write your main script:</p>
  
  <pre><code>from glob import iglob
  
  from rama_lib.ramachandran_calc import ramachandran
  
  
  for pdb_filename in iglob('/my/dir/with/pdb/', '*.pdb'):
      img_filename = pdb_filename.rsplit('.', 1)[0] + '.png'
      ramachandran((pdb_filename,), img_filename)
  </code></pre></li>
  </ol>
  
  <p>I did not test the code, but I hope you get an idea.</p>
  
  <p>There are also other ways to make a ramachandran plot in python. Please check: <a href="https://warwick.ac.uk/fac/sci/moac/people/students/peter_cock/python/ramachandran/drawing/" rel="nofollow noreferrer">1</a>, <a href="http://azevedolab.net/resources/rama_plot_py.pdf" rel="nofollow noreferrer">2</a>, <a href="http://mdtraj.org/latest/examples/ramachandran-plot.html" rel="nofollow noreferrer">3</a>.</p>
  