[LON-CAPA-cvs] cvs: modules /gerd/harvesting seq_taxonomy.pl taxonomy.dat
www
www at source.lon-capa.org
Thu Sep 8 22:44:17 EDT 2011
www Fri Sep 9 02:44:17 2011 EDT
Added files:
/modules/gerd/harvesting seq_taxonomy.pl taxonomy.dat
Log:
Work in progress: classification of assignments
Index: modules/gerd/harvesting/seq_taxonomy.pl
+++ modules/gerd/harvesting/seq_taxonomy.pl
use strict;
my @cats=();
my @iss=();
my @isnots=();
my @equivs=();
my %catidx=();
open(IN,'taxonomy.dat');
my $i=0;
while (my $line=<IN>) {
chomp($line);
my ($cat,$is,$isnot,$equiv)=split(/\t/,$line);
$cats[$i]=$cat;
$iss[$i]=$is;
$isnots[$i]=$isnot;
if ($equiv=~/\w/) {
$iss[$i]=$iss[$catidx{$equiv}];
$isnots[$i]=$isnots[$catidx{$equiv}];
}
$catidx{$cat}=$i;
print $i." ".$cat."\n";
$i++;
}
close(IN);
my $j=0;
open(IN,'seq_subj_keyw.dat');
while (my $line=<IN>) {
chomp($line);
my ($seq,$subs,$keys)=split(/\t/,$line);
print "-------$subs $keys\n";
my %keysw=();
foreach my $keyc (split(/\,/,$keys)) {
my ($key,$cnt)=split(/\:/,$keyc);
$keysw{$key}=$cnt;
}
my %successes=();
foreach my $subc (split(/\,/,$subs)) {
my ($sub,$cnt)=split(/\:/,$subc);
for (my $i=0;$i<=$#cats;$i++) {
if ($cats[$i]=~/^$sub\:/) {
my $totalcount=0;
foreach my $snot (split(/\,/,$isnots[$i])) {
$totalcount-=$keysw{$snot};
}
foreach my $sbe (split(/\,/,$iss[$i])) {
$totalcount+=$keysw{$sbe};
}
if ($totalcount>=$cnt/4.) {
$successes{$cats[$i]}=$totalcount;
}
}
}
}
my $max=0;
my $winner='';
foreach my $suc (keys(%successes)) {
if ($successes{$suc}>$max) {
$max=$successes{$suc};
$winner=$suc;
}
}
print "Winner: $winner\n";
$j++;
if ($j>200) {last;}
}
close(IN);
Index: modules/gerd/harvesting/taxonomy.dat
+++ modules/gerd/harvesting/taxonomy.dat
physics:introduction:mathematics vector,vectors,derivative,integral energy,momentum,force,wave
physics:introduction:units unit,measurement,system energy,momentum
physics:mechanics:linearkinematics speed,velocity,acceleration,distance,displacement,position angular,angle,force,work,atom,quantum,momentum,inertia
physics:mechanics:rotationalkinematics angular,speed,velocity,acceleration,angle work,force,torque,atom,quantum
physics:mechanics:lineardynamics force,acceleration,mass,newton torque,angle,angular,charge,magnetic,atom,quantum,work
physics:mechanics:rotationaldynamics torque,angular,acceleration,inertia atom,quantum,momentum
physics:mechanics:linearmomentum momentum,velocity,mass,collision,collisions,elastic,inelastic angular,atom,quantum
physics:mechanics:angularmomentum momentum,velocity,angular,inertia atom,quantum
physics:mechanics:energy energy,force,distance,work,potential,kinetic,gravitational,gravity entropy,charge,atom,quantum,electric
physics:mechanics:oscillation period,frequency,resonance,amplitude,harmonic,spring wavelength,current
physics:mechanics:wave period,frequency,wavelength,speed sound,doppler
physics:mechanics:sound sound,frequency,wavelength,speed,doppler,pressure,air,hear,water,longitudinal magnetic,electric,field
physics:thermodynamics energy,work,pressure,temperature,gas,ideal,entropy,gas,volume
physics:electromagnetism:electrostatics electric,charge,coulomb,coulombs,field magnet,capacitor
physics:electromagnetism:potentials voltage,potential,field current,ampere,amperes
physics:electromagnetism:capacitance capacitance,capacitor,charge,plate,farad
physics:electromagnetism:magnetism magnetic,current,ampere,amperes,field,magnet,solenoid wave,quantum
physics:electromagnetism:inductance magnetic,induction,inductance,coil,mutual,loop,emf
physics:electromagnetism:dccircuits current,battery,voltage,potential,voltage,resistor,resistance,ampere,resistor frequency,phase,resonance
physics:electromagnetism:accircuits current,voltage,frequency,resonance,phase,ac,oscillator,inductor,inductance,resistor,resistance,capacitor,capacitance pressure,sound,air,wave
physics:electromagnetism:emwaves magnetic,electric,field,speed,wavelength,frequency,amplitude,color,pressure,radiation,intensity lens,interference,sound,air,emf
physics:optics:mirrorslenses light,lens,mirror,lenses,mirrors,focal,concave,convex,virtual,ray,reflection,diffraction
physics:optics:opticalinstruments telescope,microscope,glasses
physics:optics:interference slit,pattern,diffraction,interference quantum
physics:modern:relativity frame,relative,dilation,contraction,time,space,transform,light,observer,speed
physics:modern:quantum spin,quantum,level,energy,atom,atoms,electron,electrons,wave,state,states,line isotope,nuclear,neutron,neutrons
physics:modern:nuclear nucleus,proton,neutron,decay,halflife,atoms,atomic,protons,neutrons,isotope,radioactive,beta,gamma,activity,nuclear,mass,radiation
chemistry:atomsmolecules:nuclear physics:modern:nuclear
chemistry:atomsmolecules:shell physics:modern:quantum
chemistry:atomsmolecules:binding binding,covalent,bond,bonding,ionic
chemistry:thermodynamics physics:thermodynamics
chemistry:phases:transitions phase,temperature,liquid,gas,solid,molecule,pressure
chemistry:phases:solid crystal,solid,structure,lattice
statistics:descriptive:means mean,standard,deviation,value,proability,number,measure,measurement,median,formula
mathematics:functions:trigonometric function,functions,cosine,sine,tangent,sin,cos,period,pi
mathematics:functions:exponential function,functions,exponent,exponential,power
mathematics:functions:logarithmic function,functions,logarithm,logarithmic,hyperbolic
mathematics:functions:extrema function,minimum,maximum,minima,maxima,extrema,local,global,derivative
More information about the LON-CAPA-cvs
mailing list