You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sorry, this is in sgkit, not tskit (so there is no alignments method). This is what I have at the moment, but it's probably not the recommended way to do it.
importsgkitimportnumpyasnpds=sgkit.simulate_genotype_call_dataset(n_variant=8, n_sample=3, missing_pct=0, phased=True, seed=123)
alleles=ds['variant_allele'].values.astype(str)
sites=np.arange(ds['call_genotype'].shape[0])
forsample, genomein [(2,0), (2,1)]: # just pick the first 2 genomes of sample 2genotypes=ds['call_genotype'][:,sample, genome]
print(f"sample {sample} ({genome}): "+"".join(alleles[sites, genotypes.values]))
Right, but instead of an alignment, it would be helpful to get haplotypes out, I think? E.g. see my example above. Presumably people might want to know (a snippet of) the haplotype for a particular sample? E.g. for SARS-CoV-2 genomes
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
E.g. if I want to show the alignment for certain ranges (e.g. pos 100-120) for some of the sample genomes, like this:
I assume it could be useful to pick out snippets of sample genomes like this, e.g. for verification purposes.
Beta Was this translation helpful? Give feedback.
All reactions