Skip to content

remove first gen - #106

Merged
bhaller merged 2 commits into
MesserLab:masterfrom
petrelharp:no_first_gen
Sep 2, 2020
Merged

bhaller merged 2 commits into
MesserLab:masterfrom
petrelharp:no_first_gen

Conversation

@petrelharp

Copy link
Copy Markdown
Collaborator

Here's a start at this.

Also, adding "stage" to the metadata.

I don't think we need to do anything different on reading in files: these may have individuals marked FIRST_GEN, but these are not samples, so everything should just work out. (They may persist through luck, and keep the flag, but that's ok.)

Simliarly, we don't set the stage on loading the tree sequence - although we could check for consistency.

This has all the changes in #101 as well, so the diff will look reasonable once that's merged.

@bhaller

bhaller commented Aug 28, 2020

Copy link
Copy Markdown
Contributor

Hey. The previous PR is merged now, but the "files changed" for this PR still seems to include all the diffs from that previous PR. Maybe this PR needs to be rebased or something? Anyway, I'll wait for you to fix this situation before I look at it further. :->

@petrelharp

Copy link
Copy Markdown
Collaborator Author

hm, yep, needed a rebase for some reason.

Comment thread core/slim_globals.h Outdated
#define SLIM_TSK_INDIVIDUAL_ALIVE ((uint32_t)(1 << 16))
#define SLIM_TSK_INDIVIDUAL_REMEMBERED ((uint32_t)(1 << 17))
// DEPRECATED:
#define SLIM_TSK_INDIVIDUAL_FIRST_GEN ((uint32_t)(1 << 18))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're no longer using this anywhere in the code, can we actually comment this line out, to ensure that nobody uses it?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I guess so - I thought we'd need to keep it around to load old files, but since we don't...

Comment thread core/slim_sim.cpp Resolved
Comment thread core/slim_sim.cpp Outdated
j["metadata"]["individuals"]["flags"]["17"]["description"] = "the individual was requested by the user to be remembered";
j["metadata"]["individuals"]["flags"]["18"]["name"] = "SLIM_TSK_INDIVIDUAL_FIRST_GEN";
j["metadata"]["individuals"]["flags"]["18"]["description"] = "the individual was in the first generation of a new population";
j["metadata"]["individuals"]["flags"]["18"]["description"] = "the individual was in the first generation of a new population (DEPRECATED)";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we no longer write this flag out (right?), do we need to describe it in our metadata?

Comment thread core/subpopulation.cpp Resolved
@bhaller

bhaller commented Aug 31, 2020

Copy link
Copy Markdown
Contributor

I just made a few comments. Seems pretty straightforward, but I haven't thought about it very hard. Does it pass all of your tests? I can test it tomorrow with crosscheck, etc.

@petrelharp

Copy link
Copy Markdown
Collaborator Author

I haven't tested yet - I am still getting the pyslim changes together. I'll let you know when that all works.

Comment thread core/slim_sim.cpp Outdated
}
else
{
// this case has a fash search (hash table), but the unordered_map is slow to build

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might as well fix the typo while you're modifying this code, fash->fast

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh I thot u meant "fashionable search" ;)

Comment thread core/slim_sim.cpp
}
}

void SLiMSim::UnmarkFirstGenerationSamples(tsk_table_collection_t *p_tables)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh man, this feels good :->

Comment thread treerec/tskit/tables.c
goto out;
}
simplifier_map_mutations(self, input_id, x->left, x->right, x->node);
simplifier_map_mutations(self, input_id, x->left, x->right, output_id);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds like this change will be in a tskit point-release soon; I guess we're taking it early, and will take the rest of the tskit changes that are in that point-release with a separate PR, also for SLiM 3.5, right? And then hopefully we're done with all this tskit fallout for a while.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, that's my thought.

removed FIRST_GEN whatnot

minor tweaks

search is fast not fashionable
@bhaller
bhaller merged commit 15bb298 into MesserLab:master Sep 2, 2020
@petrelharp
petrelharp deleted the no_first_gen branch December 13, 2023 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants