-
Notifications
You must be signed in to change notification settings - Fork 8
Initial tskit conversion code #346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Big validation of your general VCZ code.
self.num_records = self.ts.num_sites | ||
self.positions = self.ts.sites_position | ||
|
||
def _make_sample_mapping(self, ploidy): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels like it belongs in tskit. Let's file an issue there to support once we have something working committed here.
|
||
def iter_field(self, field_name, shape, start, stop): | ||
if field_name == "position": | ||
for pos in self.ts.tables.sites.position[start:stop]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.ts.sites_position
- you're creating a copy of the tables every time here!
|
||
self.samples = [vcz.Sample(id=f"tsk_{j}") for j in range(self.num_samples)] | ||
|
||
def iter_alleles(self, start, stop, num_alleles): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes, it's a bit unfortunate we have to do this. I can see ways to work around though.
Stacked on #344, clean diff at 9f5ae9a