pinellolab / STREAM

STREAM: Single-cell Trajectories Reconstruction, Exploration And Mapping of single-cell data
http://stream.pinellolab.org
GNU Affero General Public License v3.0
173 stars 46 forks source link

running peak analysis #104

Closed sylestiel closed 3 years ago

sylestiel commented 3 years ago

Hi If the leaf markers output is severely truncated how can I remedy it. It is displaying only a few chr1 ranges.

Thanks!

huidongchen commented 3 years ago

You can lower cutoff_zscore and increase cutoff_pvalue.

By setting cutoff_zscore=0 and cutoff_pvalue=1, you should be able to keep all the markers.

sylestiel commented 3 years ago

The same issue persists. This is how I'm reading it in:

adata=st.read(file_name='./filtered_peak_bc_matrix/matrix.mtx', file_sample='./filtered_peak_bc_matrix/barcodes.tsv', file_feature='./filtered_peak_bc_matrix/peaks.bed', file_format='mtx',workdir='./resultatac') adata.var.index = adata.var[0].astype(str) + '' + adata.var[1].astype(str) +'_' + adata.var[2].astype(str)

huidongchen commented 3 years ago

it should have nothing to do with the way you read in the data since the leaf marker detection is already working. It's just a matter of how to keep all the markers in the final results.

I am quite puzzled here though. Adjusting the two parameters related to thresholds I mentioned above should be able to preserve all the features stored in adata.var_names.

sylestiel commented 3 years ago

Can you suggest some way to help address this problem?

huidongchen commented 3 years ago

Can you show me the function you are using for leaf marker detection ?

sylestiel commented 3 years ago

st.detect_leaf_markers(adata,marker_list=adata.var[adata.var['pct_cells']>0.1].index[:1000], cutoff_zscore=0,cutoff_pvalue=1, root='S2',n_jobs=4)

huidongchen commented 3 years ago

The function you are using is only scanning the first 1000 peaks. You need to remove [:1000] to scan all of them.

sylestiel commented 3 years ago

st.detect_leaf_markers(adata,marker_list=adata.var[adata.var['pct_cells']>0.1] cutoff_zscore=0,cutoff_pvalue=1, root='S2',n_jobs=4)

Do you mean this? Should I restore the original cut off for z score and pvalue? Thanks for catching the problem!

huidongchen commented 3 years ago

You still need to keep the index. The cutoffs are fine. The following code should work:

st.detect_leaf_markers(adata,marker_list=adata.var[adata.var['pct_cells']>0.1].index,
cutoff_zscore=0,cutoff_pvalue=1,
root='S2',n_jobs=4)
sylestiel commented 3 years ago

Thank you very much!