Skip to content
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

change rarefaction output #227

Open
zktuong opened this issue Nov 25, 2022 · 0 comments
Open

change rarefaction output #227

zktuong opened this issue Nov 25, 2022 · 0 comments
Milestone

Comments

@zktuong
Copy link
Owner

zktuong commented Nov 25, 2022

Description of the issue

to just be something like

for grp in ['untreated', 'day1', 'week1']:
    vdj_data = tdata[tdata.obs["TimePoint"] == grp].copy()
    groupby = 'Group_TimePoint'
    clone_key = None
    palette = None
    figsize = (5, 3)
    chain_status_include = ["Single pair", "Orphan VDJ", "Orphan VDJ-exception", "Extra pair", "Extra pair-exception",]
    save = None
    TRUES = ["T", "True", "true", "TRUE", True]
    metadata = vdj_data.obs.copy()
    metadata = metadata[metadata["contig_QC_pass"].isin(TRUES)]
    groups = list(set(metadata[groupby]))
    if type(metadata[clonekey]) == "category":
        metadata[clonekey] = metadata[clonekey].cat.remove_unused_categories()
    res = {}
    for g in groups:
        _metadata = metadata[metadata[groupby] == g].copy()
        res[g] = _metadata[clonekey].value_counts()
        res[g] = res[g].loc[~(res[g]==0)]
        res[g].to_csv('rarefaction/rarefaction_' + g + '.csv')
@zktuong zktuong added this to the 0.4.0 milestone Dec 3, 2022
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

No branches or pull requests

1 participant