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

Feature request: extract user annotation into csv #2

Open
iaaka opened this issue Oct 14, 2024 · 0 comments
Open

Feature request: extract user annotation into csv #2

iaaka opened this issue Oct 14, 2024 · 0 comments

Comments

@iaaka
Copy link

iaaka commented Oct 14, 2024

Hi @prete, I think the most important application would be command line tool to extract user annotation with something like this under hood:

import pandas as pd
import numpy as np

def getUserAnnotation(file_path):
    cloupe = Cloupe(file_path)
    res = {}
    res['barcode'] = cloupe.matrices[0]['Barcodes']
    for ct in cloupe.celltracks:
        res[ct['Name']] = ct['Values']
    res = pd.DataFrame(res)
    res[res == 'UNASSIGNED'] = np.nan
    return res

ua = getUserAnnotation('cloupe.cloupe')
ua.to_csv('user_annotation.csv')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant