biopipen 0.31.6__tar.gz → 0.32.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of biopipen might be problematic. Click here for more details.

Files changed (301) hide show
  1. {biopipen-0.31.6 → biopipen-0.32.0}/PKG-INFO +1 -1
  2. biopipen-0.32.0/biopipen/__init__.py +1 -0
  3. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/ns/bam.py +28 -0
  4. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/ns/bed.py +40 -0
  5. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/ns/scrna.py +153 -0
  6. biopipen-0.32.0/biopipen/reports/scrna/CellCellCommunicationPlots.svelte +14 -0
  7. biopipen-0.32.0/biopipen/reports/scrna/SeuratMap2Ref.svelte +24 -0
  8. biopipen-0.32.0/biopipen/scripts/bam/BamSubsetByBed.py +38 -0
  9. biopipen-0.32.0/biopipen/scripts/bed/BedtoolsMakeWindows.py +47 -0
  10. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/scrna/AnnData2Seurat.R +22 -14
  11. biopipen-0.32.0/biopipen/scripts/scrna/CCPlotR-patch.R +161 -0
  12. biopipen-0.32.0/biopipen/scripts/scrna/CellCellCommunication.py +101 -0
  13. biopipen-0.32.0/biopipen/scripts/scrna/CellCellCommunicationPlots.R +191 -0
  14. biopipen-0.32.0/biopipen/scripts/scrna/Seurat2AnnData.R +8 -0
  15. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/scrna/SeuratMap2Ref.R +20 -1
  16. biopipen-0.32.0/biopipen/scripts/tcr/GIANA/GIANA.py +1817 -0
  17. biopipen-0.32.0/biopipen/scripts/tcr/GIANA/GIANA4.py +1783 -0
  18. biopipen-0.32.0/biopipen/scripts/tcr/GIANA/query.py +226 -0
  19. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/tcr/TCRClustering.R +25 -4
  20. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/utils/single_cell.R +92 -1
  21. {biopipen-0.31.6 → biopipen-0.32.0}/pyproject.toml +4 -1
  22. {biopipen-0.31.6 → biopipen-0.32.0}/setup.py +1 -1
  23. biopipen-0.31.6/biopipen/__init__.py +0 -1
  24. biopipen-0.31.6/biopipen/reports/scrna/SeuratMap2Ref.svelte +0 -20
  25. biopipen-0.31.6/biopipen/scripts/scrna/Seurat2AnnData.R +0 -48
  26. biopipen-0.31.6/biopipen/scripts/tcr/GIANA/GIANA.py +0 -1258
  27. biopipen-0.31.6/biopipen/scripts/tcr/GIANA/GIANA4.py +0 -1208
  28. biopipen-0.31.6/biopipen/scripts/tcr/GIANA/query.py +0 -224
  29. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/core/__init__.py +0 -0
  30. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/core/config.py +0 -0
  31. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/core/config.toml +0 -0
  32. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/core/defaults.py +0 -0
  33. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/core/filters.py +0 -0
  34. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/core/proc.py +0 -0
  35. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/core/testing.py +0 -0
  36. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/ns/__init__.py +0 -0
  37. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/ns/cellranger.py +0 -0
  38. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/ns/cellranger_pipeline.py +0 -0
  39. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/ns/cnv.py +0 -0
  40. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/ns/cnvkit.py +0 -0
  41. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/ns/cnvkit_pipeline.py +0 -0
  42. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/ns/delim.py +0 -0
  43. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/ns/gene.py +0 -0
  44. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/ns/gsea.py +0 -0
  45. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/ns/misc.py +0 -0
  46. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/ns/plot.py +0 -0
  47. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/ns/protein.py +0 -0
  48. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/ns/regulatory.py +0 -0
  49. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/ns/rnaseq.py +0 -0
  50. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/ns/scrna_metabolic_landscape.py +0 -0
  51. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/ns/snp.py +0 -0
  52. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/ns/stats.py +0 -0
  53. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/ns/tcgamaf.py +0 -0
  54. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/ns/tcr.py +0 -0
  55. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/ns/vcf.py +0 -0
  56. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/ns/web.py +0 -0
  57. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/reports/bam/CNAClinic.svelte +0 -0
  58. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/reports/bam/CNVpytor.svelte +0 -0
  59. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/reports/bam/ControlFREEC.svelte +0 -0
  60. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/reports/cellranger/CellRangerCount.svelte +0 -0
  61. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/reports/cellranger/CellRangerSummary.svelte +0 -0
  62. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/reports/cellranger/CellRangerVdj.svelte +0 -0
  63. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/reports/cnv/AneuploidyScore.svelte +0 -0
  64. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/reports/cnv/AneuploidyScoreSummary.svelte +0 -0
  65. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/reports/cnv/TMADScoreSummary.svelte +0 -0
  66. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/reports/cnvkit/CNVkitDiagram.svelte +0 -0
  67. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/reports/cnvkit/CNVkitHeatmap.svelte +0 -0
  68. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/reports/cnvkit/CNVkitScatter.svelte +0 -0
  69. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/reports/delim/SampleInfo.svelte +0 -0
  70. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/reports/gsea/FGSEA.svelte +0 -0
  71. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/reports/gsea/GSEA.svelte +0 -0
  72. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/reports/protein/ProdigySummary.svelte +0 -0
  73. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/reports/scrna/CellsDistribution.svelte +0 -0
  74. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/reports/scrna/DimPlots.svelte +0 -0
  75. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/reports/scrna/MarkersFinder.svelte +0 -0
  76. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/reports/scrna/MetaMarkers.svelte +0 -0
  77. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/reports/scrna/RadarPlots.svelte +0 -0
  78. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/reports/scrna/ScFGSEA.svelte +0 -0
  79. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/reports/scrna/SeuratClusterStats.svelte +0 -0
  80. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/reports/scrna/SeuratPreparing.svelte +0 -0
  81. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/reports/scrna/TopExpressingGenes.svelte +0 -0
  82. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/reports/scrna_metabolic_landscape/MetabolicFeatures.svelte +0 -0
  83. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/reports/scrna_metabolic_landscape/MetabolicFeaturesIntraSubset.svelte +0 -0
  84. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/reports/scrna_metabolic_landscape/MetabolicPathwayActivity.svelte +0 -0
  85. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/reports/scrna_metabolic_landscape/MetabolicPathwayHeterogeneity.svelte +0 -0
  86. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/reports/snp/PlinkCallRate.svelte +0 -0
  87. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/reports/snp/PlinkFreq.svelte +0 -0
  88. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/reports/snp/PlinkHWE.svelte +0 -0
  89. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/reports/snp/PlinkHet.svelte +0 -0
  90. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/reports/snp/PlinkIBD.svelte +0 -0
  91. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/reports/tcr/CDR3AAPhyschem.svelte +0 -0
  92. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/reports/tcr/CloneResidency.svelte +0 -0
  93. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/reports/tcr/Immunarch.svelte +0 -0
  94. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/reports/tcr/SampleDiversity.svelte +0 -0
  95. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/reports/tcr/TCRClusterStats.svelte +0 -0
  96. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/reports/tcr/TESSA.svelte +0 -0
  97. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/reports/tcr/VJUsage.svelte +0 -0
  98. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/reports/utils/gsea.liq +0 -0
  99. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/reports/utils/misc.liq +0 -0
  100. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/reports/vcf/TruvariBenchSummary.svelte +0 -0
  101. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/reports/vcf/TruvariConsistency.svelte +0 -0
  102. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/bam/BamMerge.py +0 -0
  103. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/bam/BamSampling.py +0 -0
  104. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/bam/BamSplitChroms.py +0 -0
  105. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/bam/CNAClinic.R +0 -0
  106. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/bam/CNVpytor.py +0 -0
  107. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/bam/ControlFREEC.py +0 -0
  108. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/bed/Bed2Vcf.py +0 -0
  109. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/bed/BedConsensus.py +0 -0
  110. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/bed/BedLiftOver.sh +0 -0
  111. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/bed/BedtoolsIntersect.py +0 -0
  112. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/bed/BedtoolsMerge.py +0 -0
  113. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/cellranger/CellRangerCount.py +0 -0
  114. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/cellranger/CellRangerSummary.R +0 -0
  115. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/cellranger/CellRangerVdj.py +0 -0
  116. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/cnv/AneuploidyScore.R +0 -0
  117. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/cnv/AneuploidyScoreSummary.R +0 -0
  118. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/cnv/TMADScore.R +0 -0
  119. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/cnv/TMADScoreSummary.R +0 -0
  120. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/cnvkit/CNVkitAccess.py +0 -0
  121. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/cnvkit/CNVkitAutobin.py +0 -0
  122. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/cnvkit/CNVkitBatch.py +0 -0
  123. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/cnvkit/CNVkitCall.py +0 -0
  124. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/cnvkit/CNVkitCoverage.py +0 -0
  125. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/cnvkit/CNVkitDiagram.py +0 -0
  126. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/cnvkit/CNVkitFix.py +0 -0
  127. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/cnvkit/CNVkitGuessBaits.py +0 -0
  128. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/cnvkit/CNVkitHeatmap.py +0 -0
  129. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/cnvkit/CNVkitReference.py +0 -0
  130. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/cnvkit/CNVkitScatter.py +0 -0
  131. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/cnvkit/CNVkitSegment.py +0 -0
  132. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/cnvkit/guess_baits.py +0 -0
  133. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/delim/RowsBinder.R +0 -0
  134. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/delim/SampleInfo.R +0 -0
  135. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/gene/GeneNameConversion.R +0 -0
  136. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/gene/GenePromoters.R +0 -0
  137. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/gsea/Enrichr.R +0 -0
  138. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/gsea/FGSEA.R +0 -0
  139. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/gsea/GSEA.R +0 -0
  140. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/gsea/PreRank.R +0 -0
  141. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/misc/Config2File.py +0 -0
  142. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/misc/Shell.sh +0 -0
  143. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/misc/Str2File.py +0 -0
  144. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/plot/Heatmap.R +0 -0
  145. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/plot/Manhattan.R +0 -0
  146. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/plot/QQPlot.R +0 -0
  147. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/plot/ROC.R +0 -0
  148. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/plot/Scatter.R +0 -0
  149. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/plot/VennDiagram.R +0 -0
  150. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/protein/Prodigy.py +0 -0
  151. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/protein/ProdigySummary.R +0 -0
  152. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/regulatory/MotifAffinityTest.R +0 -0
  153. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/regulatory/MotifAffinityTest_AtSNP.R +0 -0
  154. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/regulatory/MotifAffinityTest_MotifBreakR.R +0 -0
  155. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/regulatory/MotifScan.py +0 -0
  156. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/regulatory/VariantMotifPlot.R +0 -0
  157. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/regulatory/motifs-common.R +0 -0
  158. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/rnaseq/Simulation-ESCO.R +0 -0
  159. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/rnaseq/Simulation-RUVcorr.R +0 -0
  160. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/rnaseq/Simulation.R +0 -0
  161. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/rnaseq/UnitConversion.R +0 -0
  162. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/scrna/CellTypeAnnotation-celltypist.R +0 -0
  163. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/scrna/CellTypeAnnotation-common.R +0 -0
  164. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/scrna/CellTypeAnnotation-direct.R +0 -0
  165. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/scrna/CellTypeAnnotation-hitype.R +0 -0
  166. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/scrna/CellTypeAnnotation-sccatch.R +0 -0
  167. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/scrna/CellTypeAnnotation-sctype.R +0 -0
  168. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/scrna/CellTypeAnnotation.R +0 -0
  169. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/scrna/CellsDistribution.R +0 -0
  170. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/scrna/DimPlots.R +0 -0
  171. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/scrna/ExprImputation-alra.R +0 -0
  172. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/scrna/ExprImputation-rmagic.R +0 -0
  173. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/scrna/ExprImputation-scimpute.R +0 -0
  174. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/scrna/ExprImputation.R +0 -0
  175. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/scrna/MarkersFinder.R +0 -0
  176. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/scrna/MetaMarkers.R +0 -0
  177. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/scrna/ModuleScoreCalculator.R +0 -0
  178. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/scrna/RadarPlots.R +0 -0
  179. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/scrna/SCImpute.R +0 -0
  180. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/scrna/ScFGSEA.R +0 -0
  181. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/scrna/ScSimulation.R +0 -0
  182. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/scrna/SeuratClusterStats-clustree.R +0 -0
  183. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/scrna/SeuratClusterStats-dimplots.R +0 -0
  184. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/scrna/SeuratClusterStats-features.R +0 -0
  185. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/scrna/SeuratClusterStats-hists.R +0 -0
  186. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/scrna/SeuratClusterStats-ngenes.R +0 -0
  187. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/scrna/SeuratClusterStats-stats.R +0 -0
  188. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/scrna/SeuratClusterStats.R +0 -0
  189. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/scrna/SeuratClustering-common.R +0 -0
  190. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/scrna/SeuratClustering.R +0 -0
  191. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/scrna/SeuratFilter.R +0 -0
  192. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/scrna/SeuratLoading.R +0 -0
  193. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/scrna/SeuratMetadataMutater.R +0 -0
  194. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/scrna/SeuratPreparing-common.R +0 -0
  195. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/scrna/SeuratPreparing-doublet_detection.R +0 -0
  196. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/scrna/SeuratPreparing.R +0 -0
  197. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/scrna/SeuratSplit.R +0 -0
  198. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/scrna/SeuratSubClustering.R +0 -0
  199. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/scrna/SeuratSubset.R +0 -0
  200. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/scrna/SeuratTo10X.R +0 -0
  201. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/scrna/Subset10X.R +0 -0
  202. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/scrna/TopExpressingGenes.R +0 -0
  203. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/scrna/celltypist-wrapper.py +0 -0
  204. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/scrna/sctype.R +0 -0
  205. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/scrna_metabolic_landscape/MetabolicFeatures.R +0 -0
  206. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/scrna_metabolic_landscape/MetabolicFeaturesIntraSubset.R +0 -0
  207. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/scrna_metabolic_landscape/MetabolicPathwayActivity.R +0 -0
  208. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/scrna_metabolic_landscape/MetabolicPathwayHeterogeneity.R +0 -0
  209. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/snp/MatrixEQTL.R +0 -0
  210. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/snp/Plink2GTMat.py +0 -0
  211. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/snp/PlinkCallRate.R +0 -0
  212. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/snp/PlinkFilter.py +0 -0
  213. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/snp/PlinkFreq.R +0 -0
  214. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/snp/PlinkFromVcf.py +0 -0
  215. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/snp/PlinkHWE.R +0 -0
  216. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/snp/PlinkHet.R +0 -0
  217. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/snp/PlinkIBD.R +0 -0
  218. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/snp/PlinkSimulation.py +0 -0
  219. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/snp/PlinkUpdateName.py +0 -0
  220. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/stats/ChowTest.R +0 -0
  221. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/stats/DiffCoexpr.R +0 -0
  222. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/stats/LiquidAssoc.R +0 -0
  223. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/stats/Mediation.R +0 -0
  224. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/stats/MetaPvalue.R +0 -0
  225. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/stats/MetaPvalue1.R +0 -0
  226. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/tcgamaf/Maf2Vcf.py +0 -0
  227. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/tcgamaf/MafAddChr.py +0 -0
  228. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/tcgamaf/maf2vcf.pl +0 -0
  229. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/tcr/Attach2Seurat.R +0 -0
  230. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/tcr/CDR3AAPhyschem.R +0 -0
  231. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/tcr/CloneResidency.R +0 -0
  232. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/tcr/CloneSizeQQPlot.R +0 -0
  233. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/tcr/GIANA/Imgt_Human_TRBV.fasta +0 -0
  234. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/tcr/Immunarch-basic.R +0 -0
  235. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/tcr/Immunarch-clonality.R +0 -0
  236. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/tcr/Immunarch-diversity.R +0 -0
  237. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/tcr/Immunarch-geneusage.R +0 -0
  238. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/tcr/Immunarch-kmer.R +0 -0
  239. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/tcr/Immunarch-overlap.R +0 -0
  240. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/tcr/Immunarch-spectratyping.R +0 -0
  241. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/tcr/Immunarch-tracking.R +0 -0
  242. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/tcr/Immunarch-vjjunc.R +0 -0
  243. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/tcr/Immunarch.R +0 -0
  244. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/tcr/Immunarch2VDJtools.R +0 -0
  245. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/tcr/ImmunarchFilter.R +0 -0
  246. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/tcr/ImmunarchLoading.R +0 -0
  247. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/tcr/ImmunarchSplitIdents.R +0 -0
  248. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/tcr/SampleDiversity.R +0 -0
  249. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/tcr/TCRClusterStats.R +0 -0
  250. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/tcr/TCRDock.py +0 -0
  251. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/tcr/TESSA.R +0 -0
  252. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/tcr/TESSA_source/Atchley_factors.csv +0 -0
  253. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/tcr/TESSA_source/BriseisEncoder.py +0 -0
  254. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/tcr/TESSA_source/MCMC_control.R +0 -0
  255. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/tcr/TESSA_source/TrainedEncoder.h5 +0 -0
  256. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/tcr/TESSA_source/fixed_b.csv +0 -0
  257. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/tcr/TESSA_source/initialization.R +0 -0
  258. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/tcr/TESSA_source/post_analysis.R +0 -0
  259. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/tcr/TESSA_source/real_data.R +0 -0
  260. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/tcr/TESSA_source/update.R +0 -0
  261. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/tcr/TESSA_source/utility.R +0 -0
  262. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/tcr/VJUsage.R +0 -0
  263. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/tcr/immunarch-patched.R +0 -0
  264. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/tcr/vdjtools-patch.sh +0 -0
  265. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/vcf/BcftoolsAnnotate.py +0 -0
  266. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/vcf/BcftoolsFilter.py +0 -0
  267. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/vcf/BcftoolsSort.py +0 -0
  268. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/vcf/BcftoolsView.py +0 -0
  269. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/vcf/TruvariBench.sh +0 -0
  270. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/vcf/TruvariBenchSummary.R +0 -0
  271. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/vcf/TruvariConsistency.R +0 -0
  272. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/vcf/Vcf2Bed.py +0 -0
  273. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/vcf/VcfAnno.py +0 -0
  274. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/vcf/VcfDownSample.sh +0 -0
  275. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/vcf/VcfFilter.py +0 -0
  276. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/vcf/VcfFix.py +0 -0
  277. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/vcf/VcfFix_utils.py +0 -0
  278. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/vcf/VcfIndex.py +0 -0
  279. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/vcf/VcfIntersect.py +0 -0
  280. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/vcf/VcfLiftOver.sh +0 -0
  281. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/vcf/VcfSplitSamples.py +0 -0
  282. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/vcf/bcftools_utils.py +0 -0
  283. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/web/Download.py +0 -0
  284. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/web/DownloadList.py +0 -0
  285. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/web/GCloudStorageDownloadBucket.py +0 -0
  286. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/web/GCloudStorageDownloadFile.py +0 -0
  287. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/scripts/web/gcloud_common.py +0 -0
  288. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/utils/__init__.py +0 -0
  289. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/utils/caching.R +0 -0
  290. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/utils/common_docstrs.py +0 -0
  291. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/utils/gene.R +0 -0
  292. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/utils/gene.py +0 -0
  293. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/utils/gsea.R +0 -0
  294. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/utils/io.R +0 -0
  295. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/utils/misc.R +0 -0
  296. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/utils/misc.py +0 -0
  297. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/utils/mutate_helpers.R +0 -0
  298. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/utils/plot.R +0 -0
  299. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/utils/reference.py +0 -0
  300. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/utils/rnaseq.R +0 -0
  301. {biopipen-0.31.6 → biopipen-0.32.0}/biopipen/utils/vcf.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: biopipen
3
- Version: 0.31.6
3
+ Version: 0.32.0
4
4
  Summary: Bioinformatics processes/pipelines that can be run from `pipen run`
5
5
  License: MIT
6
6
  Author: pwwang
@@ -0,0 +1 @@
1
+ __version__ = "0.32.0"
@@ -301,3 +301,31 @@ class BamSampling(Proc):
301
301
  "sort_args": [],
302
302
  }
303
303
  script = "file://../scripts/bam/BamSampling.py"
304
+
305
+
306
+ class BamSubsetByBed(Proc):
307
+ """Subset bam file by the regions in a bed file
308
+
309
+ Input:
310
+ bamfile: The bam file
311
+ bedfile: The bed file
312
+
313
+ Output:
314
+ outfile: The output bam file
315
+
316
+ Envs:
317
+ ncores: Number of cores to use
318
+ samtools: Path to samtools executable
319
+ tool: The tool to use, currently only "samtools" is supported
320
+ index: Whether to index the output bam file
321
+ """
322
+ input = "bamfile:file, bedfile:file"
323
+ output = "outfile:file:{{in.bamfile | stem}}-subset.bam"
324
+ lang = config.lang.python
325
+ envs = {
326
+ "ncores": config.misc.ncores,
327
+ "samtools": config.exe.samtools,
328
+ "tool": "samtools",
329
+ "index": True,
330
+ }
331
+ script = "file://../scripts/bam/BamSubsetByBed.py"
@@ -198,3 +198,43 @@ class BedtoolsIntersect(Proc):
198
198
  "postcmd": None,
199
199
  }
200
200
  script = "file://../scripts/bed/BedtoolsIntersect.py"
201
+
202
+
203
+ class BedtoolsMakeWindows(Proc):
204
+ """Make windows from a BED file or genome size file, using `bedtools makewindows`.
205
+
206
+ Input:
207
+ infile: The input BED file or a genome size file
208
+ Type will be detected by the number of columns in the file.
209
+ If it has 3+ columns, it is treated as a BED file, otherwise
210
+ a genome size file.
211
+
212
+ Output:
213
+ outfile: The output BED file
214
+
215
+ Envs:
216
+ bedtools: The path to bedtools
217
+ window (type=int): The size of the windows
218
+ step (type=int): The step size of the windows
219
+ nwin (type=int): The number of windows to be generated
220
+ Exclusive with `window` and `step`.
221
+ Either `nwin` or `window` and `step` should be provided.
222
+ reverse (flag): Reverse numbering of windows in the output
223
+ name (choice): How to name the generated windows/regions
224
+ - none: Do not add any name
225
+ - src: Use the source interval's name
226
+ - winnum: Use the window number
227
+ - srcwinnum: Use the source interval's name and window number
228
+ """ # noqa: E501
229
+ input = "infile:file"
230
+ output = "outfile:file:{{in.infile | stem}}_windows.bed"
231
+ lang = config.lang.python
232
+ envs = {
233
+ "bedtools": config.exe.bedtools,
234
+ "window": None,
235
+ "step": None,
236
+ "nwin": None,
237
+ "reverse": False,
238
+ "name": "none",
239
+ }
240
+ script = "file://../scripts/bed/BedtoolsMakeWindows.py"
@@ -2314,3 +2314,156 @@ class ScSimulation(Proc):
2314
2314
  "params": {},
2315
2315
  }
2316
2316
  script = "file://../scripts/scrna/ScSimulation.R"
2317
+
2318
+
2319
+ class CellCellCommunication(Proc):
2320
+ """Cell-cell communication inference
2321
+
2322
+ This is implemented based on [LIANA](https://liana-py.readthedocs.io/en/latest/index.html),
2323
+ which is a Python package for cell-cell communication inference and provides a list of existing
2324
+ methods including [CellPhoneDB](https://github.com/ventolab/CellphoneDB),
2325
+ [Connectome](https://github.com/msraredon/Connectome/), log2FC,
2326
+ [NATMI](https://github.com/forrest-lab/NATMI),
2327
+ [SingleCellSignalR](https://github.com/SCA-IRCM/SingleCellSignalR), Rank_Aggregate, Geometric Mean,
2328
+ [scSeqComm](https://gitlab.com/sysbiobig/scseqcomm), and [CellChat](https://github.com/jinworks/CellChat).
2329
+
2330
+ You can also try `python -c 'import liana; liana.mt.show_methods()'` to see the methods available.
2331
+
2332
+ Note that this process does not do any visualization. You can use `CellCellCommunicationPlots`
2333
+ to visualize the results.
2334
+
2335
+ Reference:
2336
+ - [Review](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC9184522/).
2337
+ - [LIANA](https://www.biorxiv.org/content/10.1101/2023.08.19.553863v1).
2338
+
2339
+ Input:
2340
+ sobjfile: The seurat object file in RDS or h5seurat format or AnnData file.
2341
+
2342
+ Output:
2343
+ outfile: The output file with the 'liana_res' data frame.
2344
+ Stats are provided for both ligand and receptor entities, more specifically: ligand and receptor are
2345
+ the two entities that potentially interact. As a reminder, CCC events are not limited to secreted signalling,
2346
+ but we refer to them as ligand and receptor for simplicity.
2347
+ Also, in the case of heteromeric complexes, the ligand and receptor columns represent the subunit with minimum
2348
+ expression, while *_complex corresponds to the actual complex, with subunits being separated by _.
2349
+ source and target columns represent the source/sender and target/receiver cell identity for each interaction, respectively
2350
+ * `*_props`: represents the proportion of cells that express the entity.
2351
+ By default, any interactions in which either entity is not expressed in above 10% of cells per cell type
2352
+ is considered as a false positive, under the assumption that since CCC occurs between cell types, a sufficient
2353
+ proportion of cells within should express the genes.
2354
+ * `*_means`: entity expression mean per cell type.
2355
+ * `lr_means`: mean ligand-receptor expression, as a measure of ligand-receptor interaction magnitude.
2356
+ * `cellphone_pvals`: permutation-based p-values, as a measure of interaction specificity.
2357
+
2358
+ Envs:
2359
+ method (choice): The method to use for cell-cell communication inference.
2360
+ - CellPhoneDB: Use CellPhoneDB method.
2361
+ Magnitude Score: lr_means; Specificity Score: cellphone_pvals.
2362
+ - Connectome: Use Connectome method.
2363
+ - log2FC: Use log2FC method.
2364
+ - NATMI: Use NATMI method.
2365
+ - SingleCellSignalR: Use SingleCellSignalR method.
2366
+ - Rank_Aggregate: Use Rank_Aggregate method.
2367
+ - Geometric_Mean: Use Geometric Mean method.
2368
+ - scSeqComm: Use scSeqComm method.
2369
+ - CellChat: Use CellChat method.
2370
+ - cellphonedb: alias for `CellPhoneDB`
2371
+ - connectome: alias for `Connectome`
2372
+ - log2fc: alias for `log2FC`
2373
+ - natmi: alias for `NATMI`
2374
+ - singlesignaler: alias for `SingleCellSignalR`
2375
+ - rank_aggregate: alias for `Rank_Aggregate`
2376
+ - geometric_mean: alias for `Geometric_Mean`
2377
+ - scseqcomm: alias for `scSeqComm`
2378
+ - cellchat: alias for `CellChat`
2379
+ assay: The assay to use for the analysis.
2380
+ Only works for Seurat object.
2381
+ seed (type=int): The seed for the random number generator.
2382
+ ncores (type=int): The number of cores to use.
2383
+ groupby: The column name in metadata to group the cells.
2384
+ Typically, this column should be the cluster id.
2385
+ species (choice): The species of the cells.
2386
+ - human: Human cells, the 'consensus' resource will be used.
2387
+ - mouse: Mouse cells, the 'mouseconsensus' resource will be used.
2388
+ expr_prop (type=float): Minimum expression proportion for the ligands and
2389
+ receptors (+ their subunits) in the corresponding cell identities. Set to 0
2390
+ to return unfiltered results.
2391
+ min_cells (type=int): Minimum cells (per cell identity if grouped by `groupby`)
2392
+ to be considered for downstream analysis.
2393
+ n_perms (type=int): Number of permutations for the permutation test.
2394
+ Relevant only for permutation-based methods (e.g., `CellPhoneDB`).
2395
+ If `0` is passed, no permutation testing is performed.
2396
+ rscript: The path to the Rscript executable used to convert RDS file to AnnData.
2397
+ if `in.sobjfile` is an RDS file, it will be converted to AnnData file (h5ad).
2398
+ You need `Seurat`, `SeuratDisk` and `digest` installed.
2399
+ <more>: Other arguments for the method.
2400
+ The arguments are passed to the method directly.
2401
+ See the method documentation for more details and also
2402
+ `help(liana.mt.<method>.__call__)` in Python.
2403
+ """ # noqa: E501
2404
+ input = "sobjfile:file"
2405
+ output = "outfile:file:{{in.sobjfile | stem}}-ccc.txt"
2406
+ lang = config.lang.python
2407
+ envs = {
2408
+ "method": "cellchat",
2409
+ "assay": None,
2410
+ "seed": 1337,
2411
+ "ncores": config.misc.ncores,
2412
+ "groupby": "seurat_clusters",
2413
+ "species": "human",
2414
+ "expr_prop": 0.1,
2415
+ "min_cells": 5,
2416
+ "n_perms": 1000,
2417
+ "rscript": config.lang.rscript,
2418
+ }
2419
+ script = "file://../scripts/scrna/CellCellCommunication.py"
2420
+
2421
+
2422
+ class CellCellCommunicationPlots(Proc):
2423
+ """Visualization for cell-cell communication inference.
2424
+
2425
+ R package [`CCPlotR`](https://github.com/Sarah145/CCPlotR) is used to visualize
2426
+ the results.
2427
+
2428
+ Input:
2429
+ cccfile: The output file from `CellCellCommunication`
2430
+ or a tab-separated file with the following columns: `source`, `target`,
2431
+ `ligand`, `receptor`, and `score`.
2432
+ If so, `in.expfile` can be provided where `exp_df` is needed.
2433
+ expfile: The expression file with the expression of ligands and receptors.
2434
+ Columns include: `cell_type`, `gene` and `mean_exp`.
2435
+
2436
+ Output:
2437
+ outdir: The output directory for the plots.
2438
+
2439
+ Envs:
2440
+ score_col: The column name in the input file that contains the score, if
2441
+ the input file is from `CellCellCommunication`.
2442
+ Two alias columns are added in the result file of `CellCellCommunication`,
2443
+ `mag_score` and `spec_score`, which are the magnitude and specificity
2444
+ scores.
2445
+ subset: An expression to pass to `dplyr::filter()` to subset the ccc data.
2446
+ cases (type=json): The cases for the plots.
2447
+ The keys are the names of the cases and the values are the arguments for
2448
+ the plots. The arguments include:
2449
+ * kind: one of `arrow`, `circos`, `dotplot`, `heatmap`, `network`,
2450
+ and `sigmoid`.
2451
+ * devpars: The parameters for `png()` for the plot, including `res`,
2452
+ `width`, and `height`.
2453
+ * section: The section name for the report to group the plots.
2454
+ * <other>: Other arguments for `cc_<kind>` function in `CCPlotR`.
2455
+ See the documentation for more details.
2456
+ Or you can use `?CCPlotR::cc_<kind>` in R.
2457
+ """
2458
+ input = "cccfile:file, expfile:file"
2459
+ output = "outdir:dir:{{in.cccfile | stem}}-ccc_plots"
2460
+ lang = config.lang.rscript
2461
+ envs = {
2462
+ "score_col": "mag_score",
2463
+ "subset": None,
2464
+ "cases": {},
2465
+ }
2466
+ script = "file://../scripts/scrna/CellCellCommunicationPlots.R"
2467
+ plugin_opts = {
2468
+ "report": "file://../reports/scrna/CellCellCommunicationPlots.svelte",
2469
+ }
@@ -0,0 +1,14 @@
1
+ {% from "utils/misc.liq" import report_jobs, table_of_images -%}
2
+ <script>
3
+ import { Image } from "$libs";
4
+ </script>
5
+
6
+ {%- macro report_job(job, h=1) -%}
7
+ {{ job | render_job: h=h }}
8
+ {%- endmacro -%}
9
+
10
+ {%- macro head_job(job) -%}
11
+ <h1>{{job.in.cccfile | stem0 | escape}}</h1>
12
+ {%- endmacro -%}
13
+
14
+ {{ report_jobs(jobs, head_job, report_job) }}
@@ -0,0 +1,24 @@
1
+ {% from "utils/misc.liq" import report_jobs, table_of_images -%}
2
+ <script>
3
+ import { Image, DataTable } from "$libs";
4
+ </script>
5
+
6
+ {%- macro report_job(job, h=1) -%}
7
+
8
+ <h{{h}}>UMAPs</h{{h}}>
9
+ {% set imgs = job.outdir | glob: "UMAPs-*.png" %}
10
+ {{ table_of_images(imgs) }}
11
+
12
+ <h{{h}}>Stats</h{{h}}>
13
+ {% for stfile in job.outdir | glob: "stats-*.txt" %}
14
+ <h{{h+1}}>{{stfile | stem | replace: "stats-", ""}}</h{{h+1}}>
15
+ <DataTable src="{{stfile}}" data={ {{stfile | datatable: sep="\t"}} } />
16
+ {% endfor %}
17
+
18
+ {%- endmacro -%}
19
+
20
+ {%- macro head_job(job) -%}
21
+ <h1>{{job.in.sobjfile | stem0 | escape}}</h1>
22
+ {%- endmacro -%}
23
+
24
+ {{ report_jobs(jobs, head_job, report_job) }}
@@ -0,0 +1,38 @@
1
+ from pathlib import Path
2
+ from biopipen.utils.misc import run_command, logger
3
+
4
+ # using:
5
+ # samtools view --subsample 0.1 --subsample-seed 1234 --threads 4 -b -o out.bam in.bam
6
+
7
+ bamfile = {{ in.bamfile | repr }} # pyright: ignore # noqa
8
+ bedfile = {{ in.bedfile | repr }} # pyright: ignore # noqa
9
+ outfile = Path({{ out.outfile | repr }}) # pyright: ignore
10
+ ncores = {{ envs.ncores | int }} # pyright: ignore
11
+ samtools = {{ envs.samtools | repr }} # pyright: ignore
12
+ tool = {{ envs.tool | repr }} # pyright: ignore
13
+ should_index = {{ envs.index | repr }} # pyright: ignore
14
+
15
+ if tool != "samtools":
16
+ raise ValueError(
17
+ f"Tool {tool} is not supported. "
18
+ "Currently only samtools is supported."
19
+ )
20
+
21
+ cmd = [
22
+ samtools,
23
+ "view",
24
+ "--target-file",
25
+ bedfile,
26
+ "-b",
27
+ "--threads",
28
+ ncores,
29
+ "-o",
30
+ outfile,
31
+ bamfile
32
+ ]
33
+ run_command(cmd, fg=True)
34
+
35
+ if should_index:
36
+ logger.info("Indexing the output bam file.")
37
+ cmd = [samtools, "index", "-@", ncores, outfile]
38
+ run_command(cmd, fg=True)
@@ -0,0 +1,47 @@
1
+ from pathlib import Path
2
+ from biopipen.utils.misc import run_command, logger
3
+
4
+ infile = Path({{in.afile | repr}}) # pyright: ignore # noqa: #999
5
+ outfile = Path({{in.bfile | repr}}) # pyright: ignore
6
+ bedtools = {{envs.bedtools | repr}} # pyright: ignore
7
+ window = {{envs.window | repr}} # pyright: ignore
8
+ step = {{envs.step | repr}} # pyright: ignore
9
+ nwin = {{envs.nwin | repr}} # pyright: ignore
10
+ reverse = {{envs.reverse | repr}} # pyright: ignore
11
+ name = {{envs.name | repr}} # pyright: ignore
12
+
13
+ if nwin is None and window is None:
14
+ raise ValueError("Either `nwin` or `window` should be provided.")
15
+
16
+ if nwin is not None and window is not None:
17
+ raise ValueError("Either `nwin` or `window` should be provided, not both.")
18
+
19
+ # detect if infile is a genome size file or a bed file
20
+ with infile.open() as f:
21
+ line = f.readline().strip()
22
+ if len(line.split("\t")) > 2:
23
+ is_bed = True
24
+ else:
25
+ is_bed = False
26
+
27
+ if is_bed:
28
+ logger.info("BED file is detected as input.")
29
+ cmd = [bedtools, "makewindows", "-b", infile]
30
+ else:
31
+ logger.info("Genome size file is detected as input.")
32
+ cmd = [bedtools, "makewindows", "-g", infile]
33
+
34
+ if nwin:
35
+ cmd.extend(["-n", nwin])
36
+ elif step is not None:
37
+ cmd.extend(["-w", window, "-s", step])
38
+ else:
39
+ cmd.extend(["-w", window])
40
+
41
+ if reverse:
42
+ cmd.append("-reverse")
43
+
44
+ if name != "none":
45
+ cmd.extend(["-name", name])
46
+
47
+ run_command(cmd, stdout=outfile)
@@ -41,25 +41,33 @@ if (outtype == "rds") {
41
41
  f <- H5File$new(h5seurat_file, "r+")
42
42
  groups <- f$ls(recursive = TRUE)
43
43
 
44
- for (name in groups$name[grepl("categories", groups$name)]) {
45
- names <- strsplit(name, "/")[[1]]
46
- names <- c(names[1:length(names) - 1], "levels")
47
- new_name <- paste(names, collapse = "/")
48
- f[[new_name]] <- f[[name]]
49
- }
44
+ for (name in groups$name[grepl("/categories$", groups$name)]) {
45
+ valuenames <- levelnames <- codenames <- strsplit(name, "/")[[1]]
46
+ valuenames[length(valuenames)] <- "values"
47
+ valuenames <- paste(valuenames, collapse = "/")
48
+ levelnames[length(levelnames)] <- "levels"
49
+ levelnames <- paste(levelnames, collapse = "/")
50
+ codenames[length(codenames)] <- "codes"
51
+ codenames <- paste(codenames, collapse = "/")
52
+ if (!f$exists(codenames)) {
53
+ # No codes, skip
54
+ next
55
+ }
50
56
 
51
- for (name in groups$name[grepl("codes", groups$name)]) {
52
- names <- strsplit(name, "/")[[1]]
53
- names <- c(names[1:length(names) - 1], "values")
54
- new_name <- paste(names, collapse = "/")
55
- f[[new_name]] <- f[[name]]
56
- grp <- f[[new_name]]
57
- grp$write(args = list(1:grp$dims), value = grp$read() + 1)
57
+ if (!f$exists(levelnames)) {
58
+ f[[levelnames]] <- f[[name]]
59
+ }
60
+
61
+ if (!f$exists(valuenames)) {
62
+ f[[valuenames]] <- f[[codenames]]
63
+ grp <- f[[valuenames]]
64
+ grp$write(args = list(1:grp$dims), value = grp$read() + 1)
65
+ }
58
66
  }
59
67
  f$close_all()
60
68
  # end
61
69
 
62
- sobj <- LoadH5Seurat(h5seurat_file)
70
+ sobj <- LoadH5Seurat(h5seurat_file, assays = assay)
63
71
  if (!isFALSE(dotplot_check)) {
64
72
  log_info("Checking dotplot ...")
65
73
  dotfig <- file.path(outdir, "dotplot.png")
@@ -0,0 +1,161 @@
1
+ # patched version of cc_circos
2
+ # See https://github.com/Sarah145/CCPlotR/issues/4
3
+
4
+ cc_circos <- function(cc_df, option = "A", n_top_ints = 15, exp_df = NULL, cell_cols = NULL, palette = "BuPu", cex = 1, show_legend = TRUE, scale = FALSE, ...) {
5
+ stopifnot("'cc_df' must be a dataframe" = is(cc_df, "data.frame"))
6
+ stopifnot("cc_df should contain columns named source, target, ligand, receptor and score. See `toy_data` for an example." = all(c('source', 'target', 'ligand', 'receptor', 'score') %in% colnames(cc_df)))
7
+ stopifnot("option must be either 'A', 'B', 'C'" = option %in% c('A', 'B', 'C'))
8
+ library(stringr)
9
+ library(ComplexHeatmap)
10
+ library(circlize)
11
+ circos.clear()
12
+
13
+ target <- score <- ligand <- receptor <- source_lig <- target_rec <- cell_type <- gene <- cell_gene <- NULL
14
+ if (option == "A") {
15
+ input_df <- cc_df %>%
16
+ mutate(source = factor(source), target = factor(target)) %>%
17
+ group_by(source, target) %>%
18
+ tally()
19
+ if (is.null(cell_cols)) {
20
+ cell_cols <- setNames(paletteMartin(n = length(unique(c(input_df$source, input_df$target)))), unique(c(input_df$source, input_df$target)))
21
+ }
22
+ circlize_plot <- function() {
23
+ par(cex = cex)
24
+ chordDiagram(input_df,
25
+ scale = FALSE, grid.col = cell_cols,
26
+ annotationTrack = c("grid", "name"), directional = 1, direction.type = c("arrows", "diffHeight"), link.arr.type = "big.arrow", link.arr.length = 0.1, diffHeight = -mm_h(0.5), preAllocateTracks = list(
27
+ track.height = mm_h(10),
28
+ track.margin = c(mm_h(2), -mm_h(4))
29
+ ), ...
30
+ )
31
+ }
32
+ } else if (option == "B") {
33
+ input_df <- cc_df %>%
34
+ slice_max(order_by = score, n = n_top_ints) %>%
35
+ mutate(
36
+ source_lig = paste0(source, "|", ligand),
37
+ target_rec = paste0(target, "|", receptor)
38
+ )
39
+ arr_wd <- (((input_df$score - min(input_df$score)) / (max(input_df$score) - min(input_df$score))) * (4)) + 1
40
+
41
+ if (is.null(cell_cols)) {
42
+ cell_cols <- setNames(paletteMartin(n = length(unique(c(input_df$source, input_df$target)))), unique(c(input_df$source, input_df$target)))
43
+ }
44
+
45
+ link_cols <- c()
46
+ for (i in input_df$source_lig) {
47
+ link_cols <- c(link_cols, cell_cols[str_extract(i, "[^|]+")])
48
+ }
49
+
50
+ segments <- unique(c(paste0(input_df$source, "|", input_df$ligand), paste0(input_df$target, "|", input_df$receptor)))
51
+ grp <- str_extract(segments, "[^|]+")
52
+ names(grp) <- segments
53
+ lgd <- Legend(
54
+ labels = unique(c(input_df$source, input_df$target)),
55
+ title = "Cell type",
56
+ type = "points",
57
+ title_gp = gpar(fontsize = 14 * cex),
58
+ labels_gp = gpar(fontsize = 12 * cex),
59
+ legend_gp = gpar(col = "transparent"),
60
+ background = cell_cols[unique(c(input_df$source, input_df$target))]
61
+ )
62
+ circlize_plot <- function() {
63
+ par(cex = cex)
64
+ chordDiagram(
65
+ input_df %>%
66
+ select(source_lig, target_rec, score),
67
+ directional = 1, group = grp, link.sort = FALSE, scale = scale, diffHeight = 0.005,
68
+ direction.type = c("arrows"), link.arr.type = "triangle", annotationTrack = c(),
69
+ preAllocateTracks = list(list(track.height = 0.175), list(track.height = 0.05)),
70
+ big.gap = 3, transparency = 1, link.arr.lwd = arr_wd, link.arr.col = link_cols,
71
+ link.arr.length = 0.4, link.arr.width = 0.35, ...
72
+ )
73
+ circos.track(track.index = 1, panel.fun = function(x, y) {
74
+ circos.text(CELL_META$xcenter, CELL_META$ylim[1], str_extract(CELL_META$sector.index, "[^|]+$"),
75
+ facing = "clockwise", niceFacing = TRUE, adj = c(0, 0.55), cex = 1.3
76
+ )
77
+ }, bg.border = NA)
78
+ for (l in unique(str_extract(segments, "[^|]+"))) {
79
+ highlight.sector(segments[str_detect(segments, paste0("^", str_escape(l)))], track.index = 2, col = cell_cols[l])
80
+ }
81
+ if (show_legend == TRUE) {
82
+ draw(lgd, just = c("left", "bottom"), x = unit(5, "mm"), y = unit(5, "mm"))
83
+ }
84
+ circos.clear()
85
+ }
86
+ } else if (option == "C") {
87
+ stopifnot("'exp_df' must be a dataframe" = is(exp_df, "data.frame"))
88
+ stopifnot("exp_df should contain columns named cell_type, gene and mean_exp. See `toy_exp` for an example." = all(c('cell_type', 'gene', 'mean_exp') %in% colnames(exp_df)))
89
+
90
+ input_df <- cc_df %>%
91
+ slice_max(order_by = score, n = n_top_ints) %>%
92
+ mutate(
93
+ source_lig = paste0(source, "|", ligand),
94
+ target_rec = paste0(target, "|", receptor)
95
+ )
96
+
97
+ arr_wd <- (((input_df$score - min(input_df$score)) / (max(input_df$score) - min(input_df$score))) * (4)) + 1
98
+
99
+ if (is.null(cell_cols)) {
100
+ cell_cols <- setNames(paletteMartin(n = length(unique(c(input_df$source, input_df$target)))), unique(c(input_df$source, input_df$target)))
101
+ }
102
+
103
+ segments <- unique(c(paste0(input_df$source, "|", input_df$ligand), paste0(input_df$target, "|", input_df$receptor)))
104
+ grp <- str_extract(segments, "[^|]+")
105
+ names(grp) <- segments
106
+
107
+ gene_df <- as.data.frame(exp_df %>% mutate(cell_gene = paste0(cell_type, "|", gene)) %>% filter(cell_gene %in% segments))
108
+ rownames(gene_df) <- gene_df$cell_gene
109
+
110
+ brks <- scales::pretty_breaks(n = 5)(c(floor(min(gene_df$mean_exp)), ceiling(max(gene_df$mean_exp))))
111
+ gene_col_fun <- colorRamp2(brks, RColorBrewer::brewer.pal(length(brks), palette))
112
+
113
+ inner.cols <- setNames(gene_col_fun(gene_df[segments, "mean_exp"]), segments)
114
+ lgd1 <- Legend(
115
+ labels = unique(c(input_df$source, input_df$target)),
116
+ title = "Cell type",
117
+ type = "points",
118
+ title_gp = gpar(fontsize = 14 * cex),
119
+ labels_gp = gpar(fontsize = 12 * cex),
120
+ legend_gp = gpar(col = "transparent"),
121
+ background = cell_cols[unique(c(input_df$source, input_df$target))],
122
+ direction = "horizontal"
123
+ )
124
+
125
+ lgd2 <- Legend(
126
+ title_gp = gpar(fontsize = 14 * cex),
127
+ labels_gp = gpar(fontsize = 12 * cex),
128
+ direction = "horizontal", at = brks,
129
+ col_fun = gene_col_fun, title = "Mean exp."
130
+ )
131
+ circlize_plot <- function() {
132
+ par(cex = cex)
133
+ chordDiagram(
134
+ input_df %>%
135
+ select(source_lig, target_rec, score),
136
+ directional = 1, group = grp, link.sort = FALSE, diffHeight = 0.005, scale = scale,
137
+ direction.type = c("arrows"), link.arr.type = "triangle", annotationTrack = c(),
138
+ preAllocateTracks = list(list(track.height = 0.175), list(track.height = 0.05), list(track.height = 0.045)),
139
+ big.gap = 3, transparency = 1, link.arr.lwd = arr_wd, link.arr.col = "black", link.arr.length = 0.4, link.arr.width = 0.35, ...
140
+ )
141
+ circos.track(track.index = 1, panel.fun = function(x, y) {
142
+ circos.text(CELL_META$xcenter, CELL_META$ylim[1], str_extract(CELL_META$sector.index, "[^|]+$"),
143
+ facing = "clockwise", niceFacing = TRUE, adj = c(0, 0.55), cex = 1.3
144
+ )
145
+ }, bg.border = NA)
146
+ for (l in unique(str_extract(segments, "[^|]+"))) {
147
+ highlight.sector(segments[str_detect(segments, paste0("^", str_escape(l)))], track.index = 2, col = cell_cols[l])
148
+ }
149
+ circos.track(track.index = 3, panel.fun = function(x, y) {
150
+ circos.rect(CELL_META$xlim[1], CELL_META$ylim[1], CELL_META$xlim[2], CELL_META$ylim[2],
151
+ sector.index = CELL_META$sector.index, col = inner.cols[CELL_META$sector.index]
152
+ )
153
+ }, bg.border = NA)
154
+ if (show_legend == TRUE) {
155
+ draw(packLegend(lgd1, lgd2, direction = "vertical"), just = c("left", "bottom"), x = unit(4.75, "mm"), y = unit(4.75, "mm"))
156
+ }
157
+ circos.clear()
158
+ }
159
+ }
160
+ circlize_plot()
161
+ }