[Babase] New SEXSKINS rules
kfenn
kfenn at princeton.edu
Fri Jan 26 10:44:24 EST 2007
Hi Karl,
I've done another cleanup on those lingering pregs errors from the v3
run (really they are just gap errors now). I've uploaded to papio:
real_cycgapstf_v4
fake_cycgapstf_v4
undo_fake_cycgapstf_v4
The data files and estimated ddate files have not changed at all.
Shall we run another conversion just to get these cleaned up before I
start messing with RANKS errors?
Tabby
Karl O. Pinc wrote:
> Hi Tabby,
>
> I've changed the SEXSKINS rules so that you can have
> sexskin measurements associated with a female's
> first cycle -- we now recognise that the first cycle
> does not have a Mdate.
>
> Note that there are some sexskin related errors that
> are not checked for as the database is updated.
> For instance, the "static" error checks include
> the statement below and it finds 607 sexskins
> errors.
>
> We don't need to worry about these errors as far
> as the conversion is concerned, and for that matter
> they'll probably go away anyway as gaps get corrected
> and we make sure that all cycles really do have a
> Mdate, a Tdate, and a Ddate, but I figured it's
> worth mentioning.
>
> Anyhow, I think I'm ready to run another conversion when
> you are.
>
>
> SELECT cycles.sname, sexskins.date, sexskins.size
> , 'Error: Cannot have SEXSKINS in a cycle with no Mdate unless
> the cycle resumes a pregnancy or is at menarche or there is a gap
> (CYCGAPS)'
> FROM cycles, sexskins
> WHERE cycles.cid = sexskins.cid
> AND NOT EXISTS (SELECT 1 -- no Mdate
> FROM cycpoints
> WHERE cycpoints.cid = sexskins.cid
> AND cycpoints.code = 'M'
> LIMIT 1)
> AND NOT EXISTS (SELECT 1 -- not a resumption of pregnancy
> FROM pregs
> WHERE pregs.resume = sexskins.cid
> LIMIT 1)
> AND NOT EXISTS (SELECT 1 -- not first cycle
> FROM cycpoints, maturedates
> WHERE cycpoints.cid = sexskins.cid
> AND cycpoints.code = 'T'
> AND maturedates.sname = cycles.sname
> AND maturedates.matured = cycpoints.date
> AND maturedates.mstatus = 'O'
> LIMIT 1)
> AND NOT EXISTS (SELECT 1 -- there is no gap
> FROM cycpoints as cp
> , cycles as cy
> , cycpoints as thiscp
> WHERE cy.sname = cycles.sname
> AND cp.cid = cy.cid
> AND thiscp.cid = sexskins.cid
> AND cp.date < thiscp.date
> AND cp.cid != sexskins.cid
> AND cp.date > (SELECT cycgapdays.date
> FROM cycgapdays
> WHERE cycgapdays.sname =
> cycles.sname
> AND cycgapdays.date <
> thiscp.date
> ORDER BY cycgapdays.date DESC
> LIMIT 1))
> ORDER BY cycles.sname, sexskins.date;
>
>
> Karl <kop at meme.com>
> Free Software: "You don't pay back, you pay forward."
> -- Robert A. Heinlein
>
> _______________________________________________
> Babase mailing list
> Babase at www.eco.princeton.edu
> http://www.eco.princeton.edu/mailman/listinfo/babase
--
Tabby Fenn
Research Assistant
Dept of Ecology and Evolutionary Biology
401 Guyot Hall
Princeton University
Princeton, NJ 08544
609 258-6898 (Ph)
609 258-2712 (Fx)
More information about the Babase
mailing list