Giter Club home page Giter Club logo

giotto's Introduction

Dries Lab Website

This is the website of our academic research group at Boston University, adapted from the Allan Lab website

This website is powered by Jekyll and some Bootstrap, Bootwatch. We tried to make it simple yet adaptable, so that it is easy for you to use it as a template. Plese feel free to copy and modify for your own purposes. You don't have to link to us or mention us (but of course we appreciate it).

Go to aboutwebsite.md to learn how to copy and modidy this page for your purpose.

Copyright Allan Lab. Code released under the MIT License.

giotto's People

Contributors

actions-user avatar ameliazug avatar andrewdchen avatar bernard2012 avatar cgaray-p4 avatar ed2uiz avatar emmakelley avatar gcyuan avatar iqraamin avatar irzamsarfraz avatar jiajic avatar josschavezf avatar junxiangxu avatar lihpsg avatar mattobny avatar murraylf avatar ndelrossi7 avatar pacificma avatar pratishthaguckhool avatar rafaeldossantospeixoto avatar rdong08 avatar rubd avatar sjcshin avatar skyyuntian avatar tianxiaonyu avatar wwang-chcn avatar xazra avatar yeung-jsn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

giotto's Issues

Allow for extensibility in pDataDT

Currently pDataDT does checks for specific class types, but does not allow use of classes that have been derived from these. Can the following edits be made to allow for inheritance of these classes?
image

Warn that `python.app` is only for OSX in pip instructions as well

Hi,

I was following your Python manual installation instructions (https://rubd.github.io/Giotto_site/articles/installation_issues.html#python-manual-installation) using the pip installation and the install kept failing at python.app. It took me a while before I noticed your comment in the Conda install section that says "(!!only for OSX!!)". So I suggest also putting that comment in a place where pip users will see it.

Thank you for the really nice package otherwise!

sign_matrix for runSpatialDeconv

Good afternoon,

Thank you for the nice package. We are excited to try runSpatialDeconv with DWLS; however, I am unable to find document on what the format should be for the sign_matrix. What should the sign_matrix look like?

Thank you!

Jennifer

get10Xmatrix: Unable to read Visium matrix if total unique spatial barcodes <4992

Greetings,

I've used the get10Xmatrix to import previous Visium datasets. One of our 4 samples processed in batch with identical parameters throws an error when attempting to generate the sparse matrix at the end of get10Xmatrix.

From my understanding, it seems like the error pertains to the matrix.mtx file. Each row is a "read", and each column is a different value corresponding to the read. gene_id_num is a numerical identifier of the gene name gene_id. cell_id is the specific spot that the read came from, and there should be 4992 unique entries of cell_id. If 2 rows contain the same transcript from the same spot, umi is incremented from 1 by 1. The problem here is that there are no transcripts that originate from one specific spot (cell). This causes the number of unique entries of cell_id to be equal to 4991 instead of 4992.

Using docker image: docker-giotto-1.0.2.7z

Raw feature matrix which throws the error:
raw_feature_bc_matrix.zip

If there is an updated version where this issue is resolved, could you point me to where I can find the docker image? Furthermore, do I need to do a separate install as outlined in (http://spatialgiotto.rc.fas.harvard.edu/giotto.install.docker.html), or is there a way to update existing images?

Error with runSpatialDeconv for giotto suite

Hi,

I am trying to run this code

giotto_obj <- runSpatialDeconv(gobject = giotto_obj, deconv_method = "DWLS", expression_values = "normalized", logbase = 2, cluster_column = "leiden_clus", sign_matrix = sign_matrix, n_cell = 10, cutoff = 2, name = "DWLS_1")

and getting this error

See help("Deprecated")
NULL
No spatial locations have been selected, the first one - raw - will be used
No spatial locations have been selected, the first one - raw - will be used
Error in quadprog::solve.QP(D, d, A, bzero) :
  constraints are inconsistent, no solution!
Calls: runSpatialDeconv ... optimize_deconvolute_dwls -> solve_OLS_internal -> <Anonymous>
In addition: Warning message:
'select_expression_values' is deprecated.
Use 'get_expression_values' instead.
See help("Deprecated")
Execution halted```

Any particular reason for this problem?

Best regards!

error when run doHMRF

Hi,

I just run the example code in mini seqFISH page,

seqfish_mini = addHMRF(gobject = seqfish_mini,
HMRFoutput = HMRF_spatial_genes,
k = 9, betas_to_add = c(28),
hmrf_name = 'HMRF')

it turns that:
expression_matrix.txt already exists at this location, will be overwritten

spatial_genes.txt already exists at this location, will be overwritten

spatial_network.txt already exists at this location, will be overwritten

spatial_cell_locations.txt already exists at this location, will be overwritten
[1] "/Users/Huimin/Library/r-miniconda/envs/giotto_env/bin/pythonw /Library/Frameworks/R.framework/Versions/4.1/Resources/library/Giotto/python/reader2.py -l "/Temp//11_HMRF//Spatial_genes/SG_top100_k9_scaled/spatial_cell_locations.txt" -g "/Temp//11_HMRF//Spatial_genes/SG_top100_k9_scaled/spatial_genes.txt" -n "/Temp//11_HMRF//Spatial_genes/SG_top100_k9_scaled/spatial_network.txt" -e "/Temp//11_HMRF//Spatial_genes/SG_top100_k9_scaled/expression_matrix.txt" -o "/Temp//11_HMRF//Spatial_genes/SG_top100_k9_scaled/result.spatial.zscore" -a test -k 9 -b 28 2 2 -t 1e-10 -z none -s 100 -i 100"
Traceback (most recent call last):
File "/Library/Frameworks/R.framework/Versions/4.1/Resources/library/Giotto/python/reader2.py", line 141, in
mat, genes, cells = read_expression_classic(args.expression)
File "/Library/Frameworks/R.framework/Versions/4.1/Resources/library/Giotto/python/reader2.py", line 68, in read_expression_classic
f = open(n)
FileNotFoundError: [Errno 2] No such file or directory: '
/Temp//11_HMRF//Spatial_genes/SG_top100_k9_scaled/expression_matrix.txt'

My Rstudio version is 4.1.0 and Giotto version is 1.0.4, I run the code on Mac iOS Big Sur 11.3. Could you please help me with that? Thank you!

Error During runSpatialDeconv

Hello! I am getting the below error from runSpatialDeconv:

Error in enrich_matrix[, ct_spot_k[m]] : subscript out of bounds
Calls: runSpatialDeconv -> runDWLSDeconv -> spot_deconvolution -> which
In addition: Warning message:
In cbind(allCounts_DWLS, solDWLS) :
  number of rows of result is not a multiple of vector length (arg 2)
Execution halted

I have used the same code for other spatial slices utilizing the same sign_matrix successfully but for this sample I am getting the above error and I am not entirely sure why. Any guidance as to what the issue might be would be greatly appreciated.

Thanks!
David Martin

Error in svd(x, nu = 0L, nv = 0L) : infinite or missing values in 'x'

Hello, I'm trying to reveal reference cell type's spatial pattern on Visium samples following giotto's procedure like below.

[WIth 7 Visium samples]

createGiottoVisiumObject -> normalizeGiotto -> calculateHVG -> runPCA -> createNearestNetwork -> doLeidenCluster

signature_matrix <- makeSignMatrixPAGE(sign_names = levels(factor(reference_data$Major_compartment)),
sign_list = reference_data_marker_lists)

my_giotto_object <- runSpatialDeconv(gobject = giotto, sign_matrix = signature_matrix)

But, I'm facing the error like on the title so I wonder what's the problem of it. Sorry for the naive question.

Thank you!

How do I combine multiple samples in giotto?

Is there a way to combine multiple samples in giotto? I was looking at the manual and could not find anything regarding that I was wondering if it is possible to do this in giotto? if not is there a workaround for the same?

Thank you!

Version mismatch for the Docker image of the Giotto viewer

Hello, thank you for contributing to such a wonderful tool. I was trying to install the Giotto viewer on my Windows computer. When I followed the instructions and downloaded the Docker image from this website (http://spatialgiotto.rc.fas.harvard.edu/giotto.install.docker.html). The downloaded file is shown as docker-giotto-4.3.7z but the version showed as 4.2 after unzipping it using 7zip (see below).
image
Is it okay to continue installing this docker image and use the current version of vignette on this? Just want to make sure that the workflow vignette was built under the correct version of Docker image. Thank you so much in advance.

Unable to generate metagenes following the guide on the giotto website.

Hi,

I am trying to generate the metagenes and the spatial plots using the information here https://rubd.github.io/Giotto_site/articles/tut10_giotto_spatcoexpression.html but when ever I come at the createMetagenes step I get the following error :-

B185_1 = createMetagenes(B185_1,expression_values = c("scaled"),gene_clusters = cluster_genes, name = 'cluster_metagene',return_gobject=T)

Error in select_expression_values(gobject = gobject, values = values) : no slot of name "norm_scaled_expr" for this object of class "giotto"

I only have three slots in my B185_1@expression$rna object namely
[1] "raw" "normalized" "scaled"

I was wondering if there is any step that needs to be run before the metagene generation steps on https://rubd.github.io/Giotto_site/articles/tut10_giotto_spatcoexpression.html for generating norm_scaled_expr slot.

Thanks!

Tutorial not updated?

Hi,
I am trying to work on the tutorial here: http://spatialgiotto.rc.fas.harvard.edu/giotto.visium.brain.html
I was able to finish all the installation successfully, but very strangely, I am unable to run some of Giotto functions.
for example: createGiottoInstructions, get10Xmatrix are not found.
But other seem to be recognized like createGiottoObject.
The functions I mentions that were not found, were also not listed here: Documentation for package ‘Giotto’ version 0.1.0.
What makes me think you have might have made changes in the package without updating the tutorials.
Right now I am unable to run the tutorial - your help in solving this problem would be appreciated.

Ornit

doHMRF error

Hello, I ran mini_seqfish.Rmd in your vignettes directory, everything went well before, but when I ran to doHMRF, the error showed that there was a lack of <blocks. txt> . I would like to ask if you have ever encountered such an error and how to solve it

CreateGiottoVisiumObject expr_data file

Hello,

I have a question regarding the expr_data file - as I understand, when you enter 'filter' or 'raw' here, Giotto automatically looks for the _feature_bc_matrix folder that contains the barcodes, features, and matrix files. Is there a way to specify or read directly from the .h5 file instead? It seems we don't have the other files saved and do not have access to CellRanger tools. Thanks for the help!

How to add cell-type annotation in tutorial of mouse Visium kidney??

Hi,

Thank you for your developing Giotto and kind tutorials.
I'm currently demonstrating tutorials and have a question.

The mouse Visium kidney tutorial part 7 suggested that we can add cell type annotation based on the procedure of mouse Visium brain dataset.
However, I still didn't understand what kind of codes I should prepare for running "PAGE" and "RANK" methods.

https://rubd.github.io/Giotto_site/articles/mouse_visium_kidney_200916.html

In this case, do I have to add external data on my own??

It would be very grateful for your answer.

Sincerely yours,

Giotto cell-cell interaction analysis

Hey,
Firstly,thanks for the great tool !

Can Giotto support cell-cell interaction analysis or ligand-receptor interaction analysis on merfish data?

Sincerely looking forward to your reply!

CreateGiottoImage x,y limits

Hello,

Could you please provide some guidance on how to adjust the xmin, xmax, ymin, ymax values in CreateGiottoImage? Is it an offset or a multiplicative factor? I have been trying to play around with my values; I got the size of the images (visium and low-res tissue image) to be similar but there seems to be a lateral shift in the image regardless (the low-res image is always shifted to the right) and so it doesn't align.

Thanks for the help!

Update Dependencies

When installing this software for R, it requires Bioconductor's ‘ComplexHeatmap’, ‘scran’, ‘qvalue’, and ‘lfa’.

Missing functions from auxiliary_giotto.R

Hi! Working from the suite branch on a Docker container. I noticed that certain functions previously in auxiliary_giotto.R such as rowMeans_giotto() are no longer present. In the current auxiliary_giotto.R file rowMeans_giotto(temp) is called but the function itself does not exist. It was previously available in NAMESPACE prior to the suite branch getting an update 7 days ago.

spatPlot2D not recognizing color vector fi select: point shape="voronoi"

Hello Ruben,

I am contacting you because I have noticed something strange happening when I call spatPlot2D(). Basically I have a vector of colors that I would like to use instead of the default ones. If I select as point shape either "border" or "no_border" the function accept the colors, but if I select "voronoi" it plots only the first color of the list. I am attaching a plot I have generated with default color to show you that data are fine, it is just a banal problem that I do not understand if depend on something wrong i am doing or it is a possible bug

image

Thanks in advance for your help
SN

Error in quadprog::solve.QP(D, d, A, bzero) : matrix D in quadratic function is not positive definite!

Hello,

I am trying to perform deconvolution on some spatial data. I have had success running Giotto::runDWLSDeconv() previosuly but now I am using a larger signature matrix and it appears that quadprog::solve.QP() is complaining about a matrix not being positive definite, which is something I don't have much experience nor understand what it means exactly.

The full error message is:

Error in quadprog::solve.QP(D, d, A, bzero) : matrix D in quadratic function is not positive definite!
6.
stop("matrix D in quadratic function is not positive definite!")
5.
quadprog::solve.QP(D, d, A, bzero)
4.
solve_OLS_internal(S, B)
3.
optimize_solveDampenedWLS(S_k, B[uniq_ct_k_gene, ], constant_J)
2.
spot_deconvolution(expr = filter_expr, cluster_info = cluster, ct_exp = filter_Sig, binary_matrix = binarize_proportion)
1.
Giotto::runDWLSDeconv(gobject = giottoobj_mpoa100um, expression_values = c("normalized"), logbase = 2, cluster_column = "cluster_9", sign_matrix = t(neuronalCellTypes_100um$gtCtGenes), n_cell = 50, cutoff = 2, name = NULL, return_gobject = TRUE)

The command I am running is:


giottoobj <- Giotto::runDWLSDeconv(gobject = giottoobj,
                                    expression_values = c('normalized'), # selects @norm_expr 
                                    logbase = 2,
                                    cluster_column = 'cluster_9', # 'leiden_clus'
                                    sign_matrix = enrich_matrix,
                                    n_cell = 50,
                                    cutoff = 2,
                                    name = NULL,
                                    return_gobject = TRUE)

Here, I'm selecting the log2 transformed and normalized expression matrix (giottoobj@norm_expr), which is 135 genes x 3072 pixels. I previously clustered these pixels into 9 clusters, which are being selected via cluster_column = 'cluster_9' (giottoobj@cell_metadata$cluster_9).

The enrich_matrix is currently a 135 gene (same genes in giottoobj@norm_expr) by 76 cell-type binary (0/1) gene enrichment matrix. I have also used a gene expression matrix for these same 135 genes and 76 cell-types but receive the same error. All cell-types are enriched in at least two of the genes. Most of the genes are specifically enriched in one cell-type.

Do you know what might be going on? I've gone through the Giotto source code but it's pretty dense to keep track of the variables as they are passed to internal functions, and I cannot execute the internal functions themselves to investigate as many are not exported and thus not callable independently.

Thanks in advance

Reproducible Installation from source only?

Hello,

We'd like to try your method. We are running into a few challenges:

  • http://spatialgiotto.rc.fas.harvard.edu/giotto.install.2.html — this talks about a Docker image but we cannot find a Dockerfile to reliably create the image in our system and we were unable to find it on hub.docker.com.

    Is it possible to add this so that we can rebuild the image internally?

  • There's quite a bit of Python code and we're having trouble finding a requirements.txt file to rebuild a virtualenv with the package versions you've been using.

    Is it possible to add these so that a pip install -r requirements.txt works?

    (Of course if you prefer pipenv or poetry that's perfectly fine too)

detectSpatialCorGenes Error

Greetings
Thank you for developing such a useful tool dealing with spatial sequencing data. I recently faced a problem when using the Function "detectSpatialCorGenes" to detect genes that are spatially correlated. I followed all steps shown in vigenttes on http://spatialgiotto.rc.fas.harvard.edu/giotto.visium.brain.html. And using different input(different 10x sample data),some goes on well while some halted with the error “Error in as(x, "matrix")[i = i, j = j, drop = drop],subscript out of bounds ”. I wondered which step makes wrong and got same error after adjusting parameter("network_smoothing") in this function . Is there any details when parsing the giotto object and spatial genes to this function?

HMRF on big dataset

I am trying to run doHMRF on the CODEX spleen dataset available in Giotto.
If I run it on a subset of the dataset (I take some adjacent tiles) it works fine, with acceptable runtimes (e.g. ~20 mins for 25500 cells).

However, if I increase further the number of cells (e.g. 36000), the run stops early, after 1.5 mins, and no output is returned.

The memory required to run the 25500 cells version is not high, so I don't think the execution is going out of memory.

To reproduce the problem, it is sufficient to follow the tutorial on the preprocessing of the codex sample and the tutorial on running doHMRF.

The parameters for doHMRF are the following:
HMRF_spatial_genes = doHMRF(gobject=codex_test, expression_values='scaled', spatial_network_name='Delaunay_network', k=10, betas = c(0,0.5,10), output_folder = paste0(my_working_dir, '/', 'Spatial_genes/SG_k10_scaled'), spatial_genes=codex_test@gene_ID).

I am using R 3.6.0, and Giotto 1.0.4.

Thanks!

Error: 'miniconda_path' is not an exported object from 'namespace:reticulate'

Hi.

I created a Conda env called giotto where I install all the required python package through conda install (note I have anaconda3 instead of miniconda ).

python_path <- "/Users/your_username/anaconda3/envs/giotto/bin/python"
instrs = createGiottoInstructions(show_plot = TRUE,
save_plot = TRUE,
save_dir = results_folder,
python_path = python_path)

I got the error of "Error: 'miniconda_path' is not an exported object from 'namespace:reticulate'"

Then, I tried to use the following code to install the python packages automatically:
python_path = NULL
if(is.null(python_path)) {
installGiottoEnvironment(force_miniconda = TRUE)
}

Got the same error " Error: 'miniconda_path' is not an exported object from 'namespace:reticulate' "

Do you know what's happening?

In order to generate the reference signature matrix is it ok to use AverageExpression from seurat?

Hi,

I have a seurat object which I would like to convert into signature matrix. The data is lognormalized and I am using Seurat's AverageExpression function to generate the signature matrix. I was wondering if this is the correct approach or I should sum the counts for a particular celltype/identity class in the single cell object and then do CPM normalization to generate a better signature matrix for deconvolution?

Best regards!

Spatial correlation without preprocessing

Hello,

I am interested in using Giotto to calculate spatial correlations on a reduced dimension representation (NMF) of my visium spatial transcriptomic data. Is it possible to calculate the spatial correlation without going through the Giotto pipeline?

Thank you,
Melanie

silhouetteRankTest - no such file or directory "km_centroid.txt"

In trying to run the Visium brain tutorial, I run into an issue in Part 10. The function silhouetteRankTest errors out with the message below. In looking through the folders, I cannot locate the txt file, so it seems there is an issue in creating it.

sh: -c: line 0: syntax error near unexpected token )' sh: -c: line 0: cd '/Giotto/silhouetteRank_output//result_5000_0.95_0.100' && Rscript do_kmeans.R gene.freq.good.txt 1 1 1000 km_centroid.txt km_label.txt'
Error in py_call_impl(callable, dots$args, dots$keywords) :
FileNotFoundError: [Errno 2] No such file or directory: "/Giotto/silhouetteRank_output//result_5000_0.95_0.100/km_centroid.txt"

How to create a Giotto object with a pre-computed dimensionality reduction?

Hi,

I'm trying to create a Giotto object with a pre-computed PCA. When I try to pass a list with the PC matrix, i.e. dimension_reduction=list("pca"=as.matrix(PCs)), I receive the following error.

Error in createGiottoObject(raw_exprs = counts(sce), norm_expr = as.matrix(logcounts), : 
  each dimension reduction list must contain all required slots, see details.

Unfortunately, the details of createGiottoObject() do not include any description of the slots required for the dimension reduction list. What is the expected input format for a pre-computed dimensionality reduction?

Thanks,

Matt

Filtered and raw matrices have different counts with createGiottoVisiumObject

Hello,

I tried to import some dataset from a Visium experiment (processed with spaceranger) to R with Giotto function createGiottoVisiumObject, and tried both filter and raw options.
However, after filtering the raw matrix to keep only spots under tissue (following the tutorial https://rubd.github.io/Giotto_site/articles/mouse_visium_brain_201226.html), I saw that both matrices (the one imported with raw option and filtered, and the one imported with filter option) don't contain the same information.
First, they don't have the same number of genes (raw: 260 spots and 19057 genes, filtered: 260 spots and 17847 genes).
Second, I don't have the same values in both matrices for some genes and barcodes. Here is some example:
raw:
CAATTAAGGGTGATGA-1 CAATTTCGTATAAGGG-1 CACAATGAGCTGCTAT-1 CACACGCGCTGTCTTA-1 CACAGCACCCACGGCA-1
Mrpl15 . . . . .
Pcmtd1 . . . . .
Gm26901 . . . . .
Snhg6 . . . . .
Cops5 . . . . .

filtered:
CAATTAAGGGTGATGA-1 CAATTTCGTATAAGGG-1 CACAATGAGCTGCTAT-1 CACACGCGCTGTCTTA-1 CACAGCACCCACGGCA-1
Mrpl15 . 2 . 2 2
Pcmtd1 2 . 2 4 1
Gm26901 . . . . .
Snhg6 4 4 2 2 .
Cops5 6 2 3 2 3​

I tried to manually import the dataset from the files and I don't have this mismatch. I also have 32285 genes in both matrices.

Do you know where this is coming from?

Best regards,

Perrine Lacour

Is it possible to use createGiottoObject with scRNAseq data?

Since I can't use my seurat objects averaged cell type matrix directly (for deconvolution) since I keep getting the quadprog solve error

Error in quadprog::solve.QP(D/sc, d/sc, A, bzero) :
  NA/NaN/Inf in foreign function call (arg 1)

I thought I should convert the seurat object into anndata object then I will import the scrnaseq data into giotto but after unsuccessfully struggling to use anndataToGiotto I tried to follow the tutorials here

https://github.com/bernard2012/spatial_dataset_tutorial/blob/dae24d5c676712d40042941d928425c7fe38f900/slideseq.part1/README.md

sc <- reticulate::import("scanpy") pd <- reticulate::import("pandas") adata <- sc$read(anndata_path) exprs <- t(adata$layers[['counts']]) colnames(exprs) <- adata$obs_names$to_list() rownames(exprs) <- adata$var_names$to_list() my_cell_metadata <- as.data.frame(adata$obs) workdir = "B185/giotto" myinst=createGiottoInstructions(save_plot=T, show_plot=F, save_dir=workdir) B185_giotto_scrnaseq <- createGiottoObject(raw_exprs = as.matrix(exprs), instructions=myinst,cell_metadata=my_cell_metadata)

But now I am stuck at this error :

 Giotto does not automatically install all these packages as they are not absolutely required and this reduces the number of dependencies
List of 1
 $ raw: num [1:19969, 1:24409] 0 0 0 0 0 0 0 0 0 0 ...
  ..- attr(*, "dimnames")=List of 2
  .. ..$ : chr [1:19969] "AL627309.5" "AP006222.2" "LINC01409" "FAM87B" ...
  .. ..$ : chr [1:24409] "B185_1_B185_1_count_cellranger5_AAACCTGAGAAGGACA-1" "B185_1_B185_1_count_cellranger5_AAACCTGAGACAAGCC-1" "B185_1_B185_1_count_cellranger5_AAACCTGCAAGCGTAG-1" "B185_1_B185_1_count_cellranger5_AAACCTGCATGTCGAT-1" ...
NULL
Depth of provided expression list is 1, working with one type of molecular feature

Error in extract_spatial_locations_list(gobject, spat_loc_list = spatial_locs,  :

 the raw / real / physical coordinates must be provided with name 'raw'
In addition: Warning message:
In createGiottoObject(raw_exprs = as.matrix(exprs), spatial_locs = 0,  :
  raw_exprs argument is deprecated, use expression argument in the future

I was wondering if there is anyway possible to create a single cell RNAseq giotto object without giving spatial_locs variable? Or should I give it a dummy dataframe for the same?

Thanks!

while running HMRF in the docker image: Permission denied: '/tmp/edges.txt'

I downloaded the docker image and when running the doHMRF function, I get the following error:

Traceback (most recent call last):
File "/usr/local/lib/R/site-library/Giotto/python/reader.py", line 194, in
fw = open(edge_file, "w")
PermissionError: [Errno 13] Permission denied: '/tmp/edges.txt'

When I look at the permissions of the offending file, I find that it belongs to root, and but there are read rights (but I guess no execute rights..) available to all groups:

dean@xxxxxxxxxx:/tmp$ ls -la
total 228
drwxrwxrwt 1 root root 4096 Jul 15 09:10 .
drwxr-xr-x 1 root root 4096 Jul 15 01:22 ..
drwx------ 4 dean dean 4096 Apr 17 22:28 RtmpEFoBv3
drwx------ 2 dean dean 4096 Feb 1 11:09 RtmpHgq2P0
drwx------ 2 dean dean 4096 Jul 15 09:37 RtmpRemm4l
drwx------ 2 dean dean 4096 Feb 1 11:13 Rtmpo1QRXC
drwx------ 2 dean dean 4096 Feb 1 11:05 RtmppUE0AF
-rw-r--r-- 1 root root 79385 Jun 27 2019 adjacent.txt
-rw-r--r-- 1 root root 10072 Jun 27 2019 blocks.txt
-rw-r--r-- 1 root root 33336 Jun 27 2019 edges.txt

So how should I try to fix the issue here? If I try to sudo chmod it, it asks for dean's password. I don't have this password (I tied "dean"; does not work)

Thanks!
Vipul

with R 4.0 mini_visium_test example can throw an error

...
start with cluster 5
Error in rbindlist(l, use.names, fill, idcol) :
Column 5 ['logFC.1_3_4_5'] of item 2 is missing in item 1. Use fill=TRUE to fill with NA (NULL for list columns), or use.names=FALSE to ignore column names.

problem with Giotto python environment

Hello,
I am having an issue getting the Giotto (v1.0.4) python environment working while running on a linux environment. I have tried using both installGiottoEnvironment() and creating the conda environment myself. In the two examples below, I get the message that python packages are missing, even though they have been installed in the appropriate conda environments. Notably, I do not get this missing package issue when running on my local Mac OSX machine. Any help would be appreciated. Thank you! -Orr

  1. Letting Giotto create the environment.
library(Giotto)
library(data.table)
library(Matrix)
installGiottoEnvironment()
bead_positions <- fread(file="/broad/regevtmp/orr/slideseq/BeadLocationsForR.csv")
expr_matrix<-fread(file="/broad/regevtmp/orr/slideseq/MappedDGEForR.csv")
expr_mat <- as.matrix(expr_matrix[,-1]);rownames(expr_mat) = expr_matrix$Row
Slide_test <- createGiottoObject(raw_exprs = expr_mat, spatial_locs = bead_positions[,.(xcoord, ycoord)])

## Package Plan ##

  environment location: /home/unix/orr/.local/share/r-miniconda/envs/giotto_env

  added / updated specs:
    - leidenalg
    - networkx
    - pandas
    - python-igraph
    - python-louvain
    - python=3.6
    - scikit-learn


The following NEW packages will be INSTALLED:

  arpack             conda-forge/linux-64::arpack-3.7.0-hdefa2d7_2
  cycler             conda-forge/noarch::cycler-0.10.0-py_2
  decorator          conda-forge/noarch::decorator-4.4.2-py_0
  freetype           conda-forge/linux-64::freetype-2.10.4-h0708190_1
  glpk               conda-forge/linux-64::glpk-4.65-h9202a9a_1004
  gmp                conda-forge/linux-64::gmp-6.2.1-h58526e2_0
  icu                conda-forge/linux-64::icu-68.1-h58526e2_0
  igraph             conda-forge/linux-64::igraph-0.9.4-ha184e22_0
  jbig               conda-forge/linux-64::jbig-2.1-h7f98852_2003
  joblib             conda-forge/noarch::joblib-1.0.1-pyhd8ed1ab_0
  jpeg               conda-forge/linux-64::jpeg-9d-h36c2ea0_0
  kiwisolver         pkgs/main/linux-64::kiwisolver-1.3.1-py36h2531618_0
  lcms2              conda-forge/linux-64::lcms2-2.12-hddcbb42_0
  leidenalg          conda-forge/linux-64::leidenalg-0.8.7-py36hc4f0c31_0
  lerc               conda-forge/linux-64::lerc-2.2.1-h9c3ff4c_0
  libblas            conda-forge/linux-64::libblas-3.9.0-11_linux64_openblas
  libcblas           conda-forge/linux-64::libcblas-3.9.0-11_linux64_openblas
  libdeflate         conda-forge/linux-64::libdeflate-1.7-h7f98852_5
  libgfortran-ng     conda-forge/linux-64::libgfortran-ng-11.2.0-h69a702a_9
  libgfortran5       conda-forge/linux-64::libgfortran5-11.2.0-h5c6108e_9
  libiconv           conda-forge/linux-64::libiconv-1.16-h516909a_0
  liblapack          conda-forge/linux-64::liblapack-3.9.0-11_linux64_openblas
  libopenblas        conda-forge/linux-64::libopenblas-0.3.17-pthreads_h8fe5266_1
  libpng             conda-forge/linux-64::libpng-1.6.37-h21135ba_2
  libtiff            conda-forge/linux-64::libtiff-4.3.0-hf544144_1
  libwebp-base       conda-forge/linux-64::libwebp-base-1.2.1-h7f98852_0
  libxml2            conda-forge/linux-64::libxml2-2.9.12-h72842e0_0
  lz4-c              conda-forge/linux-64::lz4-c-1.9.3-h9c3ff4c_1
  matplotlib-base    conda-forge/linux-64::matplotlib-base-3.3.4-py36hd391965_0
  metis              conda-forge/linux-64::metis-5.1.0-h58526e2_1006
  mpfr               conda-forge/linux-64::mpfr-4.1.0-h9202a9a_1
  networkx           conda-forge/noarch::networkx-2.6.3-pyhd8ed1ab_0
  numpy              conda-forge/linux-64::numpy-1.19.5-py36hfc0c790_2
  olefile            conda-forge/noarch::olefile-0.46-pyh9f0ad1d_1
  openjpeg           conda-forge/linux-64::openjpeg-2.4.0-hb52868f_1
  pandas             conda-forge/linux-64::pandas-1.1.5-py36h284efc9_0
  pillow             conda-forge/linux-64::pillow-8.3.2-py36h676a545_0
  pyparsing          conda-forge/noarch::pyparsing-2.4.7-pyh9f0ad1d_0
  python-dateutil    conda-forge/noarch::python-dateutil-2.8.2-pyhd8ed1ab_0
  python-igraph      conda-forge/linux-64::python-igraph-0.9.6-py36h644ed5e_0
  python-louvain     conda-forge/noarch::python-louvain-0.15-pyhd3deb0d_0
  python_abi         conda-forge/linux-64::python_abi-3.6-2_cp36m
  pytz               conda-forge/noarch::pytz-2021.3-pyhd8ed1ab_0
  scikit-learn       conda-forge/linux-64::scikit-learn-0.24.2-py36hc89565f_1
  scipy              conda-forge/linux-64::scipy-1.5.3-py36h81d768a_1
  six                conda-forge/noarch::six-1.16.0-pyh6c4a22f_0
  suitesparse        conda-forge/linux-64::suitesparse-5.10.1-h9e50725_1
  tbb                conda-forge/linux-64::tbb-2021.3.0-h4bd325d_0
  texttable          conda-forge/noarch::texttable-1.6.4-pyhd8ed1ab_0
  threadpoolctl      conda-forge/noarch::threadpoolctl-3.0.0-pyh8a188c0_0
  tornado            conda-forge/linux-64::tornado-6.1-py36h8f6f2f9_1
  zstd               conda-forge/linux-64::zstd-1.5.0-ha95c52a_0

Consider to install these (optional) packages to run all possible Giotto commands for spatial analyses:  scran MAST smfishHmrf trendsceek SPARK multinet FactoMiner
 Giotto does not automatically install all these packages as they are not absolutely required and this reduces the number of dependencies
 no external python path was provided, but a giotto python environment was found and will be used 
Warning messages:
1: In createGiottoObject(raw_exprs = expr_mat, spatial_locs = bead_positions[,  :
  module: pandas was not found with python path: /home/unix/orr/.local/share/r-miniconda/envs/giotto_env/bin/python

2: In createGiottoObject(raw_exprs = expr_mat, spatial_locs = bead_positions[,  :
  module: igraph was not found with python path: /home/unix/orr/.local/share/r-miniconda/envs/giotto_env/bin/python

3: In createGiottoObject(raw_exprs = expr_mat, spatial_locs = bead_positions[,  :
  module: leidenalg was not found with python path: /home/unix/orr/.local/share/r-miniconda/envs/giotto_env/bin/python

4: In createGiottoObject(raw_exprs = expr_mat, spatial_locs = bead_positions[,  :
  module: sklearn was not found with python path: /home/unix/orr/.local/share/r-miniconda/envs/giotto_env/bin/python

R session.

> sessionInfo()
R version 4.0.0 (2020-04-24)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Red Hat Enterprise Linux

Matrix products: default
BLAS:   /usr/lib64/libblas.so.3.4.2
LAPACK: /broad/software/free/Linux/redhat_7_x86_64/pkgs/r_4.0.0/lib64/R/lib/libRlapack.so

locale:
[1] C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] Matrix_1.3-2      data.table_1.14.2 Giotto_1.0.4     

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.7       pillar_1.6.3     compiler_4.0.0   tools_4.0.0     
 [5] jsonlite_1.7.2   lifecycle_1.0.1  tibble_3.1.5     gtable_0.3.0    
 [9] lattice_0.20-41  pkgconfig_2.0.3  png_0.1-7        rlang_0.4.11    
[13] DBI_1.1.1        parallel_4.0.0   dplyr_1.0.7      generics_0.1.0  
[17] vctrs_0.3.8      rappdirs_0.3.3   rprojroot_2.0.2  grid_4.0.0      
[21] tidyselect_1.1.1 reticulate_1.22  glue_1.4.2       here_1.0.1      
[25] R6_2.5.1         fansi_0.5.0      ggplot2_3.3.5    purrr_0.3.4     
[29] blob_1.2.1       magrittr_2.0.1   scales_1.1.1     ellipsis_0.3.2  
[33] assertthat_0.2.1 colorspace_2.0-2 utf8_1.2.2       munsell_0.5.0   
[37] crayon_1.4.1    
  1. Using the conda environment I created.
library(Giotto)
library(data.table)
library(Matrix)
python_path <- "/ahg/regevdata/users/orr/code/miniconda3/envs/giotto_env/bin/python"
bead_positions <- fread(file="/broad/regevtmp/orr/slideseq/BeadLocationsForR.csv")
expr_matrix<-fread(file="/broad/regevtmp/orr/slideseq/MappedDGEForR.csv")
expr_mat <- as.matrix(expr_matrix[,-1]);rownames(expr_mat) = expr_matrix$Row
my_instructions <- createGiottoInstructions(python_path = python_path)
Slide_test <- createGiottoObject(raw_exprs = expr_mat, spatial_locs = bead_positions[,.(xcoord, ycoord)], instructions = my_instructions)
showGiottoInstructions(Slide_test)

Consider to install these (optional) packages to run all possible Giotto commands for spatial analyses:  scran MAST smfishHmrf trendsceek SPARK multinet FactoMiner
 Giotto does not automatically install all these packages as they are not absolutely required and this reduces the number of dependenciesWarning messages:
1: In createGiottoObject(raw_exprs = expr_mat, spatial_locs = bead_positions[,  :
  module: pandas was not found with python path: /ahg/regevdata/users/orr/code/miniconda3/envs/giotto_env/bin/python

2: In createGiottoObject(raw_exprs = expr_mat, spatial_locs = bead_positions[,  :
  module: igraph was not found with python path: /ahg/regevdata/users/orr/code/miniconda3/envs/giotto_env/bin/python

3: In createGiottoObject(raw_exprs = expr_mat, spatial_locs = bead_positions[,  :
  module: leidenalg was not found with python path: /ahg/regevdata/users/orr/code/miniconda3/envs/giotto_env/bin/python

$python_path
[1] "/ahg/regevdata/users/orr/code/miniconda3/envs/giotto_env/bin/python"

These three missing packages are all the in the giotto_env conda environment I had created.

(giotto_env) <1019|0>orr@login03 ~$ conda list
# packages in environment at /ahg/regevdata/users/orr/code/miniconda3/envs/giotto_env:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                        main  
_openmp_mutex             4.5                       1_gnu  
arpack                    3.7.0                hdefa2d7_2    conda-forge
blas                      1.0                         mkl  
bottleneck                1.3.2            py39hdd57654_1  
ca-certificates           2021.5.30            ha878542_0    conda-forge
certifi                   2021.5.30        py39hf3d152e_0    conda-forge
decorator                 4.4.2                      py_0    anaconda
glpk                      4.65              h9202a9a_1004    conda-forge
gmp                       6.2.1                h58526e2_0    conda-forge
icu                       68.1                 h58526e2_0    conda-forge
igraph                    0.9.4                ha184e22_0    conda-forge
intel-openmp              2021.3.0          h06a4308_3350  
joblib                    1.0.1                    pypi_0    pypi
ld_impl_linux-64          2.35.1               h7274673_9  
leidenalg                 0.8.7            py39he80948d_0    conda-forge
libblas                   3.9.0            11_linux64_mkl    conda-forge
libcblas                  3.9.0            11_linux64_mkl    conda-forge
libffi                    3.3                  he6710b0_2  
libgcc-ng                 9.3.0               h5101ec6_17  
libgfortran-ng            11.2.0               h69a702a_9    conda-forge
libgfortran5              11.2.0               h5c6108e_9    conda-forge
libgomp                   9.3.0               h5101ec6_17  
libiconv                  1.16                 h516909a_0    conda-forge
liblapack                 3.9.0            11_linux64_mkl    conda-forge
libstdcxx-ng              9.3.0               hd4cf53a_17  
libxml2                   2.9.12               h72842e0_0    conda-forge
metis                     5.1.0             h58526e2_1006    conda-forge
mkl                       2021.3.0           h06a4308_520  
mkl-service               2.4.0            py39h7f8727e_0  
mkl_fft                   1.3.0            py39h42c9631_2  
mkl_random                1.2.2            py39h51133e4_0  
mpfr                      4.1.0                h9202a9a_1    conda-forge
ncurses                   6.2                  he6710b0_1  
networkx                  2.5                        py_0    anaconda
numexpr                   2.7.3            py39h22e1b3c_1  
numpy                     1.20.3           py39hf144106_0  
numpy-base                1.20.3           py39h74d4b33_0  
openssl                   1.1.1l               h7f8727e_0  
pandas                    1.3.3            py39h8c16a72_0  
pip                       21.2.4           py37h06a4308_0  
python                    3.9.7                h12debd9_1  
python-dateutil           2.8.2              pyhd3eb1b0_0  
python-igraph             0.9.6            py39hfef886c_0    conda-forge
python-louvain            0.15               pyhd3deb0d_0    conda-forge
python_abi                3.9                      2_cp39    conda-forge
pytz                      2021.1             pyhd3eb1b0_0  
readline                  8.1                  h27cfd23_0  
scikit-learn              1.0                      pypi_0    pypi
scipy                     1.7.1                    pypi_0    pypi
setuptools                58.0.4           py39h06a4308_0  
six                       1.16.0             pyhd3eb1b0_0  
sqlite                    3.36.0               hc218d9a_0  
suitesparse               5.10.1               hd8046ac_0    conda-forge
tbb                       2020.2               h4bd325d_4    conda-forge
texttable                 1.6.4              pyhd8ed1ab_0    conda-forge
threadpoolctl             3.0.0                    pypi_0    pypi
tk                        8.6.11               h1ccaba5_0  
tzdata                    2021a                h5d7bf9c_0  
wheel                     0.37.0             pyhd3eb1b0_1  
xz                        5.2.5                h7b6447c_0  
zlib                      1.2.11               h7b6447c_3  

error running mini_seqfish_v0.3.5_200529.R

runs well up to

+                             expression_values = 'scaled',
+                             spatial_ge .... [TRUNCATED] 
Error in file(file, ifelse(append, "a", "w")) : 
  cannot open the connection
In addition: Warning messages:
1: In runPCA_prcomp_irlba(x = t_giotto(expr_values), center = center,  :
  ncp >= minimum dimension of x, will be set to minimum dimension of x - 1
2: Ignoring unknown parameters: binwidth, bins, pad 
3: In dir.create(hmrf_folder, recursive = T) :
  cannot create dir '/Volumes/Ruben_Seagate', reason 'Permission denied'
4: In dir.create(path = output_folder, recursive = T) :
  cannot create dir '/Volumes/Ruben_Seagate', reason 'Permission denied'
5: In file(file, ifelse(append, "a", "w")) :
  cannot open file '/Volumes/Ruben_Seagate/Dropbox/Projects/GC_lab/Ruben_Dries/190225_spatial_package/Results/Temp/11_HMRF//Spatial_genes/SG_top100_k9_scaled/expression_matrix.txt': No such file or directory```

```> sessionInfo()
R version 4.0.1 beta (2020-05-28 r78607)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Mojave 10.14.6

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRblas.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] Giotto_0.3.6  rmarkdown_2.2

loaded via a namespace (and not attached):
 [1] ggdendro_0.1-20      jackstraw_1.3        jsonlite_1.6.1      
 [4] splines_4.0.1        gtools_3.8.2         stats4_4.0.1        
 [7] ggrepel_0.8.2        pillar_1.4.4         lattice_0.20-41     
[10] glue_1.4.1           limma_3.45.7         reticulate_1.16     
[13] digest_0.6.25        RColorBrewer_1.1-2   polyclip_1.10-0     
[16] qvalue_2.21.0        colorspace_1.4-1     cowplot_1.0.0       
[19] htmltools_0.4.0      Matrix_1.2-18        plyr_1.8.6          
[22] pkgconfig_2.0.3      GetoptLong_1.0.0     purrr_0.3.4         
[25] corpcor_1.6.9        scales_1.1.1         tweenr_1.0.1        
[28] ClusterR_1.2.2       RSpectra_0.16-0      Rtsne_0.15          
[31] ggforce_0.3.1        tibble_3.0.1         gmp_0.6-0           
[34] IRanges_2.23.10      generics_0.0.2       dbscan_1.1-5        
[37] farver_2.0.3         ggplot2_3.3.1        ellipsis_0.3.1      
[40] BiocGenerics_0.35.4  magrittr_1.5         crayon_1.3.4        
[43] deldir_0.1-25        evaluate_0.14        MASS_7.3-51.6       
[46] FNN_1.1.3            tools_4.0.1          data.table_1.12.8   
[49] GlobalOptions_0.1.2  lifecycle_0.2.0      matrixStats_0.56.0  
[52] ComplexHeatmap_2.5.3 stringr_1.4.0        S4Vectors_0.27.12   
[55] lfa_1.19.0           munsell_0.5.0        cluster_2.1.0       
[58] irlba_2.3.3          compiler_4.0.1       rsvd_1.0.3          
[61] rlang_0.4.6          grid_4.0.1           circlize_0.4.10     
[64] rjson_0.2.20         igraph_1.2.5         startup_0.14.1      
[67] labeling_0.3         gtable_0.3.0         codetools_0.2-16    
[70] reshape2_1.4.4       R6_2.4.1             knitr_1.28          
[73] dplyr_1.0.0          uwot_0.1.8           clue_0.3-57         
[76] shape_1.4.4          stringi_1.4.6        parallel_4.0.1      
[79] Rcpp_1.0.4.6         vctrs_0.3.1          png_0.1-7           
[82] tidyselect_1.1.0     xfun_0.14           

Is there a better way to align cellranger images to giotto using updateGiottoImage?

Hi I am trying to use giotto on cellranger output and the first step in using giotto on cellranger is aligning the cellranger images in giotto using a combination of updateGiottoImage and spatPlot in iteration. I was wondering if there is an automated solution to this than to painstakingly keep changing the coordinates in the code below until we get the best overlap?

B186_1 <- updateGiottoImage(B186_1, image_name = 'image', ymin_adj = 1500, ymax_adj = 2000, xmax_adj = 2550, xmin_adj = 2000)

spatPlot(gobject = B186_1, cell_color = 'in_tissue', show_image = T, point_alpha = 0.7, save_param = list(save_name = 'spatplot_image4'))

Giotto & Scanpy / Python

I am trying to load an Anndata containing my spatial dataset. I usually do this in R using reticulate.

library(Giotto)
instrs = createGiottoInstructions(python_path = "anaconda3/envs/myenv")
library(tidyverse)
library(reticulate)
library(Matrix)
sc <- import("scanpy")
pd <- import("pandas")

However, both python import lines fail in this example on my machine. I see that it comes from the fact that Giotto uses also reticulate and it seems to create conflicts. I looked into your codebase and I tried removing the import and adding reticulate:: as a suffix, without success.

Any idea on how I could do that? It would be extremely handy.

Error in function plotPCA()

Hi,

Whenever I try plotPCA,
data(mini_giotto_single_cell)
plotPCA(mini_giotto_single_cell)
it turns:
plotPCA(mini_giotto_single_cell)
Error in (function (classes, fdef, mtable) :
unable to find an inherited method for function ‘plotPCA’ for signature ‘"giotto"’
For more context, I am running R version 4.1.0 and Giotto version 1.0.4.

Thank you!

doLeidenSubCluster

It's a minor issue.
I am getting an error when running this function doLeidenSubCluster
Error in calculateHVG(gobject = new("giotto", raw_exprs = new("dgCMatrix", :
unused argument (difference_in_variance = 1)

seems like an easy fix.

Also, the usage example here:
https://rdrr.io/github/RubD/Giotto/man/doLeidenSubCluster.html
doLeidenSubCluster(gobject)
Doesn't work since it requires cluster_column to be specified.

Maybe need to update code for checking data class?

Hi,

Thank you for your nice package!

I got the following error:

Warning message:
In if (class(inputmatrix) %in% c("data.frame", "matrix"))

In current version R 4.0.3, instead of matrix, the class of matrix is

> class(Dat_cast1$Data)
[1] "matrix" "array" 

Hence the relevant code need to be udpated.

Error in system("which python", intern = T) : 'which' not found

create

VC_test <- createGiottoObject(raw_exprs = VC_exprs, spatial_locs = stitch_file, offset_file = my_offset_file)
Error in system("which python", intern = T) : 'which' not found

what is the matter? I run this code a couple of days ago, still work.

error in spatialDWLS

Hi GC,

I'm getting an error when I run spatialDWLS. My call is

                    expression_values = c("normalized"),
                    logbase = 2,
                    cluster_column = "cluster",
                    sign_matrix = SpatialDecon::safeTME[usegenes, ],
                    n_cell = 100,
                    cutoff = 2,
                    name = NULL,
                    return_gobject = TRUE)

And the error is:

Error in rowMeans(2^expr_values - 1, dims = 1) : 
  'x' must be an array of at least two dimensions

Do you have any advice on resolving this? I can email the giotto object I'm using if it helps debug.

Thanks,
Patrick

PCA reduction="genes"

Hello, when i try the snippet below, i get "Error in dimnames(x) <- dn : length of 'dimnames' [1] not equal to array extent". I'm quite confident I'm not doing something wrong..

//bash code
wget https://cf.10xgenomics.com/samples/spatial-exp/1.1.0/V1_Mouse_Kidney/V1_Mouse_Kidney_spatial.tar.gz
wget https://cf.10xgenomics.com/samples/spatial-exp/1.1.0/V1_Mouse_Kidney/V1_Mouse_Kidney_filtered_feature_bc_matrix.h5
tar -xzf V1_Mouse_Kidney_spatial.tar.gz
mkdir filtered_feature_bc_matrix && cp -r spatial filtered_feature_bc_matrix
cp V1_Mouse_Kidney_filtered_feature_bc_matrix.h5 filtered_feature_bc_matrix
cd filtered_feature_bc_matrix && R

//R code
library(Giotto)
pcaDimensions=10

my_giotto_object = createGiottoVisiumObject(visium_dir="./",
expr_data="filter",
h5_visium_path="filtered_feature_bc_matrix.h5",h5_tissue_positions_path="./spatial/tissue_positions_list.csv")
my_giotto_object <- normalizeGiotto(gobject = my_giotto_object)
my_giotto_object <- runPCA(gobject = my_giotto_object,ncp=pcaDimensions,reduction="genes")

error appears when performing doLeidenCluster

Dear friends;
When I performed the doLeidenCluster, it showed some errors, as follows, mini_visium <- doLeidenCluster(gobject = mini_visium, resolution = 0.4, n_iterations = 1000)
Error in bmerge(i, x, leftcols, rightcols, roll, rollends, nomatch, mult, :
x.cell_ID is type environment which is not supported by data.table join
Do you know how to solve this problem? Sorry, I have tried lots of ways to deal with it, but at the moment, I still have no ideas. I will appreciate you if you can give me some suggestions.
Best,
Lee

tutorial question about osmFISH Dataset

Hello ,
I run this tutorial http://spatialgiotto.rc.fas.harvard.edu/giotto.osmFISH.html
and sometthing wrong in this line osm_locs = osm_locs[rownames(osm_locs) %in% colnames(osm_exprs),]
it makes the osm-locs became 0 obs
and the next command osm_test <- normalizeGiotto(gobject = osm_test)
can not find the object osm_test
is this tutorial code wrong ?
wait for reply
thanks
best regards
cqy

Running time issue with runSpatialDeconv

Hello, I'm trying to reveal reference cell type's spatial pattern on Visium samples following giotto's procedure like below.

[WIth 7 Visium samples]
createGiottoVisiumObject -> normalizeGiotto -> calculateHVG -> runPCA -> createNearestNetwork -> doLeidenCluster

[For reference data]
reference_data_markers <- readRDS("reference_data_markers.rds") # Result of FindAllMarkers with MAST (From Seurat)
reference_data_marker_lists <- list()
for(i in 1:length(levels(factor(reference_data_markers$cluster)))){
reference_data_marker_lists[[i]] <- (reference_data_markers %>% filter(p_val_adj < 10^(-20) & cluster == levels(factor(reference_data_markers$cluster))[i]) %>% select(gene))$gene
}
signature_matrix <- makeSignMatrixPAGE(sign_names = levels(factor(reference_data$Major_compartment)),
sign_list = reference_data_marker_lists)

my_giotto_object <- list()
for(i in 1:7) {
my_giotto_object[[i]] <- runSpatialDeconv(gobject = giotto[[i]], sign_matrix = signature_matrix)
}

The code running right above won't stop even after 2 days and also tried with just one sample but giving no output as well. I even tried functions like runDWLSDeconv, runPAGEEnrich, runRankEnrich but the running code never ends.

So I wonder what could be the reason of this since I was able to execute other deconvolution tools like SPOTlight, RCTD ...... on AWS Rstudio server. Sorry for the naive question.

Thank you!

spatialDE is broken in Giotto_0.3.6

Hi,

There seem to be two issues:
Running with defaults:
>spatialDE(gobject = g)
Error in t.default(expr_values) : argument is not a matrix

Running with normalized expression counts does work at first, but at the end:
spatialDE(gobject = g,expression_values="normalized")
Models: 0%| | 0/10 [00:00<?, ?it/s]
...
Models: 100%|##########| 11/11 [00:00<00:00, 122.91it/s]Error in FSV_show(results = results, ms_results = ms_results, size = size, : could not find function "FSV_show"

Works with Giotto_0.1.4

sessionInfo()
R version 3.6.0 (2019-04-26)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.2 LTS

Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1

locale:
[1] C

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] dplyr_1.0.0 data.table_1.12.8 Giotto_0.3.6

loaded via a namespace (and not attached):
[1] Rcpp_1.0.4.6 pillar_1.4.4 compiler_3.6.0 tools_3.6.0 digest_0.6.25 jsonlite_1.7.0 lifecycle_0.2.0
[8] tibble_3.0.1 gtable_0.3.0 lattice_0.20-38 pkgconfig_2.0.3 rlang_0.4.6 Matrix_1.2-17 rstudioapi_0.11
[15] parallel_3.6.0 generics_0.0.2 vctrs_0.3.1 grid_3.6.0 tidyselect_1.1.0 reticulate_1.16 glue_1.4.1
[22] R6_2.4.1 polyclip_1.10-0 ggplot2_3.3.2 purrr_0.3.4 tidyr_1.1.0 farver_2.0.3 tweenr_1.0.1
[29] deldir_0.1-25 magrittr_1.5 matrixStats_0.56.0 scales_1.1.1 ellipsis_0.3.1 MASS_7.3-51.1 ggforce_0.3.2
[36] colorspace_1.4-1 labeling_0.3 stringi_1.4.6 munsell_0.5.0 crayon_1.3.4

Best,
Sascha

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.