User:Karsten Theis/Reviewing tools: Difference between revisions

Karsten Theis (talk | contribs)
Karsten Theis (talk | contribs)
 
(4 intermediate revisions by the same user not shown)
Line 3: Line 3:


==Rubrics for figures and narrative==
==Rubrics for figures and narrative==
Rebrics are available [[Image:Proteopedia rubrics.pdf|here]].
Rubrics are available here: [[Image:Proteopedia rubrics.pdf]].
The one for figures was written for students, to help them structure their assigned reviews. I have not yet used the one for the narrative for teaching; it states what I like in the Proteopedia page.
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 = 'CRISPR-Cas9'
<pre>site = 'Abrin'
site = 'CRISPR-Cas9_Part_II'
site = 'User:Karsten_Theis/scene_transitions'
site = 'Alice_Clark/ATPsynthase'


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("','"))
         scr = '/wiki/' + script.split('.spt')[0] + '.spt'
         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}')


def count_a(item):
    start, _, end = item.partition(':')
    if not end:
        return 1
    return (int(end) - int(start) + 1)
def analyze_selection(line):
    items = line.partition('({')[2].partition('})')[0]
    if not items:
        print(line)
        return
    atoms = sum(count_a(x) for x in items.split())
    print(f'{line} #{atoms} atoms selected')
    #rint(atoms, items)
from collections import defaultdict as ddict


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}')
# https://proteopedia.org/cgi-bin/getfrozenstructure?abb78d56d3e07a4e0290a8783dcb8b58
 
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>