User:Karsten Theis/Reviewing tools: Difference between revisions
(4 intermediate revisions by the same user not shown) | |||
Line 3: | Line 3: | ||
==Rubrics for figures and narrative== | ==Rubrics for figures and narrative== | ||
Rubrics are available here: [[Image:Proteopedia rubrics.pdf]]. | |||
The one for figures was written for students | The one for figures was written for students who were asked to review existing pages. The one of the narrative states what I like in the Proteopedia page; I have not yet used it for teaching. | ||
==Video walk-through== | ==Video walk-through== | ||
Line 15: | Line 15: | ||
==Forensics tool== | ==Forensics tool== | ||
To quickly see which PDB files are shown on a page, and have quick access to all the scripts (for example, if you want to find out how a 3D scene was made), I wrote a python script that scans a page, extracts the green links, gathers information from the Jmol state files (which are Jmol scripts), and outputs it as a summary. One such summary is [[Talk:Hen Egg-White (HEW) Lysozyme|here]]. The script is pasted below, and you can run it : | To quickly see which PDB files are shown on a page, and have quick access to all the scripts (for example, if you want to find out how a 3D scene was made), I wrote a python script that scans a page, extracts the green links, gathers information from the Jmol state files (which are Jmol scripts), and outputs it as a summary. One such summary is [[Talk:Hen Egg-White (HEW) Lysozyme|here]]. The script is pasted below, and you can run it (for instance on repl.it) after setting the variable "site" to the page you are interested in: | ||
<pre>site = ' | <pre>site = 'Abrin' | ||
import urllib.request | import urllib.request | ||
Line 26: | Line 23: | ||
database = [] | database = [] | ||
coords = {} | coords = {} | ||
scenes = [] | |||
def chunkit2x(data): | def chunkit2x(data): | ||
Line 52: | Line 50: | ||
else: | else: | ||
print(f'''===={title}====\n{script.split("('")[1]}''') | print(f'''===={title}====\n{script.split("('")[1]}''') | ||
if 'script ' in text: | |||
for scene in text.split('script ')[1:]: | |||
if scene.startswith('/scripts'): | |||
scenes.append(scene.split('.spt')[0].split('/scripts')[1]) | |||
else: | |||
print ('\n\n** What is ', scene) | |||
Line 68: | Line 72: | ||
continue | continue | ||
#print('***', chunk[:70].split("','")) | #print('***', chunk[:70].split("','")) | ||
scene = script.split('.spt')[0] | |||
if scene.startswith('scripts/'): | |||
scenes.append(scene.split('scripts/')[1]) | |||
scr = '/wiki/' + scene + '.spt' | |||
try: | try: | ||
text = chunk.split("','")[1].split("'")[0] | text = chunk.split("','")[1].split("'")[0] | ||
Line 88: | Line 95: | ||
print (f'===Summary===\nTotal of green links: {nr_scr}\n\nTotal of Jmol buttons etc: {nr_com}') | print (f'===Summary===\nTotal of green links: {nr_scr}\n\nTotal of Jmol buttons etc: {nr_com}') | ||
first = True | first = True | ||
Line 126: | Line 114: | ||
if "# caption: " in line: | if "# caption: " in line: | ||
caption = f'<blockquote>{line[11:]}</blockquote>' | caption = f'<blockquote>{line[11:]}</blockquote>' | ||
if line.startswith("# documentBase ="): | |||
page = line.split('title=')[1].split('&')[0] | |||
print ('Available on this page:', page) | |||
if coordf: | if coordf: | ||
if coordf not in coords: | if coordf not in coords: | ||
Line 186: | Line 177: | ||
descr = 'trouble reading file' | descr = 'trouble reading file' | ||
print(f'*{descr}: https://proteopedia.org{pdb}') | print(f'*{descr}: https://proteopedia.org{pdb}') | ||
template = '''==3D scenes== | |||
<StructureSection load='' size='350' side='right' caption='' scene=''>%s | |||
</StructureSection>''' | |||
scenescript = ["<scene name='%s'>%s</scene>" % (x, x) for x in scenes] | |||
print (template % "\n\n".join(scenescript)) | |||
</pre> | </pre> |