maximilianh / cellBrowser

main repo: https://github.com/ucscGenomeBrowser/cellBrowser/ - Python pipeline and Javascript scatter plot library for single-cell datasets, http://cellbrowser.rtfd.org
https://github.com/ucscGenomeBrowser/cellBrowser/
GNU General Public License v3.0
104 stars 40 forks source link

help with cell annotations #156

Closed Gibbsdavidl closed 4 years ago

Gibbsdavidl commented 4 years ago

Hi there,

Loving the package! I'm trying to add an additional column to the cell metadata. But, when I want to color cells by cell type ... it keeps complaining that the field ('cell_id' below) is a unique identifier ... would really appreciate some help!

The meta.tsv file looks like: batch UMI Count Percent Mitochond. pheno sample Expressed Genes leiden cell_id AAAGTCCCAAGTGGGT-0 0 18572 0.015507215 T genecounts/E02C 1616 9 B_cell_IgA_secreting AAAGTCCTCGGTCTGG-0 0 6601 0.052113317 T genecounts/E02C 1718 9 B_cell_IgA_secreting AACAAGACACATCATG-0 0 25416 0.011724898 T genecounts/E02C 2266 9 B_cell_IgA_secreting AACACACAGTCATACC-0 0 31278 0.011509688 T genecounts/E02C 2319 9 B_cell_IgA_secreting AACAGGGTCCTACGAA-0 0 6433 0.05394062 T genecounts/E02C 1445 9 B_cell_IgA_secreting

and the conf file looks like: name='E02' shortLabel='E02' exprMatrix='exprMatrix.tsv.gz' meta='meta.tsv' geneIdType='auto' defColorField='leiden' labelField='leiden' enumFields=['leiden','cell_id'] coords=[ { "file": "umap_coords.tsv", "shortLabel": "UMAP" } ] markers = [{"file": "markers.tsv", "shortLabel":"Cluster Markers"}] quickGenesFile="quickGenes.tsv"

Any idea? THANK YOU!!

maximilianh commented 4 years ago

Thanks! Glad that someone likes it.

are you able to share the full meta.tsv file? I'd love to look at it, I suspect some newline or tab related problem or something strange with the header lines...

On Tue, Jan 28, 2020 at 1:53 AM David L Gibbs notifications@github.com wrote:

Hi there,

Loving the package! I'm trying to add an additional column to the cell metadata. But it keeps complaining that the field ('cell_id' below) is a unique identifier ... would really appreciate some help!

The meta.tsv file looks like: batch UMI Count Percent Mitochond. pheno sample Expressed Genes leiden cell_id AAAGTCCCAAGTGGGT-0 0 18572 0.015507215 T genecounts/E02C 1616 9 B_cell_IgA_secreting AAAGTCCTCGGTCTGG-0 0 6601 0.052113317 T genecounts/E02C 1718 9 B_cell_IgA_secreting AACAAGACACATCATG-0 0 25416 0.011724898 T genecounts/E02C 2266 9 B_cell_IgA_secreting AACACACAGTCATACC-0 0 31278 0.011509688 T genecounts/E02C 2319 9 B_cell_IgA_secreting AACAGGGTCCTACGAA-0 0 6433 0.05394062 T genecounts/E02C 1445 9 B_cell_IgA_secreting

and the conf file looks like: name='E02' shortLabel='E02' exprMatrix='exprMatrix.tsv.gz' meta='meta.tsv' geneIdType='auto' defColorField='leiden' labelField='leiden' enumFields=['leiden','cell_id'] coords=[ { "file": "umap_coords.tsv", "shortLabel": "UMAP" } ] markers = [{"file": "markers.tsv", "shortLabel":"Cluster Markers"}] quickGenesFile="quickGenes.tsv"

Any idea? THANK YOU!!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/maximilianh/cellBrowser/issues/156?email_source=notifications&email_token=AACL4TPBLIINALNWUMUECSTQ756XHA5CNFSM4KMKTVB2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IJCWIIQ, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACL4TNNKV6H4QWTV3CE5NDQ756XHANCNFSM4KMKTVBQ .

Gibbsdavidl commented 4 years ago

Ah! With your hint, I fixed it.

Turned out that I was missing a column name over the cell barcode 'index'. I guess all columns need a header? Unlike R data.frames where the first column, with no header, can be interpreted as row names.

so it's like:

index batch UMI Count Percent Mitochond. pheno sample Expressed Genes leiden cell_id AAAGTCCCAAGTGGGT-0 0 18572 0.015507215 T genecounts/E02C 1616 9 B_cell_IgA_secreting AAAGTCCTCGGTCTGG-0 0 6601 0.052113317 T genecounts/E02C 1718 9 B_cell_IgA_secreting

And now I can color by cell types and they come up in the panel on the right.

maximilianh commented 4 years ago

Hm. Yes, R is very weird in this respect. If you use the R exporter supplied with cell browser, or the one in Seurat, it takes care of that.

But if you share an example, I can also add a special case to cbBuild to handle this case.

On Wed 29 Jan 2020 at 18:24, David L Gibbs notifications@github.com wrote:

Ah! With your hint, I fixed it.

Turned out that I was missing a column name over the cell barcode 'index'. I guess all columns need a header? Unlike R data.frames where the first column, with no header, can be interpreted as row names.

so it's like:

index batch UMI Count Percent Mitochond. pheno sample Expressed Genes leiden cell_id AAAGTCCCAAGTGGGT-0 0 18572 0.015507215 T genecounts/E02C 1616 9 B_cell_IgA_secreting AAAGTCCTCGGTCTGG-0 0 6601 0.052113317 T genecounts/E02C 1718 9 B_cell_IgA_secreting

And now I can color by cell types and they come up in the panel on the right.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/maximilianh/cellBrowser/issues/156?email_source=notifications&email_token=AACL4TOFFAUR2H537TVM7TDRAG3VHA5CNFSM4KMKTVB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKIBGJY#issuecomment-579867431, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACL4TJUXETUEUYL3TPN4XLRAG3VHANCNFSM4KMKTVBQ .