pegasus subset samples for scatter plot

34 views
Skip to first unread message

Lai Ping Wong

unread,
May 18, 2021, 10:36:39 AM5/18/21
to cumulus...@googlegroups.com
hi,
Many thanks for a useful pegasus scRNA bioinformatics tool available for public usage.
I am a beginner of pegasus, I wonder whether pegasus scatter plot allows user to select samples (channel) to plot instead of entire set? if yes, please kindly provide an example of the command to use.

I tried the below but AssertionError
subsamp={'s1', 's2', 's3', 's6'}

eg:pg.scatter(dat, attrs = ['Channel'],restrictions = subsamp, basic = 'umap')

your input is highly appreciated.

thanks,
Regards,
Lai Ping

Department of Molecular Biology
Massachusetts General Hospital
Simches Research Center,
R2200
185 Cambridge St.
Boston, MA 02114.

Yiming Yang

unread,
May 18, 2021, 3:49:17 PM5/18/21
to Lai Ping Wong, Cumulus Support
Hi Lai Ping,

Thank you for reaching out!

Due to the documentation of "scatter" function (https://pegasus.readthedocs.io/en/latest/api/pegasus.scatter.html), the format of "restrictions" parameter should follow "attr:val1,val2,..." format. Taking your example, say if the sample info of your data is stored in "data.obs['Channel']", then you should use

pg.scatter(data, attrs=['Channel'], restrictions="Channel:s1,s2,s4,s6", basis='umap')

You can decide whether to show all the rest points or not by setting "show_background" parameter to True or False. If True, all the rest points will be shown in a grey faded color as background; if False, they won't appear in the resulting plot.

Moreover, you can add more restrictions. E.g.

pg.scatter(data, attrs=['Channel'], restrictions=["Channel:s1,s2,s4,s6", "louvain_labels:1,2"])

will only show points from s1, s2, s4, s6 samples AND belonging to Louvain cluster 1 and 2.

pg.scatter(data, attrs=['louvain_labels', 'Channel'], restrictions=["Channel:s1,s2,s4,s6", "louvain_labels:~1"])

will show points from the 4 samples and not belonging to Louvain cluster 1, and give you two UMAP plots colored by louvain_labels and Channel attributes, respectively.

Hope it helps!


Sincerely,
Yiming

--
You received this message because you are subscribed to the Google Groups "Cumulus Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cumulus-suppo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cumulus-support/1899196755.4759132.1621348596155.JavaMail.zimbra%40molbio.mgh.harvard.edu.
Reply all
Reply to author
Forward
0 new messages