From 678c0e4dd1e02353366cbb3c065bf6e839833c14 Mon Sep 17 00:00:00 2001 From: xiyupeng Date: Thu, 17 Oct 2024 15:59:22 -0500 Subject: [PATCH] add citation in tutorial --- docs/articles/SpaTopic.html | 2 +- docs/index.html | 2 +- docs/pkgdown.yml | 2 +- docs/search.json | 2 +- src/Makevars | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/articles/SpaTopic.html b/docs/articles/SpaTopic.html index 9849d1e..3db83d8 100644 --- a/docs/articles/SpaTopic.html +++ b/docs/articles/SpaTopic.html @@ -190,7 +190,7 @@

Gibbs Sampling#> Output model perplexity: #> 11.3156329380619 #> user system elapsed -#> 64.992 0.374 65.689 +#> 54.056 0.074 54.179

Topic Content and Distribution diff --git a/docs/index.html b/docs/index.html index e6155b8..71d0010 100644 --- a/docs/index.html +++ b/docs/index.html @@ -162,7 +162,7 @@

Output

Citation

-

Coming soon……

+

Xiyu Peng, James W. Smithy, Mohammad Yosofvand, Caroline E. Kostrzewa, MaryLena Bleile, Fiona D. Ehrich, Jasme Lee, Michael A. Postow, Margaret K. Callahan, Katherine S. Panageas, Ronglai Shen. Decoding Spatial Tissue Architecture: A Scalable Bayesian Topic Model for Multiplexed Imaging Analysis. bioRxiv. doi: https://doi.org/10.1101/2024.10.08.617293

Contact diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index 3cf4ad0..0731820 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -5,5 +5,5 @@ articles: Intro_SpaTopic: Intro_SpaTopic.html Model_Selection: Model_Selection.html SpaTopic: SpaTopic.html -last_built: 2024-09-12T18:19Z +last_built: 2024-10-17T20:54Z diff --git a/docs/search.json b/docs/search.json index b533c13..ccbd1c5 100644 --- a/docs/search.json +++ b/docs/search.json @@ -1 +1 @@ -[{"path":"/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"GNU General Public License","title":"GNU General Public License","text":"Version 3, 29 June 2007Copyright © 2007 Free Software Foundation, Inc.  Everyone permitted copy distribute verbatim copies license document, changing allowed.","code":""},{"path":"/LICENSE.html","id":"preamble","dir":"","previous_headings":"","what":"Preamble","title":"GNU General Public License","text":"GNU General Public License free, copyleft license software kinds works. licenses software practical works designed take away freedom share change works. contrast, GNU General Public License intended guarantee freedom share change versions program–make sure remains free software users. , Free Software Foundation, use GNU General Public License software; applies also work released way authors. can apply programs, . speak free software, referring freedom, price. General Public Licenses designed make sure freedom distribute copies free software (charge wish), receive source code can get want , can change software use pieces new free programs, know can things. protect rights, need prevent others denying rights asking surrender rights. Therefore, certain responsibilities distribute copies software, modify : responsibilities respect freedom others. example, distribute copies program, whether gratis fee, must pass recipients freedoms received. must make sure , , receive can get source code. must show terms know rights. Developers use GNU GPL protect rights two steps: (1) assert copyright software, (2) offer License giving legal permission copy, distribute /modify . developers’ authors’ protection, GPL clearly explains warranty free software. users’ authors’ sake, GPL requires modified versions marked changed, problems attributed erroneously authors previous versions. devices designed deny users access install run modified versions software inside , although manufacturer can . fundamentally incompatible aim protecting users’ freedom change software. systematic pattern abuse occurs area products individuals use, precisely unacceptable. Therefore, designed version GPL prohibit practice products. problems arise substantially domains, stand ready extend provision domains future versions GPL, needed protect freedom users. Finally, every program threatened constantly software patents. States allow patents restrict development use software general-purpose computers, , wish avoid special danger patents applied free program make effectively proprietary. prevent , GPL assures patents used render program non-free. precise terms conditions copying, distribution modification follow.","code":""},{"path":[]},{"path":"/LICENSE.html","id":"id_0-definitions","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"0. Definitions","title":"GNU General Public License","text":"“License” refers version 3 GNU General Public License. “Copyright” also means copyright-like laws apply kinds works, semiconductor masks. “Program” refers copyrightable work licensed License. licensee addressed “”. “Licensees” “recipients” may individuals organizations. “modify” work means copy adapt part work fashion requiring copyright permission, making exact copy. resulting work called “modified version” earlier work work “based ” earlier work. “covered work” means either unmodified Program work based Program. “propagate” work means anything , without permission, make directly secondarily liable infringement applicable copyright law, except executing computer modifying private copy. Propagation includes copying, distribution (without modification), making available public, countries activities well. “convey” work means kind propagation enables parties make receive copies. Mere interaction user computer network, transfer copy, conveying. interactive user interface displays “Appropriate Legal Notices” extent includes convenient prominently visible feature (1) displays appropriate copyright notice, (2) tells user warranty work (except extent warranties provided), licensees may convey work License, view copy License. interface presents list user commands options, menu, prominent item list meets criterion.","code":""},{"path":"/LICENSE.html","id":"id_1-source-code","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"1. Source Code","title":"GNU General Public License","text":"“source code” work means preferred form work making modifications . “Object code” means non-source form work. “Standard Interface” means interface either official standard defined recognized standards body, , case interfaces specified particular programming language, one widely used among developers working language. “System Libraries” executable work include anything, work whole, () included normal form packaging Major Component, part Major Component, (b) serves enable use work Major Component, implement Standard Interface implementation available public source code form. “Major Component”, context, means major essential component (kernel, window system, ) specific operating system () executable work runs, compiler used produce work, object code interpreter used run . “Corresponding Source” work object code form means source code needed generate, install, (executable work) run object code modify work, including scripts control activities. However, include work’s System Libraries, general-purpose tools generally available free programs used unmodified performing activities part work. example, Corresponding Source includes interface definition files associated source files work, source code shared libraries dynamically linked subprograms work specifically designed require, intimate data communication control flow subprograms parts work. Corresponding Source need include anything users can regenerate automatically parts Corresponding Source. Corresponding Source work source code form work.","code":""},{"path":"/LICENSE.html","id":"id_2-basic-permissions","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"2. Basic Permissions","title":"GNU General Public License","text":"rights granted License granted term copyright Program, irrevocable provided stated conditions met. License explicitly affirms unlimited permission run unmodified Program. output running covered work covered License output, given content, constitutes covered work. License acknowledges rights fair use equivalent, provided copyright law. may make, run propagate covered works convey, without conditions long license otherwise remains force. may convey covered works others sole purpose make modifications exclusively , provide facilities running works, provided comply terms License conveying material control copyright. thus making running covered works must exclusively behalf, direction control, terms prohibit making copies copyrighted material outside relationship . Conveying circumstances permitted solely conditions stated . Sublicensing allowed; section 10 makes unnecessary.","code":""},{"path":"/LICENSE.html","id":"id_3-protecting-users-legal-rights-from-anti-circumvention-law","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"3. Protecting Users’ Legal Rights From Anti-Circumvention Law","title":"GNU General Public License","text":"covered work shall deemed part effective technological measure applicable law fulfilling obligations article 11 WIPO copyright treaty adopted 20 December 1996, similar laws prohibiting restricting circumvention measures. convey covered work, waive legal power forbid circumvention technological measures extent circumvention effected exercising rights License respect covered work, disclaim intention limit operation modification work means enforcing, work’s users, third parties’ legal rights forbid circumvention technological measures.","code":""},{"path":"/LICENSE.html","id":"id_4-conveying-verbatim-copies","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"4. Conveying Verbatim Copies","title":"GNU General Public License","text":"may convey verbatim copies Program’s source code receive , medium, provided conspicuously appropriately publish copy appropriate copyright notice; keep intact notices stating License non-permissive terms added accord section 7 apply code; keep intact notices absence warranty; give recipients copy License along Program. may charge price price copy convey, may offer support warranty protection fee.","code":""},{"path":"/LICENSE.html","id":"id_5-conveying-modified-source-versions","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"5. Conveying Modified Source Versions","title":"GNU General Public License","text":"may convey work based Program, modifications produce Program, form source code terms section 4, provided also meet conditions: ) work must carry prominent notices stating modified , giving relevant date. b) work must carry prominent notices stating released License conditions added section 7. requirement modifies requirement section 4 “keep intact notices”. c) must license entire work, whole, License anyone comes possession copy. License therefore apply, along applicable section 7 additional terms, whole work, parts, regardless packaged. License gives permission license work way, invalidate permission separately received . d) work interactive user interfaces, must display Appropriate Legal Notices; however, Program interactive interfaces display Appropriate Legal Notices, work need make . compilation covered work separate independent works, nature extensions covered work, combined form larger program, volume storage distribution medium, called “aggregate” compilation resulting copyright used limit access legal rights compilation’s users beyond individual works permit. Inclusion covered work aggregate cause License apply parts aggregate.","code":""},{"path":"/LICENSE.html","id":"id_6-conveying-non-source-forms","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"6. Conveying Non-Source Forms","title":"GNU General Public License","text":"may convey covered work object code form terms sections 4 5, provided also convey machine-readable Corresponding Source terms License, one ways: ) Convey object code , embodied , physical product (including physical distribution medium), accompanied Corresponding Source fixed durable physical medium customarily used software interchange. b) Convey object code , embodied , physical product (including physical distribution medium), accompanied written offer, valid least three years valid long offer spare parts customer support product model, give anyone possesses object code either (1) copy Corresponding Source software product covered License, durable physical medium customarily used software interchange, price reasonable cost physically performing conveying source, (2) access copy Corresponding Source network server charge. c) Convey individual copies object code copy written offer provide Corresponding Source. alternative allowed occasionally noncommercially, received object code offer, accord subsection 6b. d) Convey object code offering access designated place (gratis charge), offer equivalent access Corresponding Source way place charge. need require recipients copy Corresponding Source along object code. place copy object code network server, Corresponding Source may different server (operated third party) supports equivalent copying facilities, provided maintain clear directions next object code saying find Corresponding Source. Regardless server hosts Corresponding Source, remain obligated ensure available long needed satisfy requirements. e) Convey object code using peer--peer transmission, provided inform peers object code Corresponding Source work offered general public charge subsection 6d. separable portion object code, whose source code excluded Corresponding Source System Library, need included conveying object code work. “User Product” either (1) “consumer product”, means tangible personal property normally used personal, family, household purposes, (2) anything designed sold incorporation dwelling. determining whether product consumer product, doubtful cases shall resolved favor coverage. particular product received particular user, “normally used” refers typical common use class product, regardless status particular user way particular user actually uses, expects expected use, product. product consumer product regardless whether product substantial commercial, industrial non-consumer uses, unless uses represent significant mode use product. “Installation Information” User Product means methods, procedures, authorization keys, information required install execute modified versions covered work User Product modified version Corresponding Source. information must suffice ensure continued functioning modified object code case prevented interfered solely modification made. convey object code work section , , specifically use , User Product, conveying occurs part transaction right possession use User Product transferred recipient perpetuity fixed term (regardless transaction characterized), Corresponding Source conveyed section must accompanied Installation Information. requirement apply neither third party retains ability install modified object code User Product (example, work installed ROM). requirement provide Installation Information include requirement continue provide support service, warranty, updates work modified installed recipient, User Product modified installed. Access network may denied modification materially adversely affects operation network violates rules protocols communication across network. Corresponding Source conveyed, Installation Information provided, accord section must format publicly documented (implementation available public source code form), must require special password key unpacking, reading copying.","code":""},{"path":"/LICENSE.html","id":"id_7-additional-terms","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"7. Additional Terms","title":"GNU General Public License","text":"“Additional permissions” terms supplement terms License making exceptions one conditions. Additional permissions applicable entire Program shall treated though included License, extent valid applicable law. additional permissions apply part Program, part may used separately permissions, entire Program remains governed License without regard additional permissions. convey copy covered work, may option remove additional permissions copy, part . (Additional permissions may written require removal certain cases modify work.) may place additional permissions material, added covered work, can give appropriate copyright permission. Notwithstanding provision License, material add covered work, may (authorized copyright holders material) supplement terms License terms: ) Disclaiming warranty limiting liability differently terms sections 15 16 License; b) Requiring preservation specified reasonable legal notices author attributions material Appropriate Legal Notices displayed works containing ; c) Prohibiting misrepresentation origin material, requiring modified versions material marked reasonable ways different original version; d) Limiting use publicity purposes names licensors authors material; e) Declining grant rights trademark law use trade names, trademarks, service marks; f) Requiring indemnification licensors authors material anyone conveys material (modified versions ) contractual assumptions liability recipient, liability contractual assumptions directly impose licensors authors. non-permissive additional terms considered “restrictions” within meaning section 10. Program received , part , contains notice stating governed License along term restriction, may remove term. license document contains restriction permits relicensing conveying License, may add covered work material governed terms license document, provided restriction survive relicensing conveying. add terms covered work accord section, must place, relevant source files, statement additional terms apply files, notice indicating find applicable terms. Additional terms, permissive non-permissive, may stated form separately written license, stated exceptions; requirements apply either way.","code":""},{"path":"/LICENSE.html","id":"id_8-termination","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"8. Termination","title":"GNU General Public License","text":"may propagate modify covered work except expressly provided License. attempt otherwise propagate modify void, automatically terminate rights License (including patent licenses granted third paragraph section 11). However, cease violation License, license particular copyright holder reinstated () provisionally, unless copyright holder explicitly finally terminates license, (b) permanently, copyright holder fails notify violation reasonable means prior 60 days cessation. Moreover, license particular copyright holder reinstated permanently copyright holder notifies violation reasonable means, first time received notice violation License (work) copyright holder, cure violation prior 30 days receipt notice. Termination rights section terminate licenses parties received copies rights License. rights terminated permanently reinstated, qualify receive new licenses material section 10.","code":""},{"path":"/LICENSE.html","id":"id_9-acceptance-not-required-for-having-copies","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"9. Acceptance Not Required for Having Copies","title":"GNU General Public License","text":"required accept License order receive run copy Program. Ancillary propagation covered work occurring solely consequence using peer--peer transmission receive copy likewise require acceptance. However, nothing License grants permission propagate modify covered work. actions infringe copyright accept License. Therefore, modifying propagating covered work, indicate acceptance License .","code":""},{"path":"/LICENSE.html","id":"id_10-automatic-licensing-of-downstream-recipients","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"10. Automatic Licensing of Downstream Recipients","title":"GNU General Public License","text":"time convey covered work, recipient automatically receives license original licensors, run, modify propagate work, subject License. responsible enforcing compliance third parties License. “entity transaction” transaction transferring control organization, substantially assets one, subdividing organization, merging organizations. propagation covered work results entity transaction, party transaction receives copy work also receives whatever licenses work party’s predecessor interest give previous paragraph, plus right possession Corresponding Source work predecessor interest, predecessor can get reasonable efforts. may impose restrictions exercise rights granted affirmed License. example, may impose license fee, royalty, charge exercise rights granted License, may initiate litigation (including cross-claim counterclaim lawsuit) alleging patent claim infringed making, using, selling, offering sale, importing Program portion .","code":""},{"path":"/LICENSE.html","id":"id_11-patents","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"11. Patents","title":"GNU General Public License","text":"“contributor” copyright holder authorizes use License Program work Program based. work thus licensed called contributor’s “contributor version”. contributor’s “essential patent claims” patent claims owned controlled contributor, whether already acquired hereafter acquired, infringed manner, permitted License, making, using, selling contributor version, include claims infringed consequence modification contributor version. purposes definition, “control” includes right grant patent sublicenses manner consistent requirements License. contributor grants non-exclusive, worldwide, royalty-free patent license contributor’s essential patent claims, make, use, sell, offer sale, import otherwise run, modify propagate contents contributor version. following three paragraphs, “patent license” express agreement commitment, however denominated, enforce patent (express permission practice patent covenant sue patent infringement). “grant” patent license party means make agreement commitment enforce patent party. convey covered work, knowingly relying patent license, Corresponding Source work available anyone copy, free charge terms License, publicly available network server readily accessible means, must either (1) cause Corresponding Source available, (2) arrange deprive benefit patent license particular work, (3) arrange, manner consistent requirements License, extend patent license downstream recipients. “Knowingly relying” means actual knowledge , patent license, conveying covered work country, recipient’s use covered work country, infringe one identifiable patents country reason believe valid. , pursuant connection single transaction arrangement, convey, propagate procuring conveyance , covered work, grant patent license parties receiving covered work authorizing use, propagate, modify convey specific copy covered work, patent license grant automatically extended recipients covered work works based . patent license “discriminatory” include within scope coverage, prohibits exercise , conditioned non-exercise one rights specifically granted License. may convey covered work party arrangement third party business distributing software, make payment third party based extent activity conveying work, third party grants, parties receive covered work , discriminatory patent license () connection copies covered work conveyed (copies made copies), (b) primarily connection specific products compilations contain covered work, unless entered arrangement, patent license granted, prior 28 March 2007. Nothing License shall construed excluding limiting implied license defenses infringement may otherwise available applicable patent law.","code":""},{"path":"/LICENSE.html","id":"id_12-no-surrender-of-others-freedom","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"12. No Surrender of Others’ Freedom","title":"GNU General Public License","text":"conditions imposed (whether court order, agreement otherwise) contradict conditions License, excuse conditions License. convey covered work satisfy simultaneously obligations License pertinent obligations, consequence may convey . example, agree terms obligate collect royalty conveying convey Program, way satisfy terms License refrain entirely conveying Program.","code":""},{"path":"/LICENSE.html","id":"id_13-use-with-the-gnu-affero-general-public-license","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"13. Use with the GNU Affero General Public License","title":"GNU General Public License","text":"Notwithstanding provision License, permission link combine covered work work licensed version 3 GNU Affero General Public License single combined work, convey resulting work. terms License continue apply part covered work, special requirements GNU Affero General Public License, section 13, concerning interaction network apply combination .","code":""},{"path":"/LICENSE.html","id":"id_14-revised-versions-of-this-license","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"14. Revised Versions of this License","title":"GNU General Public License","text":"Free Software Foundation may publish revised /new versions GNU General Public License time time. new versions similar spirit present version, may differ detail address new problems concerns. version given distinguishing version number. Program specifies certain numbered version GNU General Public License “later version” applies , option following terms conditions either numbered version later version published Free Software Foundation. Program specify version number GNU General Public License, may choose version ever published Free Software Foundation. Program specifies proxy can decide future versions GNU General Public License can used, proxy’s public statement acceptance version permanently authorizes choose version Program. Later license versions may give additional different permissions. However, additional obligations imposed author copyright holder result choosing follow later version.","code":""},{"path":"/LICENSE.html","id":"id_15-disclaimer-of-warranty","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"15. Disclaimer of Warranty","title":"GNU General Public License","text":"WARRANTY PROGRAM, EXTENT PERMITTED APPLICABLE LAW. EXCEPT OTHERWISE STATED WRITING COPYRIGHT HOLDERS /PARTIES PROVIDE PROGRAM “” WITHOUT WARRANTY KIND, EITHER EXPRESSED IMPLIED, INCLUDING, LIMITED , IMPLIED WARRANTIES MERCHANTABILITY FITNESS PARTICULAR PURPOSE. ENTIRE RISK QUALITY PERFORMANCE PROGRAM . PROGRAM PROVE DEFECTIVE, ASSUME COST NECESSARY SERVICING, REPAIR CORRECTION.","code":""},{"path":"/LICENSE.html","id":"id_16-limitation-of-liability","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"16. Limitation of Liability","title":"GNU General Public License","text":"EVENT UNLESS REQUIRED APPLICABLE LAW AGREED WRITING COPYRIGHT HOLDER, PARTY MODIFIES /CONVEYS PROGRAM PERMITTED , LIABLE DAMAGES, INCLUDING GENERAL, SPECIAL, INCIDENTAL CONSEQUENTIAL DAMAGES ARISING USE INABILITY USE PROGRAM (INCLUDING LIMITED LOSS DATA DATA RENDERED INACCURATE LOSSES SUSTAINED THIRD PARTIES FAILURE PROGRAM OPERATE PROGRAMS), EVEN HOLDER PARTY ADVISED POSSIBILITY DAMAGES.","code":""},{"path":"/LICENSE.html","id":"id_17-interpretation-of-sections-15-and-16","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"17. Interpretation of Sections 15 and 16","title":"GNU General Public License","text":"disclaimer warranty limitation liability provided given local legal effect according terms, reviewing courts shall apply local law closely approximates absolute waiver civil liability connection Program, unless warranty assumption liability accompanies copy Program return fee. END TERMS CONDITIONS","code":""},{"path":"/articles/Intro_SpaTopic.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"SpaTopic Basics","text":"Recent advancements multiplexed tissue imaging allow examination tissue microenvironments great detail. cutting-edge technologies offer invaluable insights cellular heterogeneity spatial architectures, playing crucial role decoding mechanisms treatment response disease progression. However, gaining deep understanding complex spatial patterns remains challenging. SpaTopic implements novel spatial topic model integrate cell type spatial information identify complex spatial tissue structures without human intervention. Collapsed Gibbs sampling algorithm used model inference. Contrasting computationally intensive K-nearest-neighbor-based cell neighborhood analysis approaches, SpaTopic scalable large-scale image datasets without extracting neighborhood information every single cell. SpaTopic can applied either single image across multiple images.","code":""},{"path":"/articles/Intro_SpaTopic.html","id":"simple-usage","dir":"Articles","previous_headings":"","what":"Simple Usage","title":"SpaTopic Basics","text":"required input SpaTopic data frame containing cells within single image list data frames multiple images. data frame consists four columns: image: Image ID X, Y: X, Y cell coordinate type: cell type information Run Gibbs Sampling Check output SpaTopic detailed usage SpaTopic interprete output SpaTopic, please check complete tutorial SpaTopic Home Page. also provide function prepare input Seurat v5 object.","code":"library(SpaTopic) library(sf) ## The input can be a data frame or a list of data frames data(\"lung5\") head(lung5) #> image X Y type #> 1_1 image1 4215.889 158847.7 Dendritic #> 2_1 image1 6092.889 158834.7 Macrophage #> 3_1 image1 7214.889 158843.7 Neuroendocrine #> 4_1 image1 7418.889 158813.7 Macrophage #> 5_1 image1 7446.889 158845.7 Macrophage #> 6_1 image1 3254.889 158838.7 CD4 T ## Gibbs sampling gibbs.res<-SpaTopic_inference(lung5, ntopics = 7, sigma = 50, region_radius = 400) str(gibbs.res) #> List of 8 #> $ Perplexity : num 11.3 #> $ Deviance : num 485960 #> $ loglikelihood: num -242980 #> $ Beta :'data.frame': 38 obs. of 7 variables: #> ..$ topic1: num [1:38] 0.03587 0.02539 0.00755 0.01858 0.02585 ... #> ..$ topic2: num [1:38] 6.51e-03 3.55e-02 2.62e-06 5.80e-04 7.75e-01 ... #> ..$ topic3: num [1:38] 4.54e-06 4.54e-06 9.13e-04 3.45e-01 1.73e-03 ... #> ..$ topic4: num [1:38] 0.02664 0.01743 0.00186 0.0152 0.08919 ... #> ..$ topic5: num [1:38] 2.99e-06 2.99e-06 5.32e-03 1.91e-02 4.90e-03 ... #> ..$ topic6: num [1:38] 6.35e-06 6.35e-06 2.04e-02 3.43e-03 6.35e-06 ... #> ..$ topic7: num [1:38] 0.00534 0.00699 0.00604 0.01843 0.00655 ... #> $ Theta : num [1:971, 1:7] 0.855601 0.000232 0.999269 0.99889 0.998725 ... #> $ Ndk : int [1:971, 1:7] 107 0 82 54 47 72 100 0 0 0 ... #> $ Nwk : int [1:38, 1:7] 390 276 82 202 281 505 697 522 29 58 ... #> $ Z.trace :'data.frame': 100149 obs. of 7 variables: #> ..$ topic1: num [1:100149] 0.065 0.865 0.135 0.82 0.785 0.02 0.1 0.105 0.075 0.095 ... #> ..$ topic2: num [1:100149] 0 0 0 0 0 0 0 0 0 0 ... #> ..$ topic3: num [1:100149] 0.275 0.005 0.21 0.005 0.005 0.77 0.02 0.015 0.085 0.075 ... #> ..$ topic4: num [1:100149] 0.415 0 0 0.01 0.005 0.1 0.665 0.62 0.015 0.025 ... #> ..$ topic5: num [1:100149] 0.005 0.01 0 0 0 0 0.005 0.005 0.005 0 ... #> ..$ topic6: num [1:100149] 0 0 0.655 0.165 0.205 0.005 0 0 0 0 ... #> ..$ topic7: num [1:100149] 0.24 0.12 0 0 0 0.105 0.21 0.255 0.82 0.805 ..."},{"path":"/articles/Model_Selection.html","id":"simple-usage","dir":"Articles","previous_headings":"","what":"Simple Usage","title":"Model Selection","text":"","code":"library(SpaTopic)"},{"path":[]},{"path":[]},{"path":[]},{"path":"/articles/SpaTopic.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Introduction to SpaTopic","text":"Recent advancements multiplexed tissue imaging allow examination tissue microenvironments great detail. cutting-edge technologies offer invaluable insights cellular heterogeneity spatial architectures, playing crucial role decoding mechanisms treatment response disease progression. However, gaining deep understanding complex spatial patterns remains challenging. SpaTopic implements novel spatial topic model integrate cell type spatial information identify complex spatial tissue structures without human intervention. Collapsed Gibbs sampling algorithm used model inference. Contrasting computationally intensive K-nearest-neighbor-based cell neighborhood analysis approaches, SpaTopic scalable large-scale image datasets without extracting neighborhood information every single cell. SpaTopic can applied either single image across multiple images.","code":""},{"path":"/articles/SpaTopic.html","id":"set-up","dir":"Articles","previous_headings":"","what":"Set-up","title":"Introduction to SpaTopic","text":"use non-small cell lung cancer image illustrate use SpaTopic. data object can download , original public resources available nanostring website. images generated using 960-plex CoxMx RNA panel Nanostring CoxMx Spatial Molecular Imager platform. selected Lung5-1 sample annotated cells using Azimuth based human lung reference v1.0. Lung5-1 sample contains 38 annotated cell types. Since used healthy lung tissue reference, tumor cells labeled ’basal’ cells. informaion can found . can use Seurat function ImageDimPlot visualize distribution cell types image.","code":"## We use Seurat v5 package to visualize the results. ## If you still use Seurat v4, you will have the error library(Seurat, quietly = TRUE);packageVersion(\"Seurat\") #> [1] '5.0.2' ## Load the Seurat object for the image load(\"~/Documents/Research/github/SpaTopic_data/nanostring_example.rdata\") ## for large dataset options(future.globals.maxSize = 1e9) library(ggplot2) celltype.plot <-ImageDimPlot(nano.obj, fov = \"lung5.rep1\", axes = TRUE, cols = \"glasbey\",dark.background = T) celltype.plot+theme(legend.position = \"bottom\",legend.direction = \"vertical\")"},{"path":"/articles/SpaTopic.html","id":"topic-inference-on-a-single-image","dir":"Articles","previous_headings":"","what":"Topic Inference on a Single Image","title":"Introduction to SpaTopic","text":"Now, data ready. show example use SpaTopic identify tissue architectures multiplexed images.","code":""},{"path":"/articles/SpaTopic.html","id":"input","dir":"Articles","previous_headings":"Topic Inference on a Single Image","what":"Input","title":"Introduction to SpaTopic","text":"required input SpaTopic data frame containing cells within single image list data frames multiple images. data frame consists four columns: image ID, X, Y cell coordinates, cell type. may use function Seurat5obj_to_SpaTopic() extract input data typical Seurat v5 object. column name cell type information need provided via option group..","code":"library(SpaTopic);packageVersion(\"SpaTopic\") #> [1] '1.1.0.9900' library(sf) ## Prepare input from Seurat Object dataset<-Seurat5obj_to_SpaTopic(object = nano.obj, group.by = \"predicted.annotation.l1\",image = \"image1\") head(dataset) #> image X Y type #> 1_1 image1 4215.889 158847.7 Dendritic #> 2_1 image1 6092.889 158834.7 Macrophage #> 3_1 image1 7214.889 158843.7 Neuroendocrine #> 4_1 image1 7418.889 158813.7 Macrophage #> 5_1 image1 7446.889 158845.7 Macrophage #> 6_1 image1 3254.889 158838.7 CD4 T"},{"path":"/articles/SpaTopic.html","id":"gibbs-sampling","dir":"Articles","previous_headings":"Topic Inference on a Single Image","what":"Gibbs Sampling","title":"Introduction to SpaTopic","text":"step takes around 90 seconds regular laptop","code":"## Gibbs sampling for SpaTopic system.time(gibbs.res<-SpaTopic_inference(dataset, ntopics = 7, sigma = 50, region_radius = 400)) #> number of cells per image: #> 100149 #> Start initialization... #> Numer of Initializations: #> 10 #> Min perplexity during initialization: #> 11.6302259709245 #> number of region centers selected: #> 971 #> number of cells per region on average: #> 103.140061791967 #> Finish initialization. Start Gibbs sampling... #> Gibbs sampling done. #> Output model perplexity: #> 11.3156329380619 #> user system elapsed #> 64.992 0.374 65.689"},{"path":"/articles/SpaTopic.html","id":"topic-content-and-distribution","dir":"Articles","previous_headings":"Topic Inference on a Single Image","what":"Topic Content and Distribution","title":"Introduction to SpaTopic","text":"SpaTopic identify seven topics image. use heatmap show cell type composition within topic. assign cell topic highest posterior probability visualize distribution cell topics image.","code":"library(pheatmap) m <- as.data.frame(gibbs.res$Beta) pheatmap::pheatmap(t(m)) prob<-as.matrix(gibbs.res$Z.trace) nano.obj$Topic<-as.factor(apply(prob,1,which.max)) library(ggplot2) palatte<- c(\"#0000FFFF\",\"#FF0000FF\",\"#00FF00FF\",\"#009FFFFF\",\"#FF00B6FF\",\"#005300FF\",\"#FFD300FF\") ImageDimPlot(nano.obj, fov = \"lung5.rep1\", group.by = \"Topic\", axes = TRUE, dark.background = T,cols = palatte) + ggtitle(\"Topic\")"},{"path":"/articles/SpaTopic.html","id":"compare-to-buildnicheassay-in-seurat-v5","dir":"Articles","previous_headings":"Topic Inference on a Single Image","what":"Compare to BuildNicheAssay() in Seurat v5","title":"Introduction to SpaTopic","text":"compare SpaTopic function BuildNicheAssay() Seurat v5. took around 5 min laptop. also visualize distribution seven niches image.","code":"### NOT RUN!! We use the pre-computed result system.time(nano.obj <- BuildNicheAssay(object = nano.obj, \"lung5.rep1\", group.by = \"predicted.annotation.l1\", niches.k = 7, neighbors.k = 100)) nano.obj$niches<-factor(nano.obj$niches) nano.obj$niches<-ordered(nano.obj$niches,levels = c(1,2,3,4,5,6,7)) ## try to match the colors of topics palatte2<- c(\"#FF00B6FF\",\"#0000FFFF\",\"#FFD300FF\",\"#009FFFFF\",\"#FF0000FF\",\"#005300FF\",\"#00FF00FF\") ImageDimPlot(nano.obj, fov = \"lung5.rep1\", group.by = \"niches\", axes = TRUE, dark.background = T,cols = palatte2) + ggtitle(\"Niches\")"},{"path":"/articles/SpaTopic.html","id":"topic-inference-on-multiple-images","dir":"Articles","previous_headings":"","what":"Topic Inference on Multiple Images","title":"Introduction to SpaTopic","text":"SpaTopic can identify common tissue patterns across multiple images. input list data frames. See example (run). Please check examples SpaTopic Home Page.","code":"## tissue1, tissue2 are data frames of two different images. gibbs.res<-SpaTopic_inference(list(A = tissue1, B = tissue2), ntopics = 7, sigma = 50, region_radius = 400)"},{"path":"/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Xiyu Peng. Author, maintainer.","code":""},{"path":"/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Peng X (2024). SpaTopic: Topic Inference Identify Tissue Architecture Multiplexed Images. R package version 1.1.0.9900, https://github.com/xiyupeng/SpaTopic.","code":"@Manual{, title = {SpaTopic: Topic Inference to Identify Tissue Architecture in Multiplexed Images}, author = {Xiyu Peng}, year = {2024}, note = {R package version 1.1.0.9900}, url = {https://github.com/xiyupeng/SpaTopic}, }"},{"path":"/index.html","id":"spatopic","dir":"","previous_headings":"","what":"Topic Inference to Identify Tissue Architecture in Multiplexed Images","title":"Topic Inference to Identify Tissue Architecture in Multiplexed Images","text":"R package fast topic inference identify tissue architecture multiplexed images. implements spatial topic model identify immunologic topics across multiplexed images, given cell location cell type information input. Collapsed Gibbs Sampling algorithm used model inference. Compared KNN-based methods (KNN-kmeans, default Seurat v5 R package), SpaTopic runs much faster large-scale image dataset.","code":""},{"path":"/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Topic Inference to Identify Tissue Architecture in Multiplexed Images","text":"R package SpaTopic now available CRAN can installed following code. development version SpaTopic can installed GitHub repository.","code":"install.packages(\"SpaTopic\") # install.packages(\"devtools\") devtools::install_github(\"xiyupeng/SpaTopic\")"},{"path":"/index.html","id":"dependency","dir":"","previous_headings":"","what":"Dependency","title":"Topic Inference to Identify Tissue Architecture in Multiplexed Images","text":"SpaTopic requires dependency following R packages: Rcpp C++ codes RcppProgress C++ codes RcppArmadillo C++ codes RANN fast KNN foreach parallel computing sf spatial analysis","code":""},{"path":"/index.html","id":"usage","dir":"","previous_headings":"","what":"Usage","title":"Topic Inference to Identify Tissue Architecture in Multiplexed Images","text":"required input SpaTopic data frame containing cells within single image list data frames multiple images. data frame consists four columns: image ID, X, Y cell coordinates, cell type information. detailed usage SpaTopic, please check tutorial.","code":"library(SpaTopic) library(sf) ## The input can be a data frame or a list of data frames data(\"lung5\") head(lung5) # image X Y type #1_1 image1 4215.889 158847.7 Dendritic #2_1 image1 6092.889 158834.7 Macrophage #3_1 image1 7214.889 158843.7 Neuroendocrine #4_1 image1 7418.889 158813.7 Macrophage #5_1 image1 7446.889 158845.7 Macrophage #6_1 image1 3254.889 158838.7 CD4 T gibbs.res<-SpaTopic_inference(lung5, ntopics = 7, sigma = 50, region_radius = 400)"},{"path":"/index.html","id":"data","dir":"","previous_headings":"","what":"Data","title":"Topic Inference to Identify Tissue Architecture in Multiplexed Images","text":"example image used tutorial can downloaded . stored Seurat v5 object.","code":""},{"path":"/index.html","id":"output","dir":"","previous_headings":"","what":"Output","title":"Topic Inference to Identify Tissue Architecture in Multiplexed Images","text":"","code":"str(gibbs.res) # List of 8 # $ Perplexity : num 11.3 # $ Deviance : num 485960 # $ loglikelihood: num -242980 # $ Beta :'data.frame': 38 obs. of 7 variables: # ..$ topic1: num [1:38] 0.03587 0.02539 0.00755 0.01858 0.02585 ... # ..$ topic2: num [1:38] 6.51e-03 3.55e-02 2.62e-06 5.80e-04 7.75e-01 ... # ..$ topic3: num [1:38] 4.54e-06 4.54e-06 9.13e-04 3.45e-01 1.73e-03 ... # ..$ topic4: num [1:38] 0.02664 0.01743 0.00186 0.0152 0.08919 ... # ..$ topic5: num [1:38] 2.99e-06 2.99e-06 5.32e-03 1.91e-02 4.90e-03 ... # ..$ topic6: num [1:38] 6.35e-06 6.35e-06 2.04e-02 3.43e-03 6.35e-06 ... # ..$ topic7: num [1:38] 0.00534 0.00699 0.00604 0.01843 0.00655 ... # $ Theta : num [1:971, 1:7] 0.855601 0.000232 0.999269 0.99889 0.998725 ... # $ Ndk : int [1:971, 1:7] 107 0 82 54 47 72 100 0 0 0 ... # $ Nwk : int [1:38, 1:7] 390 276 82 202 281 505 697 522 29 58 ... # $ Z.trace :'data.frame': 100149 obs. of 7 variables: # ..$ topic1: num [1:100149] 0.065 0.865 0.135 0.82 0.785 0.02 0.1 0.105 0.075 0.095 ... # ..$ topic2: num [1:100149] 0 0 0 0 0 0 0 0 0 0 ... # ..$ topic3: num [1:100149] 0.275 0.005 0.21 0.005 0.005 0.77 0.02 0.015 0.085 0.075 ... # ..$ topic4: num [1:100149] 0.415 0 0 0.01 0.005 0.1 0.665 0.62 0.015 0.025 ... # ..$ topic5: num [1:100149] 0.005 0.01 0 0 0 0 0.005 0.005 0.005 0 ... # ..$ topic6: num [1:100149] 0 0 0.655 0.165 0.205 0.005 0 0 0 0 ... # ..$ topic7: num [1:100149] 0.24 0.12 0 0 0 0.105 0.21 0.255 0.82 0.805 ..."},{"path":"/index.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Topic Inference to Identify Tissue Architecture in Multiplexed Images","text":"Coming soon……","code":""},{"path":"/index.html","id":"contact","dir":"","previous_headings":"","what":"Contact","title":"Topic Inference to Identify Tissue Architecture in Multiplexed Images","text":"problems, please contact: Xiyu Peng (pansypeng124@gmail.com, pengx1@mskcc.org)","code":""},{"path":"/reference/Seurat5obj_to_SpaTopic.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert a Seurat v5 object as the input of 'SpaTopic' — Seurat5obj_to_SpaTopic","title":"Convert a Seurat v5 object as the input of 'SpaTopic' — Seurat5obj_to_SpaTopic","text":"Prepare 'SpaTopic' input one Seurat v5 object","code":""},{"path":"/reference/Seurat5obj_to_SpaTopic.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert a Seurat v5 object as the input of 'SpaTopic' — Seurat5obj_to_SpaTopic","text":"","code":"Seurat5obj_to_SpaTopic(object, group.by, image = \"image1\")"},{"path":"/reference/Seurat5obj_to_SpaTopic.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert a Seurat v5 object as the input of 'SpaTopic' — Seurat5obj_to_SpaTopic","text":"object Seurat v5 object group.character. name column contains celltype information Seurat object. image character. name image. Default \"image1\".","code":""},{"path":"/reference/Seurat5obj_to_SpaTopic.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert a Seurat v5 object as the input of 'SpaTopic' — Seurat5obj_to_SpaTopic","text":"Return data frame input 'SpaTopic'","code":""},{"path":[]},{"path":"/reference/Seurat5obj_to_SpaTopic.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert a Seurat v5 object as the input of 'SpaTopic' — Seurat5obj_to_SpaTopic","text":"","code":"## nano.obj is a Seurat v5 object #dataset<-Seurat5obj_to_SpaTopic(object = nano.obj, # group.by = \"predicted.annotation.l1\",image = \"image1\") ## Expect output data(\"lung5\")"},{"path":"/reference/SpaTopic-Package.html","id":null,"dir":"Reference","previous_headings":"","what":"'SpaTopic' R package — SpaTopic-Package","title":"'SpaTopic' R package — SpaTopic-Package","text":"'SpaTopic' R package centered around 'SpaTopic' algorithm infer spatial tissue architectures multiplexed images.","code":""},{"path":"/reference/SpaTopic-Package.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"'SpaTopic' R package — SpaTopic-Package","text":"package implements Collapsed Gibbs sampling algorithm infer topics, corresponding distinct tissue microenvironments across multiple tissue images. Without obtaining cell neighborhood info every single cell, 'SpaTopic' runs much faster KNN-based methods large-scale images. main functions 'SpaTopic' package Prepare input Seurat5obj_to_SpaTopic Model Inference SpaTopic_inference","code":""},{"path":[]},{"path":"/reference/SpaTopic-Package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"'SpaTopic' R package — SpaTopic-Package","text":"Xiyu Peng pansypeng124@gmail.com","code":""},{"path":"/reference/SpaTopic_inference.html","id":null,"dir":"Reference","previous_headings":"","what":"'SpaTopic': fast topic inference to identify tissue architecture in multiplexed images — SpaTopic_inference","title":"'SpaTopic': fast topic inference to identify tissue architecture in multiplexed images — SpaTopic_inference","text":"main function 'SpaTopic', implementing Collapsed Gibbs Sampling algorithm learn topics, referred different tissue microenvironments, across multiple multiplexed tissue images. function takes cell labels coordinates tissue images input, returns inferred topic labels every cell, well topic contents, distribution celltypes. function recovers spatial tissue architectures across images, well indicating cell-cell interactions domain.","code":""},{"path":"/reference/SpaTopic_inference.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"'SpaTopic': fast topic inference to identify tissue architecture in multiplexed images — SpaTopic_inference","text":"","code":"SpaTopic_inference( tissue, ntopics, sigma = 50, region_radius = 400, kneigh = 5, npoints_selected = 1, ini_LDA = TRUE, ninit = 10, niter_init = 100, beta = 0.05, alpha = 0.01, trace = FALSE, seed = 123, thin = 20, burnin = 1000, niter = 200, display_progress = TRUE, do.parallel = FALSE, n.cores = 1, axis = \"2D\" )"},{"path":"/reference/SpaTopic_inference.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"'SpaTopic': fast topic inference to identify tissue architecture in multiplexed images — SpaTopic_inference","text":"tissue (Required). data frame list data frames. One image. row represent cell image ID, X, Y coordinates image, celltype, column names (image, X, Y, type), respectively. may add another column Y2 3D tissue image. ntopics (Required). Number topics. Topics obtained distributions cell types. sigma Default 50. lengthscale Nearest-neighbor Exponential Kernel. Sigma controls strength decay correlation distance kernel function. Please check paper information. Need adjusted based image resolution region_radius Default 400. radius grid square sampling region centers image. Need adjusted based image resolution pattern complexity. kneigh Default 5. consider top 5 closest region centers cell. npoints_selected Default 1. Number points sampled grid square sampling region centers image. Used region_radius. ini_LDA Default TRUE. Use warm start strategy initialization choose best one continue. 0, simply uses first initialization. ninit Default 10. Number initialization. retain initialization highest log likelihood (perplexity). niter_init Default 100. Warm start 100 iterations Gibbs sampling initialization. beta Default 0.05. hyperparameter control sparsity topic content (topic-celltype) matrix Beta. smaller value introduces sparse Beta. alpha Default 0.01. hyperparameter control sparsity document (region) content (region-topic) matrix Theta. application, keep small sparsity Theta. trace Default FALSE. Compute save log likelihood, Ndk, Nwk every posterior samples. Useful want use DIC select number topics, time consuming compute likelihood every posterior samples. seed Default 123. Random seed. thin Default 20. Key parameter Gibbs sampling. Collect posterior sample every thin=20 iterations. burnin Default 1000. Key parameter Gibbs sampling. Start collect posterior samples 1000 iterations. may increase number iterations burn-highly complex tissue images. niter Default 200. Key parameter Gibbs sampling. Number posterior samples collected model inference. display_progress Default TRUE. Display progress bar. .parallel Default FALSE. Use parallel computing R package foreach. n.cores Default 1. Number cores used parallel computing. axis Default \"2D\". may switch \"3D\" 3D tissue images. However, model inference 3D tissue still test.","code":""},{"path":"/reference/SpaTopic_inference.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"'SpaTopic': fast topic inference to identify tissue architecture in multiplexed images — SpaTopic_inference","text":"Return gibbs.res-class object. list outputs Gibbs sampling.","code":""},{"path":[]},{"path":"/reference/SpaTopic_inference.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"'SpaTopic': fast topic inference to identify tissue architecture in multiplexed images — SpaTopic_inference","text":"","code":"## tissue is a data frame containing cellular information from one image or ## multiple data frames from multiple images. data(\"lung5\") ## NOT RUN, it takes about 90s library(sf) #> Linking to GEOS 3.11.0, GDAL 3.5.3, PROJ 9.1.0; sf_use_s2() is TRUE #gibbs.res<-SpaTopic_inference(lung5, ntopics = 7, # sigma = 50, region_radius = 400) ## generate a fake image 2 and make an example for multiple images ## NOT RUN #lung6<-lung5 #lung6$image<-\"image2\" ## The image ID of two images should be different #gibbs.res<-SpaTopic_inference(list(A = lung5, B = lung6), # ntopics = 7, sigma = 50, region_radius = 400)"},{"path":"/reference/gibbs.res-class.html","id":null,"dir":"Reference","previous_headings":"","what":"A class of the output from 'SpaTopic' — gibbs.res-class","title":"A class of the output from 'SpaTopic' — gibbs.res-class","text":"Outputs function SpaTopic_inference. list contains following members: $Perplexity. perplexity training data. Let N total number cells across images. \\(Perplexity = exp(-loglikelihood/N)\\) $Deviance. \\(Deviance = -2loglikelihood\\). $loglikelihood. model log-likelihood. $loglike.trace. log-likelihood every collected posterior sample. NULL trace = FALSE. $Beta. Topic content matrix rows celltypes columns topics $Theta. Topic prevalent matrix rows regions columns topics $Ndk. Number cells per topic (col) per region (row). $Nwk. Number cells per topic (col) per celltype (row). $Z.trace. Number times cell assigned topic across posterior samples. can compute posterior distributions Z (topic assignment) individual cells. $doc.trace. Ndk every collected posterior sample. NULL trace = FALSE. $word.trace. Nwk every collected posterior sample. NULL trace = FALSE.","code":""},{"path":[]},{"path":"/reference/lung5.html","id":null,"dir":"Reference","previous_headings":"","what":"Example input data for 'SpaTopic' — lung5","title":"Example input data for 'SpaTopic' — lung5","text":"multiplexed image data tumor tissue sample non small cell lung cancer patient","code":""},{"path":"/reference/lung5.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Example input data for 'SpaTopic' — lung5","text":"","code":"lung5"},{"path":"/reference/lung5.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Example input data for 'SpaTopic' — lung5","text":"## `lung5` data frame 100149 rows 4 columns: image Image ID X X coordinate cell Y Y coordinate cell type cell type","code":""},{"path":"/reference/lung5.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Example input data for 'SpaTopic' — lung5","text":"","code":""},{"path":[]},{"path":"/reference/stratified_sampling_sf.html","id":null,"dir":"Reference","previous_headings":"","what":"Spatially stratified random sample points from an image. — stratified_sampling_sf","title":"Spatially stratified random sample points from an image. — stratified_sampling_sf","text":"Spatially stratified random sample points image R package sf","code":""},{"path":"/reference/stratified_sampling_sf.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Spatially stratified random sample points from an image. — stratified_sampling_sf","text":"","code":"stratified_sampling_sf( points, cellsize = c(600, 600), num_samples_per_stratum = 1 )"},{"path":"/reference/stratified_sampling_sf.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Spatially stratified random sample points from an image. — stratified_sampling_sf","text":"points data frame contains points image X, Y coordinates. cellsize vector length 2 contains size grid square. Default c(600,600). num_samples_per_stratum number point selected grid square. Default 1.","code":""},{"path":"/reference/stratified_sampling_sf.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Spatially stratified random sample points from an image. — stratified_sampling_sf","text":"Return vector contains index sampled points.","code":""},{"path":"/reference/stratified_sampling_sf.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Spatially stratified random sample points from an image. — stratified_sampling_sf","text":"","code":"data(\"lung5\") pt_idx<-stratified_sampling_sf(lung5, cellsize = c(600,600))"},{"path":[]},{"path":"/news/index.html","id":"spatopic-110","dir":"Changelog","previous_headings":"","what":"SpaTopic 1.1.0","title":"SpaTopic 1.1.0","text":"CRAN release: 2024-04-22","code":""},{"path":"/news/index.html","id":"spatopic-101","dir":"Changelog","previous_headings":"","what":"SpaTopic 1.0.1","title":"SpaTopic 1.0.1","text":"CRAN release: 2024-01-17","code":""},{"path":"/news/index.html","id":"spatopic-10","dir":"Changelog","previous_headings":"","what":"SpaTopic 1.0","title":"SpaTopic 1.0","text":"Initial submission CRAN","code":""},{"path":"/news/index.html","id":"spatopic-099","dir":"Changelog","previous_headings":"","what":"SpaTopic 0.99","title":"SpaTopic 0.99","text":"Version development","code":""}] +[{"path":"/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"GNU General Public License","title":"GNU General Public License","text":"Version 3, 29 June 2007Copyright © 2007 Free Software Foundation, Inc.  Everyone permitted copy distribute verbatim copies license document, changing allowed.","code":""},{"path":"/LICENSE.html","id":"preamble","dir":"","previous_headings":"","what":"Preamble","title":"GNU General Public License","text":"GNU General Public License free, copyleft license software kinds works. licenses software practical works designed take away freedom share change works. contrast, GNU General Public License intended guarantee freedom share change versions program–make sure remains free software users. , Free Software Foundation, use GNU General Public License software; applies also work released way authors. can apply programs, . speak free software, referring freedom, price. General Public Licenses designed make sure freedom distribute copies free software (charge wish), receive source code can get want , can change software use pieces new free programs, know can things. protect rights, need prevent others denying rights asking surrender rights. Therefore, certain responsibilities distribute copies software, modify : responsibilities respect freedom others. example, distribute copies program, whether gratis fee, must pass recipients freedoms received. must make sure , , receive can get source code. must show terms know rights. Developers use GNU GPL protect rights two steps: (1) assert copyright software, (2) offer License giving legal permission copy, distribute /modify . developers’ authors’ protection, GPL clearly explains warranty free software. users’ authors’ sake, GPL requires modified versions marked changed, problems attributed erroneously authors previous versions. devices designed deny users access install run modified versions software inside , although manufacturer can . fundamentally incompatible aim protecting users’ freedom change software. systematic pattern abuse occurs area products individuals use, precisely unacceptable. Therefore, designed version GPL prohibit practice products. problems arise substantially domains, stand ready extend provision domains future versions GPL, needed protect freedom users. Finally, every program threatened constantly software patents. States allow patents restrict development use software general-purpose computers, , wish avoid special danger patents applied free program make effectively proprietary. prevent , GPL assures patents used render program non-free. precise terms conditions copying, distribution modification follow.","code":""},{"path":[]},{"path":"/LICENSE.html","id":"id_0-definitions","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"0. Definitions","title":"GNU General Public License","text":"“License” refers version 3 GNU General Public License. “Copyright” also means copyright-like laws apply kinds works, semiconductor masks. “Program” refers copyrightable work licensed License. licensee addressed “”. “Licensees” “recipients” may individuals organizations. “modify” work means copy adapt part work fashion requiring copyright permission, making exact copy. resulting work called “modified version” earlier work work “based ” earlier work. “covered work” means either unmodified Program work based Program. “propagate” work means anything , without permission, make directly secondarily liable infringement applicable copyright law, except executing computer modifying private copy. Propagation includes copying, distribution (without modification), making available public, countries activities well. “convey” work means kind propagation enables parties make receive copies. Mere interaction user computer network, transfer copy, conveying. interactive user interface displays “Appropriate Legal Notices” extent includes convenient prominently visible feature (1) displays appropriate copyright notice, (2) tells user warranty work (except extent warranties provided), licensees may convey work License, view copy License. interface presents list user commands options, menu, prominent item list meets criterion.","code":""},{"path":"/LICENSE.html","id":"id_1-source-code","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"1. Source Code","title":"GNU General Public License","text":"“source code” work means preferred form work making modifications . “Object code” means non-source form work. “Standard Interface” means interface either official standard defined recognized standards body, , case interfaces specified particular programming language, one widely used among developers working language. “System Libraries” executable work include anything, work whole, () included normal form packaging Major Component, part Major Component, (b) serves enable use work Major Component, implement Standard Interface implementation available public source code form. “Major Component”, context, means major essential component (kernel, window system, ) specific operating system () executable work runs, compiler used produce work, object code interpreter used run . “Corresponding Source” work object code form means source code needed generate, install, (executable work) run object code modify work, including scripts control activities. However, include work’s System Libraries, general-purpose tools generally available free programs used unmodified performing activities part work. example, Corresponding Source includes interface definition files associated source files work, source code shared libraries dynamically linked subprograms work specifically designed require, intimate data communication control flow subprograms parts work. Corresponding Source need include anything users can regenerate automatically parts Corresponding Source. Corresponding Source work source code form work.","code":""},{"path":"/LICENSE.html","id":"id_2-basic-permissions","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"2. Basic Permissions","title":"GNU General Public License","text":"rights granted License granted term copyright Program, irrevocable provided stated conditions met. License explicitly affirms unlimited permission run unmodified Program. output running covered work covered License output, given content, constitutes covered work. License acknowledges rights fair use equivalent, provided copyright law. may make, run propagate covered works convey, without conditions long license otherwise remains force. may convey covered works others sole purpose make modifications exclusively , provide facilities running works, provided comply terms License conveying material control copyright. thus making running covered works must exclusively behalf, direction control, terms prohibit making copies copyrighted material outside relationship . Conveying circumstances permitted solely conditions stated . Sublicensing allowed; section 10 makes unnecessary.","code":""},{"path":"/LICENSE.html","id":"id_3-protecting-users-legal-rights-from-anti-circumvention-law","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"3. Protecting Users’ Legal Rights From Anti-Circumvention Law","title":"GNU General Public License","text":"covered work shall deemed part effective technological measure applicable law fulfilling obligations article 11 WIPO copyright treaty adopted 20 December 1996, similar laws prohibiting restricting circumvention measures. convey covered work, waive legal power forbid circumvention technological measures extent circumvention effected exercising rights License respect covered work, disclaim intention limit operation modification work means enforcing, work’s users, third parties’ legal rights forbid circumvention technological measures.","code":""},{"path":"/LICENSE.html","id":"id_4-conveying-verbatim-copies","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"4. Conveying Verbatim Copies","title":"GNU General Public License","text":"may convey verbatim copies Program’s source code receive , medium, provided conspicuously appropriately publish copy appropriate copyright notice; keep intact notices stating License non-permissive terms added accord section 7 apply code; keep intact notices absence warranty; give recipients copy License along Program. may charge price price copy convey, may offer support warranty protection fee.","code":""},{"path":"/LICENSE.html","id":"id_5-conveying-modified-source-versions","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"5. Conveying Modified Source Versions","title":"GNU General Public License","text":"may convey work based Program, modifications produce Program, form source code terms section 4, provided also meet conditions: ) work must carry prominent notices stating modified , giving relevant date. b) work must carry prominent notices stating released License conditions added section 7. requirement modifies requirement section 4 “keep intact notices”. c) must license entire work, whole, License anyone comes possession copy. License therefore apply, along applicable section 7 additional terms, whole work, parts, regardless packaged. License gives permission license work way, invalidate permission separately received . d) work interactive user interfaces, must display Appropriate Legal Notices; however, Program interactive interfaces display Appropriate Legal Notices, work need make . compilation covered work separate independent works, nature extensions covered work, combined form larger program, volume storage distribution medium, called “aggregate” compilation resulting copyright used limit access legal rights compilation’s users beyond individual works permit. Inclusion covered work aggregate cause License apply parts aggregate.","code":""},{"path":"/LICENSE.html","id":"id_6-conveying-non-source-forms","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"6. Conveying Non-Source Forms","title":"GNU General Public License","text":"may convey covered work object code form terms sections 4 5, provided also convey machine-readable Corresponding Source terms License, one ways: ) Convey object code , embodied , physical product (including physical distribution medium), accompanied Corresponding Source fixed durable physical medium customarily used software interchange. b) Convey object code , embodied , physical product (including physical distribution medium), accompanied written offer, valid least three years valid long offer spare parts customer support product model, give anyone possesses object code either (1) copy Corresponding Source software product covered License, durable physical medium customarily used software interchange, price reasonable cost physically performing conveying source, (2) access copy Corresponding Source network server charge. c) Convey individual copies object code copy written offer provide Corresponding Source. alternative allowed occasionally noncommercially, received object code offer, accord subsection 6b. d) Convey object code offering access designated place (gratis charge), offer equivalent access Corresponding Source way place charge. need require recipients copy Corresponding Source along object code. place copy object code network server, Corresponding Source may different server (operated third party) supports equivalent copying facilities, provided maintain clear directions next object code saying find Corresponding Source. Regardless server hosts Corresponding Source, remain obligated ensure available long needed satisfy requirements. e) Convey object code using peer--peer transmission, provided inform peers object code Corresponding Source work offered general public charge subsection 6d. separable portion object code, whose source code excluded Corresponding Source System Library, need included conveying object code work. “User Product” either (1) “consumer product”, means tangible personal property normally used personal, family, household purposes, (2) anything designed sold incorporation dwelling. determining whether product consumer product, doubtful cases shall resolved favor coverage. particular product received particular user, “normally used” refers typical common use class product, regardless status particular user way particular user actually uses, expects expected use, product. product consumer product regardless whether product substantial commercial, industrial non-consumer uses, unless uses represent significant mode use product. “Installation Information” User Product means methods, procedures, authorization keys, information required install execute modified versions covered work User Product modified version Corresponding Source. information must suffice ensure continued functioning modified object code case prevented interfered solely modification made. convey object code work section , , specifically use , User Product, conveying occurs part transaction right possession use User Product transferred recipient perpetuity fixed term (regardless transaction characterized), Corresponding Source conveyed section must accompanied Installation Information. requirement apply neither third party retains ability install modified object code User Product (example, work installed ROM). requirement provide Installation Information include requirement continue provide support service, warranty, updates work modified installed recipient, User Product modified installed. Access network may denied modification materially adversely affects operation network violates rules protocols communication across network. Corresponding Source conveyed, Installation Information provided, accord section must format publicly documented (implementation available public source code form), must require special password key unpacking, reading copying.","code":""},{"path":"/LICENSE.html","id":"id_7-additional-terms","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"7. Additional Terms","title":"GNU General Public License","text":"“Additional permissions” terms supplement terms License making exceptions one conditions. Additional permissions applicable entire Program shall treated though included License, extent valid applicable law. additional permissions apply part Program, part may used separately permissions, entire Program remains governed License without regard additional permissions. convey copy covered work, may option remove additional permissions copy, part . (Additional permissions may written require removal certain cases modify work.) may place additional permissions material, added covered work, can give appropriate copyright permission. Notwithstanding provision License, material add covered work, may (authorized copyright holders material) supplement terms License terms: ) Disclaiming warranty limiting liability differently terms sections 15 16 License; b) Requiring preservation specified reasonable legal notices author attributions material Appropriate Legal Notices displayed works containing ; c) Prohibiting misrepresentation origin material, requiring modified versions material marked reasonable ways different original version; d) Limiting use publicity purposes names licensors authors material; e) Declining grant rights trademark law use trade names, trademarks, service marks; f) Requiring indemnification licensors authors material anyone conveys material (modified versions ) contractual assumptions liability recipient, liability contractual assumptions directly impose licensors authors. non-permissive additional terms considered “restrictions” within meaning section 10. Program received , part , contains notice stating governed License along term restriction, may remove term. license document contains restriction permits relicensing conveying License, may add covered work material governed terms license document, provided restriction survive relicensing conveying. add terms covered work accord section, must place, relevant source files, statement additional terms apply files, notice indicating find applicable terms. Additional terms, permissive non-permissive, may stated form separately written license, stated exceptions; requirements apply either way.","code":""},{"path":"/LICENSE.html","id":"id_8-termination","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"8. Termination","title":"GNU General Public License","text":"may propagate modify covered work except expressly provided License. attempt otherwise propagate modify void, automatically terminate rights License (including patent licenses granted third paragraph section 11). However, cease violation License, license particular copyright holder reinstated () provisionally, unless copyright holder explicitly finally terminates license, (b) permanently, copyright holder fails notify violation reasonable means prior 60 days cessation. Moreover, license particular copyright holder reinstated permanently copyright holder notifies violation reasonable means, first time received notice violation License (work) copyright holder, cure violation prior 30 days receipt notice. Termination rights section terminate licenses parties received copies rights License. rights terminated permanently reinstated, qualify receive new licenses material section 10.","code":""},{"path":"/LICENSE.html","id":"id_9-acceptance-not-required-for-having-copies","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"9. Acceptance Not Required for Having Copies","title":"GNU General Public License","text":"required accept License order receive run copy Program. Ancillary propagation covered work occurring solely consequence using peer--peer transmission receive copy likewise require acceptance. However, nothing License grants permission propagate modify covered work. actions infringe copyright accept License. Therefore, modifying propagating covered work, indicate acceptance License .","code":""},{"path":"/LICENSE.html","id":"id_10-automatic-licensing-of-downstream-recipients","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"10. Automatic Licensing of Downstream Recipients","title":"GNU General Public License","text":"time convey covered work, recipient automatically receives license original licensors, run, modify propagate work, subject License. responsible enforcing compliance third parties License. “entity transaction” transaction transferring control organization, substantially assets one, subdividing organization, merging organizations. propagation covered work results entity transaction, party transaction receives copy work also receives whatever licenses work party’s predecessor interest give previous paragraph, plus right possession Corresponding Source work predecessor interest, predecessor can get reasonable efforts. may impose restrictions exercise rights granted affirmed License. example, may impose license fee, royalty, charge exercise rights granted License, may initiate litigation (including cross-claim counterclaim lawsuit) alleging patent claim infringed making, using, selling, offering sale, importing Program portion .","code":""},{"path":"/LICENSE.html","id":"id_11-patents","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"11. Patents","title":"GNU General Public License","text":"“contributor” copyright holder authorizes use License Program work Program based. work thus licensed called contributor’s “contributor version”. contributor’s “essential patent claims” patent claims owned controlled contributor, whether already acquired hereafter acquired, infringed manner, permitted License, making, using, selling contributor version, include claims infringed consequence modification contributor version. purposes definition, “control” includes right grant patent sublicenses manner consistent requirements License. contributor grants non-exclusive, worldwide, royalty-free patent license contributor’s essential patent claims, make, use, sell, offer sale, import otherwise run, modify propagate contents contributor version. following three paragraphs, “patent license” express agreement commitment, however denominated, enforce patent (express permission practice patent covenant sue patent infringement). “grant” patent license party means make agreement commitment enforce patent party. convey covered work, knowingly relying patent license, Corresponding Source work available anyone copy, free charge terms License, publicly available network server readily accessible means, must either (1) cause Corresponding Source available, (2) arrange deprive benefit patent license particular work, (3) arrange, manner consistent requirements License, extend patent license downstream recipients. “Knowingly relying” means actual knowledge , patent license, conveying covered work country, recipient’s use covered work country, infringe one identifiable patents country reason believe valid. , pursuant connection single transaction arrangement, convey, propagate procuring conveyance , covered work, grant patent license parties receiving covered work authorizing use, propagate, modify convey specific copy covered work, patent license grant automatically extended recipients covered work works based . patent license “discriminatory” include within scope coverage, prohibits exercise , conditioned non-exercise one rights specifically granted License. may convey covered work party arrangement third party business distributing software, make payment third party based extent activity conveying work, third party grants, parties receive covered work , discriminatory patent license () connection copies covered work conveyed (copies made copies), (b) primarily connection specific products compilations contain covered work, unless entered arrangement, patent license granted, prior 28 March 2007. Nothing License shall construed excluding limiting implied license defenses infringement may otherwise available applicable patent law.","code":""},{"path":"/LICENSE.html","id":"id_12-no-surrender-of-others-freedom","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"12. No Surrender of Others’ Freedom","title":"GNU General Public License","text":"conditions imposed (whether court order, agreement otherwise) contradict conditions License, excuse conditions License. convey covered work satisfy simultaneously obligations License pertinent obligations, consequence may convey . example, agree terms obligate collect royalty conveying convey Program, way satisfy terms License refrain entirely conveying Program.","code":""},{"path":"/LICENSE.html","id":"id_13-use-with-the-gnu-affero-general-public-license","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"13. Use with the GNU Affero General Public License","title":"GNU General Public License","text":"Notwithstanding provision License, permission link combine covered work work licensed version 3 GNU Affero General Public License single combined work, convey resulting work. terms License continue apply part covered work, special requirements GNU Affero General Public License, section 13, concerning interaction network apply combination .","code":""},{"path":"/LICENSE.html","id":"id_14-revised-versions-of-this-license","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"14. Revised Versions of this License","title":"GNU General Public License","text":"Free Software Foundation may publish revised /new versions GNU General Public License time time. new versions similar spirit present version, may differ detail address new problems concerns. version given distinguishing version number. Program specifies certain numbered version GNU General Public License “later version” applies , option following terms conditions either numbered version later version published Free Software Foundation. Program specify version number GNU General Public License, may choose version ever published Free Software Foundation. Program specifies proxy can decide future versions GNU General Public License can used, proxy’s public statement acceptance version permanently authorizes choose version Program. Later license versions may give additional different permissions. However, additional obligations imposed author copyright holder result choosing follow later version.","code":""},{"path":"/LICENSE.html","id":"id_15-disclaimer-of-warranty","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"15. Disclaimer of Warranty","title":"GNU General Public License","text":"WARRANTY PROGRAM, EXTENT PERMITTED APPLICABLE LAW. EXCEPT OTHERWISE STATED WRITING COPYRIGHT HOLDERS /PARTIES PROVIDE PROGRAM “” WITHOUT WARRANTY KIND, EITHER EXPRESSED IMPLIED, INCLUDING, LIMITED , IMPLIED WARRANTIES MERCHANTABILITY FITNESS PARTICULAR PURPOSE. ENTIRE RISK QUALITY PERFORMANCE PROGRAM . PROGRAM PROVE DEFECTIVE, ASSUME COST NECESSARY SERVICING, REPAIR CORRECTION.","code":""},{"path":"/LICENSE.html","id":"id_16-limitation-of-liability","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"16. Limitation of Liability","title":"GNU General Public License","text":"EVENT UNLESS REQUIRED APPLICABLE LAW AGREED WRITING COPYRIGHT HOLDER, PARTY MODIFIES /CONVEYS PROGRAM PERMITTED , LIABLE DAMAGES, INCLUDING GENERAL, SPECIAL, INCIDENTAL CONSEQUENTIAL DAMAGES ARISING USE INABILITY USE PROGRAM (INCLUDING LIMITED LOSS DATA DATA RENDERED INACCURATE LOSSES SUSTAINED THIRD PARTIES FAILURE PROGRAM OPERATE PROGRAMS), EVEN HOLDER PARTY ADVISED POSSIBILITY DAMAGES.","code":""},{"path":"/LICENSE.html","id":"id_17-interpretation-of-sections-15-and-16","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"17. Interpretation of Sections 15 and 16","title":"GNU General Public License","text":"disclaimer warranty limitation liability provided given local legal effect according terms, reviewing courts shall apply local law closely approximates absolute waiver civil liability connection Program, unless warranty assumption liability accompanies copy Program return fee. END TERMS CONDITIONS","code":""},{"path":"/articles/Intro_SpaTopic.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"SpaTopic Basics","text":"Recent advancements multiplexed tissue imaging allow examination tissue microenvironments great detail. cutting-edge technologies offer invaluable insights cellular heterogeneity spatial architectures, playing crucial role decoding mechanisms treatment response disease progression. However, gaining deep understanding complex spatial patterns remains challenging. SpaTopic implements novel spatial topic model integrate cell type spatial information identify complex spatial tissue structures without human intervention. Collapsed Gibbs sampling algorithm used model inference. Contrasting computationally intensive K-nearest-neighbor-based cell neighborhood analysis approaches, SpaTopic scalable large-scale image datasets without extracting neighborhood information every single cell. SpaTopic can applied either single image across multiple images.","code":""},{"path":"/articles/Intro_SpaTopic.html","id":"simple-usage","dir":"Articles","previous_headings":"","what":"Simple Usage","title":"SpaTopic Basics","text":"required input SpaTopic data frame containing cells within single image list data frames multiple images. data frame consists four columns: image: Image ID X, Y: X, Y cell coordinate type: cell type information Run Gibbs Sampling Check output SpaTopic detailed usage SpaTopic interprete output SpaTopic, please check complete tutorial SpaTopic Home Page. also provide function prepare input Seurat v5 object.","code":"library(SpaTopic) library(sf) ## The input can be a data frame or a list of data frames data(\"lung5\") head(lung5) #> image X Y type #> 1_1 image1 4215.889 158847.7 Dendritic #> 2_1 image1 6092.889 158834.7 Macrophage #> 3_1 image1 7214.889 158843.7 Neuroendocrine #> 4_1 image1 7418.889 158813.7 Macrophage #> 5_1 image1 7446.889 158845.7 Macrophage #> 6_1 image1 3254.889 158838.7 CD4 T ## Gibbs sampling gibbs.res<-SpaTopic_inference(lung5, ntopics = 7, sigma = 50, region_radius = 400) str(gibbs.res) #> List of 8 #> $ Perplexity : num 11.3 #> $ Deviance : num 485960 #> $ loglikelihood: num -242980 #> $ Beta :'data.frame': 38 obs. of 7 variables: #> ..$ topic1: num [1:38] 0.03587 0.02539 0.00755 0.01858 0.02585 ... #> ..$ topic2: num [1:38] 6.51e-03 3.55e-02 2.62e-06 5.80e-04 7.75e-01 ... #> ..$ topic3: num [1:38] 4.54e-06 4.54e-06 9.13e-04 3.45e-01 1.73e-03 ... #> ..$ topic4: num [1:38] 0.02664 0.01743 0.00186 0.0152 0.08919 ... #> ..$ topic5: num [1:38] 2.99e-06 2.99e-06 5.32e-03 1.91e-02 4.90e-03 ... #> ..$ topic6: num [1:38] 6.35e-06 6.35e-06 2.04e-02 3.43e-03 6.35e-06 ... #> ..$ topic7: num [1:38] 0.00534 0.00699 0.00604 0.01843 0.00655 ... #> $ Theta : num [1:971, 1:7] 0.855601 0.000232 0.999269 0.99889 0.998725 ... #> $ Ndk : int [1:971, 1:7] 107 0 82 54 47 72 100 0 0 0 ... #> $ Nwk : int [1:38, 1:7] 390 276 82 202 281 505 697 522 29 58 ... #> $ Z.trace :'data.frame': 100149 obs. of 7 variables: #> ..$ topic1: num [1:100149] 0.065 0.865 0.135 0.82 0.785 0.02 0.1 0.105 0.075 0.095 ... #> ..$ topic2: num [1:100149] 0 0 0 0 0 0 0 0 0 0 ... #> ..$ topic3: num [1:100149] 0.275 0.005 0.21 0.005 0.005 0.77 0.02 0.015 0.085 0.075 ... #> ..$ topic4: num [1:100149] 0.415 0 0 0.01 0.005 0.1 0.665 0.62 0.015 0.025 ... #> ..$ topic5: num [1:100149] 0.005 0.01 0 0 0 0 0.005 0.005 0.005 0 ... #> ..$ topic6: num [1:100149] 0 0 0.655 0.165 0.205 0.005 0 0 0 0 ... #> ..$ topic7: num [1:100149] 0.24 0.12 0 0 0 0.105 0.21 0.255 0.82 0.805 ..."},{"path":"/articles/Model_Selection.html","id":"simple-usage","dir":"Articles","previous_headings":"","what":"Simple Usage","title":"Model Selection","text":"","code":"library(SpaTopic)"},{"path":[]},{"path":[]},{"path":[]},{"path":"/articles/SpaTopic.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Introduction to SpaTopic","text":"Recent advancements multiplexed tissue imaging allow examination tissue microenvironments great detail. cutting-edge technologies offer invaluable insights cellular heterogeneity spatial architectures, playing crucial role decoding mechanisms treatment response disease progression. However, gaining deep understanding complex spatial patterns remains challenging. SpaTopic implements novel spatial topic model integrate cell type spatial information identify complex spatial tissue structures without human intervention. Collapsed Gibbs sampling algorithm used model inference. Contrasting computationally intensive K-nearest-neighbor-based cell neighborhood analysis approaches, SpaTopic scalable large-scale image datasets without extracting neighborhood information every single cell. SpaTopic can applied either single image across multiple images.","code":""},{"path":"/articles/SpaTopic.html","id":"set-up","dir":"Articles","previous_headings":"","what":"Set-up","title":"Introduction to SpaTopic","text":"use non-small cell lung cancer image illustrate use SpaTopic. data object can download , original public resources available nanostring website. images generated using 960-plex CoxMx RNA panel Nanostring CoxMx Spatial Molecular Imager platform. selected Lung5-1 sample annotated cells using Azimuth based human lung reference v1.0. Lung5-1 sample contains 38 annotated cell types. Since used healthy lung tissue reference, tumor cells labeled ’basal’ cells. informaion can found . can use Seurat function ImageDimPlot visualize distribution cell types image.","code":"## We use Seurat v5 package to visualize the results. ## If you still use Seurat v4, you will have the error library(Seurat, quietly = TRUE);packageVersion(\"Seurat\") #> [1] '5.0.2' ## Load the Seurat object for the image load(\"~/Documents/Research/github/SpaTopic_data/nanostring_example.rdata\") ## for large dataset options(future.globals.maxSize = 1e9) library(ggplot2) celltype.plot <-ImageDimPlot(nano.obj, fov = \"lung5.rep1\", axes = TRUE, cols = \"glasbey\",dark.background = T) celltype.plot+theme(legend.position = \"bottom\",legend.direction = \"vertical\")"},{"path":"/articles/SpaTopic.html","id":"topic-inference-on-a-single-image","dir":"Articles","previous_headings":"","what":"Topic Inference on a Single Image","title":"Introduction to SpaTopic","text":"Now, data ready. show example use SpaTopic identify tissue architectures multiplexed images.","code":""},{"path":"/articles/SpaTopic.html","id":"input","dir":"Articles","previous_headings":"Topic Inference on a Single Image","what":"Input","title":"Introduction to SpaTopic","text":"required input SpaTopic data frame containing cells within single image list data frames multiple images. data frame consists four columns: image ID, X, Y cell coordinates, cell type. may use function Seurat5obj_to_SpaTopic() extract input data typical Seurat v5 object. column name cell type information need provided via option group..","code":"library(SpaTopic);packageVersion(\"SpaTopic\") #> [1] '1.1.0.9900' library(sf) ## Prepare input from Seurat Object dataset<-Seurat5obj_to_SpaTopic(object = nano.obj, group.by = \"predicted.annotation.l1\",image = \"image1\") head(dataset) #> image X Y type #> 1_1 image1 4215.889 158847.7 Dendritic #> 2_1 image1 6092.889 158834.7 Macrophage #> 3_1 image1 7214.889 158843.7 Neuroendocrine #> 4_1 image1 7418.889 158813.7 Macrophage #> 5_1 image1 7446.889 158845.7 Macrophage #> 6_1 image1 3254.889 158838.7 CD4 T"},{"path":"/articles/SpaTopic.html","id":"gibbs-sampling","dir":"Articles","previous_headings":"Topic Inference on a Single Image","what":"Gibbs Sampling","title":"Introduction to SpaTopic","text":"step takes around 90 seconds regular laptop","code":"## Gibbs sampling for SpaTopic system.time(gibbs.res<-SpaTopic_inference(dataset, ntopics = 7, sigma = 50, region_radius = 400)) #> number of cells per image: #> 100149 #> Start initialization... #> Numer of Initializations: #> 10 #> Min perplexity during initialization: #> 11.6302259709245 #> number of region centers selected: #> 971 #> number of cells per region on average: #> 103.140061791967 #> Finish initialization. Start Gibbs sampling... #> Gibbs sampling done. #> Output model perplexity: #> 11.3156329380619 #> user system elapsed #> 54.056 0.074 54.179"},{"path":"/articles/SpaTopic.html","id":"topic-content-and-distribution","dir":"Articles","previous_headings":"Topic Inference on a Single Image","what":"Topic Content and Distribution","title":"Introduction to SpaTopic","text":"SpaTopic identify seven topics image. use heatmap show cell type composition within topic. assign cell topic highest posterior probability visualize distribution cell topics image.","code":"library(pheatmap) m <- as.data.frame(gibbs.res$Beta) pheatmap::pheatmap(t(m)) prob<-as.matrix(gibbs.res$Z.trace) nano.obj$Topic<-as.factor(apply(prob,1,which.max)) library(ggplot2) palatte<- c(\"#0000FFFF\",\"#FF0000FF\",\"#00FF00FF\",\"#009FFFFF\",\"#FF00B6FF\",\"#005300FF\",\"#FFD300FF\") ImageDimPlot(nano.obj, fov = \"lung5.rep1\", group.by = \"Topic\", axes = TRUE, dark.background = T,cols = palatte) + ggtitle(\"Topic\")"},{"path":"/articles/SpaTopic.html","id":"compare-to-buildnicheassay-in-seurat-v5","dir":"Articles","previous_headings":"Topic Inference on a Single Image","what":"Compare to BuildNicheAssay() in Seurat v5","title":"Introduction to SpaTopic","text":"compare SpaTopic function BuildNicheAssay() Seurat v5. took around 5 min laptop. also visualize distribution seven niches image.","code":"### NOT RUN!! We use the pre-computed result system.time(nano.obj <- BuildNicheAssay(object = nano.obj, \"lung5.rep1\", group.by = \"predicted.annotation.l1\", niches.k = 7, neighbors.k = 100)) nano.obj$niches<-factor(nano.obj$niches) nano.obj$niches<-ordered(nano.obj$niches,levels = c(1,2,3,4,5,6,7)) ## try to match the colors of topics palatte2<- c(\"#FF00B6FF\",\"#0000FFFF\",\"#FFD300FF\",\"#009FFFFF\",\"#FF0000FF\",\"#005300FF\",\"#00FF00FF\") ImageDimPlot(nano.obj, fov = \"lung5.rep1\", group.by = \"niches\", axes = TRUE, dark.background = T,cols = palatte2) + ggtitle(\"Niches\")"},{"path":"/articles/SpaTopic.html","id":"topic-inference-on-multiple-images","dir":"Articles","previous_headings":"","what":"Topic Inference on Multiple Images","title":"Introduction to SpaTopic","text":"SpaTopic can identify common tissue patterns across multiple images. input list data frames. See example (run). Please check examples SpaTopic Home Page.","code":"## tissue1, tissue2 are data frames of two different images. gibbs.res<-SpaTopic_inference(list(A = tissue1, B = tissue2), ntopics = 7, sigma = 50, region_radius = 400)"},{"path":"/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Xiyu Peng. Author, maintainer.","code":""},{"path":"/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Peng X (2024). SpaTopic: Topic Inference Identify Tissue Architecture Multiplexed Images. R package version 1.1.0.9900, https://github.com/xiyupeng/SpaTopic.","code":"@Manual{, title = {SpaTopic: Topic Inference to Identify Tissue Architecture in Multiplexed Images}, author = {Xiyu Peng}, year = {2024}, note = {R package version 1.1.0.9900}, url = {https://github.com/xiyupeng/SpaTopic}, }"},{"path":"/index.html","id":"spatopic","dir":"","previous_headings":"","what":"Topic Inference to Identify Tissue Architecture in Multiplexed Images","title":"Topic Inference to Identify Tissue Architecture in Multiplexed Images","text":"R package fast topic inference identify tissue architecture multiplexed images. implements spatial topic model identify immunologic topics across multiplexed images, given cell location cell type information input. Collapsed Gibbs Sampling algorithm used model inference. Compared KNN-based methods (KNN-kmeans, default Seurat v5 R package), SpaTopic runs much faster large-scale image dataset.","code":""},{"path":"/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Topic Inference to Identify Tissue Architecture in Multiplexed Images","text":"R package SpaTopic now available CRAN can installed following code. development version SpaTopic can installed GitHub repository.","code":"install.packages(\"SpaTopic\") # install.packages(\"devtools\") devtools::install_github(\"xiyupeng/SpaTopic\")"},{"path":"/index.html","id":"dependency","dir":"","previous_headings":"","what":"Dependency","title":"Topic Inference to Identify Tissue Architecture in Multiplexed Images","text":"SpaTopic requires dependency following R packages: Rcpp C++ codes RcppProgress C++ codes RcppArmadillo C++ codes RANN fast KNN foreach parallel computing sf spatial analysis","code":""},{"path":"/index.html","id":"usage","dir":"","previous_headings":"","what":"Usage","title":"Topic Inference to Identify Tissue Architecture in Multiplexed Images","text":"required input SpaTopic data frame containing cells within single image list data frames multiple images. data frame consists four columns: image ID, X, Y cell coordinates, cell type information. detailed usage SpaTopic, please check tutorial.","code":"library(SpaTopic) library(sf) ## The input can be a data frame or a list of data frames data(\"lung5\") head(lung5) # image X Y type #1_1 image1 4215.889 158847.7 Dendritic #2_1 image1 6092.889 158834.7 Macrophage #3_1 image1 7214.889 158843.7 Neuroendocrine #4_1 image1 7418.889 158813.7 Macrophage #5_1 image1 7446.889 158845.7 Macrophage #6_1 image1 3254.889 158838.7 CD4 T gibbs.res<-SpaTopic_inference(lung5, ntopics = 7, sigma = 50, region_radius = 400)"},{"path":"/index.html","id":"data","dir":"","previous_headings":"","what":"Data","title":"Topic Inference to Identify Tissue Architecture in Multiplexed Images","text":"example image used tutorial can downloaded . stored Seurat v5 object.","code":""},{"path":"/index.html","id":"output","dir":"","previous_headings":"","what":"Output","title":"Topic Inference to Identify Tissue Architecture in Multiplexed Images","text":"","code":"str(gibbs.res) # List of 8 # $ Perplexity : num 11.3 # $ Deviance : num 485960 # $ loglikelihood: num -242980 # $ Beta :'data.frame': 38 obs. of 7 variables: # ..$ topic1: num [1:38] 0.03587 0.02539 0.00755 0.01858 0.02585 ... # ..$ topic2: num [1:38] 6.51e-03 3.55e-02 2.62e-06 5.80e-04 7.75e-01 ... # ..$ topic3: num [1:38] 4.54e-06 4.54e-06 9.13e-04 3.45e-01 1.73e-03 ... # ..$ topic4: num [1:38] 0.02664 0.01743 0.00186 0.0152 0.08919 ... # ..$ topic5: num [1:38] 2.99e-06 2.99e-06 5.32e-03 1.91e-02 4.90e-03 ... # ..$ topic6: num [1:38] 6.35e-06 6.35e-06 2.04e-02 3.43e-03 6.35e-06 ... # ..$ topic7: num [1:38] 0.00534 0.00699 0.00604 0.01843 0.00655 ... # $ Theta : num [1:971, 1:7] 0.855601 0.000232 0.999269 0.99889 0.998725 ... # $ Ndk : int [1:971, 1:7] 107 0 82 54 47 72 100 0 0 0 ... # $ Nwk : int [1:38, 1:7] 390 276 82 202 281 505 697 522 29 58 ... # $ Z.trace :'data.frame': 100149 obs. of 7 variables: # ..$ topic1: num [1:100149] 0.065 0.865 0.135 0.82 0.785 0.02 0.1 0.105 0.075 0.095 ... # ..$ topic2: num [1:100149] 0 0 0 0 0 0 0 0 0 0 ... # ..$ topic3: num [1:100149] 0.275 0.005 0.21 0.005 0.005 0.77 0.02 0.015 0.085 0.075 ... # ..$ topic4: num [1:100149] 0.415 0 0 0.01 0.005 0.1 0.665 0.62 0.015 0.025 ... # ..$ topic5: num [1:100149] 0.005 0.01 0 0 0 0 0.005 0.005 0.005 0 ... # ..$ topic6: num [1:100149] 0 0 0.655 0.165 0.205 0.005 0 0 0 0 ... # ..$ topic7: num [1:100149] 0.24 0.12 0 0 0 0.105 0.21 0.255 0.82 0.805 ..."},{"path":"/index.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Topic Inference to Identify Tissue Architecture in Multiplexed Images","text":"Xiyu Peng, James W. Smithy, Mohammad Yosofvand, Caroline E. Kostrzewa, MaryLena Bleile, Fiona D. Ehrich, Jasme Lee, Michael . Postow, Margaret K. Callahan, Katherine S. Panageas, Ronglai Shen. Decoding Spatial Tissue Architecture: Scalable Bayesian Topic Model Multiplexed Imaging Analysis. bioRxiv. doi: https://doi.org/10.1101/2024.10.08.617293","code":""},{"path":"/index.html","id":"contact","dir":"","previous_headings":"","what":"Contact","title":"Topic Inference to Identify Tissue Architecture in Multiplexed Images","text":"problems, please contact: Xiyu Peng (pansypeng124@gmail.com, pengx1@mskcc.org)","code":""},{"path":"/reference/Seurat5obj_to_SpaTopic.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert a Seurat v5 object as the input of 'SpaTopic' — Seurat5obj_to_SpaTopic","title":"Convert a Seurat v5 object as the input of 'SpaTopic' — Seurat5obj_to_SpaTopic","text":"Prepare 'SpaTopic' input one Seurat v5 object","code":""},{"path":"/reference/Seurat5obj_to_SpaTopic.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert a Seurat v5 object as the input of 'SpaTopic' — Seurat5obj_to_SpaTopic","text":"","code":"Seurat5obj_to_SpaTopic(object, group.by, image = \"image1\")"},{"path":"/reference/Seurat5obj_to_SpaTopic.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert a Seurat v5 object as the input of 'SpaTopic' — Seurat5obj_to_SpaTopic","text":"object Seurat v5 object group.character. name column contains celltype information Seurat object. image character. name image. Default \"image1\".","code":""},{"path":"/reference/Seurat5obj_to_SpaTopic.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert a Seurat v5 object as the input of 'SpaTopic' — Seurat5obj_to_SpaTopic","text":"Return data frame input 'SpaTopic'","code":""},{"path":[]},{"path":"/reference/Seurat5obj_to_SpaTopic.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert a Seurat v5 object as the input of 'SpaTopic' — Seurat5obj_to_SpaTopic","text":"","code":"## nano.obj is a Seurat v5 object #dataset<-Seurat5obj_to_SpaTopic(object = nano.obj, # group.by = \"predicted.annotation.l1\",image = \"image1\") ## Expect output data(\"lung5\")"},{"path":"/reference/SpaTopic-Package.html","id":null,"dir":"Reference","previous_headings":"","what":"'SpaTopic' R package — SpaTopic-Package","title":"'SpaTopic' R package — SpaTopic-Package","text":"'SpaTopic' R package centered around 'SpaTopic' algorithm infer spatial tissue architectures multiplexed images.","code":""},{"path":"/reference/SpaTopic-Package.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"'SpaTopic' R package — SpaTopic-Package","text":"package implements Collapsed Gibbs sampling algorithm infer topics, corresponding distinct tissue microenvironments across multiple tissue images. Without obtaining cell neighborhood info every single cell, 'SpaTopic' runs much faster KNN-based methods large-scale images. main functions 'SpaTopic' package Prepare input Seurat5obj_to_SpaTopic Model Inference SpaTopic_inference","code":""},{"path":[]},{"path":"/reference/SpaTopic-Package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"'SpaTopic' R package — SpaTopic-Package","text":"Xiyu Peng pansypeng124@gmail.com","code":""},{"path":"/reference/SpaTopic_inference.html","id":null,"dir":"Reference","previous_headings":"","what":"'SpaTopic': fast topic inference to identify tissue architecture in multiplexed images — SpaTopic_inference","title":"'SpaTopic': fast topic inference to identify tissue architecture in multiplexed images — SpaTopic_inference","text":"main function 'SpaTopic', implementing Collapsed Gibbs Sampling algorithm learn topics, referred different tissue microenvironments, across multiple multiplexed tissue images. function takes cell labels coordinates tissue images input, returns inferred topic labels every cell, well topic contents, distribution celltypes. function recovers spatial tissue architectures across images, well indicating cell-cell interactions domain.","code":""},{"path":"/reference/SpaTopic_inference.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"'SpaTopic': fast topic inference to identify tissue architecture in multiplexed images — SpaTopic_inference","text":"","code":"SpaTopic_inference( tissue, ntopics, sigma = 50, region_radius = 400, kneigh = 5, npoints_selected = 1, ini_LDA = TRUE, ninit = 10, niter_init = 100, beta = 0.05, alpha = 0.01, trace = FALSE, seed = 123, thin = 20, burnin = 1000, niter = 200, display_progress = TRUE, do.parallel = FALSE, n.cores = 1, axis = \"2D\" )"},{"path":"/reference/SpaTopic_inference.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"'SpaTopic': fast topic inference to identify tissue architecture in multiplexed images — SpaTopic_inference","text":"tissue (Required). data frame list data frames. One image. row represent cell image ID, X, Y coordinates image, celltype, column names (image, X, Y, type), respectively. may add another column Y2 3D tissue image. ntopics (Required). Number topics. Topics obtained distributions cell types. sigma Default 50. lengthscale Nearest-neighbor Exponential Kernel. Sigma controls strength decay correlation distance kernel function. Please check paper information. Need adjusted based image resolution region_radius Default 400. radius grid square sampling region centers image. Need adjusted based image resolution pattern complexity. kneigh Default 5. consider top 5 closest region centers cell. npoints_selected Default 1. Number points sampled grid square sampling region centers image. Used region_radius. ini_LDA Default TRUE. Use warm start strategy initialization choose best one continue. 0, simply uses first initialization. ninit Default 10. Number initialization. retain initialization highest log likelihood (perplexity). niter_init Default 100. Warm start 100 iterations Gibbs sampling initialization. beta Default 0.05. hyperparameter control sparsity topic content (topic-celltype) matrix Beta. smaller value introduces sparse Beta. alpha Default 0.01. hyperparameter control sparsity document (region) content (region-topic) matrix Theta. application, keep small sparsity Theta. trace Default FALSE. Compute save log likelihood, Ndk, Nwk every posterior samples. Useful want use DIC select number topics, time consuming compute likelihood every posterior samples. seed Default 123. Random seed. thin Default 20. Key parameter Gibbs sampling. Collect posterior sample every thin=20 iterations. burnin Default 1000. Key parameter Gibbs sampling. Start collect posterior samples 1000 iterations. may increase number iterations burn-highly complex tissue images. niter Default 200. Key parameter Gibbs sampling. Number posterior samples collected model inference. display_progress Default TRUE. Display progress bar. .parallel Default FALSE. Use parallel computing R package foreach. n.cores Default 1. Number cores used parallel computing. axis Default \"2D\". may switch \"3D\" 3D tissue images. However, model inference 3D tissue still test.","code":""},{"path":"/reference/SpaTopic_inference.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"'SpaTopic': fast topic inference to identify tissue architecture in multiplexed images — SpaTopic_inference","text":"Return gibbs.res-class object. list outputs Gibbs sampling.","code":""},{"path":[]},{"path":"/reference/SpaTopic_inference.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"'SpaTopic': fast topic inference to identify tissue architecture in multiplexed images — SpaTopic_inference","text":"","code":"## tissue is a data frame containing cellular information from one image or ## multiple data frames from multiple images. data(\"lung5\") ## NOT RUN, it takes about 90s library(sf) #> Linking to GEOS 3.11.0, GDAL 3.5.3, PROJ 9.1.0; sf_use_s2() is TRUE #gibbs.res<-SpaTopic_inference(lung5, ntopics = 7, # sigma = 50, region_radius = 400) ## generate a fake image 2 and make an example for multiple images ## NOT RUN #lung6<-lung5 #lung6$image<-\"image2\" ## The image ID of two images should be different #gibbs.res<-SpaTopic_inference(list(A = lung5, B = lung6), # ntopics = 7, sigma = 50, region_radius = 400)"},{"path":"/reference/gibbs.res-class.html","id":null,"dir":"Reference","previous_headings":"","what":"A class of the output from 'SpaTopic' — gibbs.res-class","title":"A class of the output from 'SpaTopic' — gibbs.res-class","text":"Outputs function SpaTopic_inference. list contains following members: $Perplexity. perplexity training data. Let N total number cells across images. \\(Perplexity = exp(-loglikelihood/N)\\) $Deviance. \\(Deviance = -2loglikelihood\\). $loglikelihood. model log-likelihood. $loglike.trace. log-likelihood every collected posterior sample. NULL trace = FALSE. $Beta. Topic content matrix rows celltypes columns topics $Theta. Topic prevalent matrix rows regions columns topics $Ndk. Number cells per topic (col) per region (row). $Nwk. Number cells per topic (col) per celltype (row). $Z.trace. Number times cell assigned topic across posterior samples. can compute posterior distributions Z (topic assignment) individual cells. $doc.trace. Ndk every collected posterior sample. NULL trace = FALSE. $word.trace. Nwk every collected posterior sample. NULL trace = FALSE.","code":""},{"path":[]},{"path":"/reference/lung5.html","id":null,"dir":"Reference","previous_headings":"","what":"Example input data for 'SpaTopic' — lung5","title":"Example input data for 'SpaTopic' — lung5","text":"multiplexed image data tumor tissue sample non small cell lung cancer patient","code":""},{"path":"/reference/lung5.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Example input data for 'SpaTopic' — lung5","text":"","code":"lung5"},{"path":"/reference/lung5.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Example input data for 'SpaTopic' — lung5","text":"## `lung5` data frame 100149 rows 4 columns: image Image ID X X coordinate cell Y Y coordinate cell type cell type","code":""},{"path":"/reference/lung5.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Example input data for 'SpaTopic' — lung5","text":"","code":""},{"path":[]},{"path":"/reference/stratified_sampling_sf.html","id":null,"dir":"Reference","previous_headings":"","what":"Spatially stratified random sample points from an image. — stratified_sampling_sf","title":"Spatially stratified random sample points from an image. — stratified_sampling_sf","text":"Spatially stratified random sample points image R package sf","code":""},{"path":"/reference/stratified_sampling_sf.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Spatially stratified random sample points from an image. — stratified_sampling_sf","text":"","code":"stratified_sampling_sf( points, cellsize = c(600, 600), num_samples_per_stratum = 1 )"},{"path":"/reference/stratified_sampling_sf.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Spatially stratified random sample points from an image. — stratified_sampling_sf","text":"points data frame contains points image X, Y coordinates. cellsize vector length 2 contains size grid square. Default c(600,600). num_samples_per_stratum number point selected grid square. Default 1.","code":""},{"path":"/reference/stratified_sampling_sf.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Spatially stratified random sample points from an image. — stratified_sampling_sf","text":"Return vector contains index sampled points.","code":""},{"path":"/reference/stratified_sampling_sf.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Spatially stratified random sample points from an image. — stratified_sampling_sf","text":"","code":"data(\"lung5\") pt_idx<-stratified_sampling_sf(lung5, cellsize = c(600,600))"},{"path":[]},{"path":"/news/index.html","id":"spatopic-110","dir":"Changelog","previous_headings":"","what":"SpaTopic 1.1.0","title":"SpaTopic 1.1.0","text":"CRAN release: 2024-04-22","code":""},{"path":"/news/index.html","id":"spatopic-101","dir":"Changelog","previous_headings":"","what":"SpaTopic 1.0.1","title":"SpaTopic 1.0.1","text":"CRAN release: 2024-01-17","code":""},{"path":"/news/index.html","id":"spatopic-10","dir":"Changelog","previous_headings":"","what":"SpaTopic 1.0","title":"SpaTopic 1.0","text":"Initial submission CRAN","code":""},{"path":"/news/index.html","id":"spatopic-099","dir":"Changelog","previous_headings":"","what":"SpaTopic 0.99","title":"SpaTopic 0.99","text":"Version development","code":""}] diff --git a/src/Makevars b/src/Makevars index dae8732..70b57c1 100644 --- a/src/Makevars +++ b/src/Makevars @@ -13,9 +13,9 @@ ## _In general_ we should no longer need to set a standard as any recent R ## installation will do the right thing. Should you need it, uncomment it and ## set the appropriate value, possibly CXX17. -#CXX_STD = CXX11 +#CXX_STD = CXX17 -PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS) -Ilibsrc $(SHLIB_OPENMP_CXXFLAGS) +PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS) -Ilibsrc $(SHLIB_OPENMP_CXXFLAGS) PKG_LIBS = $(SHLIB_OPENMP_CXXFLAGS) $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS) #CXXFLAGS=-O3 CC=ccache clang -Qunused-arguments