We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
We want to take the ARG and add back in the exact matches. This mostly does the job:
import pickle, bz2 mdb = sc2ts.MatchDb(...) with mdb.conn: sql = f"SELECT * FROM samples WHERE hmm_cost == 0 AND match_date <= '{date}'" samples = [] for row in mdb.conn.execute(sql): pkl = row.pop("pickle") sample = pickle.loads(bz2.decompress(pkl)) samples.append(sample) total_exact_matches = sum(ts_in.metadata["sc2ts"]["cumulative_stats"]["exact_matches"]["pango"].values()) assert total_exact_matches == len(samples) tables = ts_in.dump_tables() samples_strain = ts_in.metadata["sc2ts"]["samples_strain"] L = tables.sequence_length for sample in samples: sample.flags |= sc2ts.NODE_IS_EXACT_MATCH # FIXME - time is wrong here, will result in very long branches u = sc2ts.add_sample_to_tables(sample, tables) parent = sample.hmm_match.path[0].parent tables.edges.add_row(0, L, parent=parent, child=u) samples_strain.append(sample.strain) md = tables.metadata md["sc2ts"]["samples_strain"] = samples_strain tables.metadata = md tables.sort() ts_out = tables.tree_sequence() ts_out
The main thing that's wrong here is the node times for the newly inserted samples are wildly wrong.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
We want to take the ARG and add back in the exact matches. This mostly does the job:
The main thing that's wrong here is the node times for the newly inserted samples are wildly wrong.
The text was updated successfully, but these errors were encountered: