biopipen 0.27.7__tar.gz → 0.27.9__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.
Files changed (247) hide show
  1. {biopipen-0.27.7 → biopipen-0.27.9}/PKG-INFO +1 -1
  2. biopipen-0.27.9/biopipen/__init__.py +1 -0
  3. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/ns/scrna.py +27 -4
  4. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/ns/tcr.py +7 -0
  5. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/scrna/SeuratClusterStats-stats.R +1 -1
  6. biopipen-0.27.9/biopipen/scripts/scrna/SeuratMap2Ref.R +302 -0
  7. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/tcr/TCRClusterStats.R +22 -2
  8. {biopipen-0.27.7 → biopipen-0.27.9}/pyproject.toml +1 -1
  9. {biopipen-0.27.7 → biopipen-0.27.9}/setup.py +1 -1
  10. biopipen-0.27.7/biopipen/__init__.py +0 -1
  11. biopipen-0.27.7/biopipen/scripts/scrna/SeuratMap2Ref.R +0 -156
  12. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/core/__init__.py +0 -0
  13. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/core/config.py +0 -0
  14. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/core/config.toml +0 -0
  15. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/core/defaults.py +0 -0
  16. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/core/filters.py +0 -0
  17. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/core/proc.py +0 -0
  18. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/core/testing.py +0 -0
  19. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/ns/__init__.py +0 -0
  20. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/ns/bam.py +0 -0
  21. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/ns/bcftools.py +0 -0
  22. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/ns/bed.py +0 -0
  23. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/ns/cellranger.py +0 -0
  24. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/ns/cellranger_pipeline.py +0 -0
  25. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/ns/cnv.py +0 -0
  26. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/ns/cnvkit.py +0 -0
  27. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/ns/cnvkit_pipeline.py +0 -0
  28. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/ns/delim.py +0 -0
  29. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/ns/gene.py +0 -0
  30. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/ns/gsea.py +0 -0
  31. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/ns/misc.py +0 -0
  32. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/ns/plot.py +0 -0
  33. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/ns/rnaseq.py +0 -0
  34. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/ns/scrna_metabolic_landscape.py +0 -0
  35. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/ns/snp.py +0 -0
  36. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/ns/stats.py +0 -0
  37. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/ns/tcgamaf.py +0 -0
  38. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/ns/vcf.py +0 -0
  39. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/ns/web.py +0 -0
  40. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/reports/bam/CNAClinic.svelte +0 -0
  41. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/reports/bam/CNVpytor.svelte +0 -0
  42. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/reports/bam/ControlFREEC.svelte +0 -0
  43. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/reports/cellranger/CellRangerCount.svelte +0 -0
  44. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/reports/cellranger/CellRangerSummary.svelte +0 -0
  45. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/reports/cellranger/CellRangerVdj.svelte +0 -0
  46. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/reports/cnv/AneuploidyScore.svelte +0 -0
  47. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/reports/cnv/AneuploidyScoreSummary.svelte +0 -0
  48. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/reports/cnv/TMADScoreSummary.svelte +0 -0
  49. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/reports/cnvkit/CNVkitDiagram.svelte +0 -0
  50. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/reports/cnvkit/CNVkitHeatmap.svelte +0 -0
  51. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/reports/cnvkit/CNVkitScatter.svelte +0 -0
  52. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/reports/delim/SampleInfo.svelte +0 -0
  53. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/reports/gsea/FGSEA.svelte +0 -0
  54. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/reports/gsea/GSEA.svelte +0 -0
  55. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/reports/scrna/CellsDistribution.svelte +0 -0
  56. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/reports/scrna/DimPlots.svelte +0 -0
  57. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/reports/scrna/MarkersFinder.svelte +0 -0
  58. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/reports/scrna/MetaMarkers.svelte +0 -0
  59. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/reports/scrna/RadarPlots.svelte +0 -0
  60. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/reports/scrna/ScFGSEA.svelte +0 -0
  61. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/reports/scrna/SeuratClusterStats.svelte +0 -0
  62. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/reports/scrna/SeuratMap2Ref.svelte +0 -0
  63. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/reports/scrna/SeuratPreparing.svelte +0 -0
  64. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/reports/scrna/TopExpressingGenes.svelte +0 -0
  65. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/reports/scrna_metabolic_landscape/MetabolicFeatures.svelte +0 -0
  66. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/reports/scrna_metabolic_landscape/MetabolicFeaturesIntraSubset.svelte +0 -0
  67. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/reports/scrna_metabolic_landscape/MetabolicPathwayActivity.svelte +0 -0
  68. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/reports/scrna_metabolic_landscape/MetabolicPathwayHeterogeneity.svelte +0 -0
  69. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/reports/tcr/CDR3AAPhyschem.svelte +0 -0
  70. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/reports/tcr/CloneResidency.svelte +0 -0
  71. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/reports/tcr/Immunarch.svelte +0 -0
  72. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/reports/tcr/SampleDiversity.svelte +0 -0
  73. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/reports/tcr/TCRClusterStats.svelte +0 -0
  74. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/reports/tcr/TESSA.svelte +0 -0
  75. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/reports/tcr/VJUsage.svelte +0 -0
  76. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/reports/utils/gsea.liq +0 -0
  77. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/reports/utils/misc.liq +0 -0
  78. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/reports/vcf/TruvariBenchSummary.svelte +0 -0
  79. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/reports/vcf/TruvariConsistency.svelte +0 -0
  80. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/bam/BamMerge.py +0 -0
  81. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/bam/BamSplitChroms.py +0 -0
  82. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/bam/CNAClinic.R +0 -0
  83. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/bam/CNVpytor.py +0 -0
  84. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/bam/ControlFREEC.py +0 -0
  85. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/bcftools/BcftoolsAnnotate.py +0 -0
  86. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/bcftools/BcftoolsFilter.py +0 -0
  87. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/bcftools/BcftoolsSort.py +0 -0
  88. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/bed/Bed2Vcf.py +0 -0
  89. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/bed/BedConsensus.py +0 -0
  90. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/bed/BedLiftOver.sh +0 -0
  91. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/bed/BedtoolsMerge.py +0 -0
  92. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/cellranger/CellRangerCount.py +0 -0
  93. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/cellranger/CellRangerSummary.R +0 -0
  94. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/cellranger/CellRangerVdj.py +0 -0
  95. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/cnv/AneuploidyScore.R +0 -0
  96. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/cnv/AneuploidyScoreSummary.R +0 -0
  97. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/cnv/TMADScore.R +0 -0
  98. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/cnv/TMADScoreSummary.R +0 -0
  99. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/cnvkit/CNVkitAccess.py +0 -0
  100. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/cnvkit/CNVkitAutobin.py +0 -0
  101. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/cnvkit/CNVkitBatch.py +0 -0
  102. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/cnvkit/CNVkitCall.py +0 -0
  103. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/cnvkit/CNVkitCoverage.py +0 -0
  104. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/cnvkit/CNVkitDiagram.py +0 -0
  105. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/cnvkit/CNVkitFix.py +0 -0
  106. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/cnvkit/CNVkitGuessBaits.py +0 -0
  107. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/cnvkit/CNVkitHeatmap.py +0 -0
  108. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/cnvkit/CNVkitReference.py +0 -0
  109. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/cnvkit/CNVkitScatter.py +0 -0
  110. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/cnvkit/CNVkitSegment.py +0 -0
  111. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/cnvkit/guess_baits.py +0 -0
  112. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/delim/RowsBinder.R +0 -0
  113. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/delim/SampleInfo.R +0 -0
  114. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/gene/GeneNameConversion.py +0 -0
  115. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/gsea/Enrichr.R +0 -0
  116. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/gsea/FGSEA.R +0 -0
  117. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/gsea/GSEA.R +0 -0
  118. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/gsea/PreRank.R +0 -0
  119. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/misc/Config2File.py +0 -0
  120. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/misc/Str2File.py +0 -0
  121. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/plot/Heatmap.R +0 -0
  122. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/plot/ROC.R +0 -0
  123. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/plot/VennDiagram.R +0 -0
  124. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/rnaseq/Simulation-ESCO.R +0 -0
  125. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/rnaseq/Simulation-RUVcorr.R +0 -0
  126. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/rnaseq/Simulation.R +0 -0
  127. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/rnaseq/UnitConversion.R +0 -0
  128. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/scrna/AnnData2Seurat.R +0 -0
  129. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/scrna/CellTypeAnnotation-celltypist.R +0 -0
  130. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/scrna/CellTypeAnnotation-direct.R +0 -0
  131. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/scrna/CellTypeAnnotation-hitype.R +0 -0
  132. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/scrna/CellTypeAnnotation-sccatch.R +0 -0
  133. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/scrna/CellTypeAnnotation-sctype.R +0 -0
  134. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/scrna/CellTypeAnnotation.R +0 -0
  135. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/scrna/CellsDistribution.R +0 -0
  136. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/scrna/DimPlots.R +0 -0
  137. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/scrna/ExprImputation-alra.R +0 -0
  138. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/scrna/ExprImputation-rmagic.R +0 -0
  139. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/scrna/ExprImputation-scimpute.R +0 -0
  140. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/scrna/ExprImputation.R +0 -0
  141. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/scrna/MarkersFinder.R +0 -0
  142. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/scrna/MetaMarkers.R +0 -0
  143. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/scrna/ModuleScoreCalculator.R +0 -0
  144. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/scrna/RadarPlots.R +0 -0
  145. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/scrna/SCImpute.R +0 -0
  146. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/scrna/ScFGSEA.R +0 -0
  147. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/scrna/Seurat2AnnData.R +0 -0
  148. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/scrna/SeuratClusterStats-dimplots.R +0 -0
  149. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/scrna/SeuratClusterStats-features.R +0 -0
  150. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/scrna/SeuratClusterStats-hists.R +0 -0
  151. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/scrna/SeuratClusterStats-ngenes.R +0 -0
  152. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/scrna/SeuratClusterStats.R +0 -0
  153. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/scrna/SeuratClustering.R +0 -0
  154. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/scrna/SeuratFilter.R +0 -0
  155. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/scrna/SeuratLoading.R +0 -0
  156. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/scrna/SeuratMetadataMutater.R +0 -0
  157. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/scrna/SeuratPreparing.R +0 -0
  158. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/scrna/SeuratSplit.R +0 -0
  159. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/scrna/SeuratSubClustering.R +0 -0
  160. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/scrna/SeuratSubset.R +0 -0
  161. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/scrna/SeuratTo10X.R +0 -0
  162. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/scrna/Subset10X.R +0 -0
  163. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/scrna/TopExpressingGenes.R +0 -0
  164. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/scrna/celltypist-wrapper.py +0 -0
  165. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/scrna/sctype.R +0 -0
  166. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/scrna_metabolic_landscape/MetabolicFeatures.R +0 -0
  167. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/scrna_metabolic_landscape/MetabolicFeaturesIntraSubset.R +0 -0
  168. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/scrna_metabolic_landscape/MetabolicPathwayActivity.R +0 -0
  169. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/scrna_metabolic_landscape/MetabolicPathwayHeterogeneity.R +0 -0
  170. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/snp/MatrixEQTL.R +0 -0
  171. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/snp/PlinkSimulation.py +0 -0
  172. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/stats/ChowTest.R +0 -0
  173. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/stats/DiffCoexpr.R +0 -0
  174. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/stats/LiquidAssoc.R +0 -0
  175. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/stats/MetaPvalue.R +0 -0
  176. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/tcgamaf/Maf2Vcf.py +0 -0
  177. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/tcgamaf/MafAddChr.py +0 -0
  178. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/tcgamaf/maf2vcf.pl +0 -0
  179. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/tcr/Attach2Seurat.R +0 -0
  180. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/tcr/CDR3AAPhyschem.R +0 -0
  181. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/tcr/CloneResidency.R +0 -0
  182. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/tcr/CloneSizeQQPlot.R +0 -0
  183. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/tcr/GIANA/GIANA.py +0 -0
  184. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/tcr/GIANA/GIANA4.py +0 -0
  185. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/tcr/GIANA/Imgt_Human_TRBV.fasta +0 -0
  186. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/tcr/GIANA/query.py +0 -0
  187. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/tcr/Immunarch-basic.R +0 -0
  188. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/tcr/Immunarch-clonality.R +0 -0
  189. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/tcr/Immunarch-diversity.R +0 -0
  190. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/tcr/Immunarch-geneusage.R +0 -0
  191. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/tcr/Immunarch-kmer.R +0 -0
  192. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/tcr/Immunarch-overlap.R +0 -0
  193. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/tcr/Immunarch-spectratyping.R +0 -0
  194. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/tcr/Immunarch-tracking.R +0 -0
  195. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/tcr/Immunarch-vjjunc.R +0 -0
  196. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/tcr/Immunarch.R +0 -0
  197. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/tcr/Immunarch2VDJtools.R +0 -0
  198. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/tcr/ImmunarchFilter.R +0 -0
  199. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/tcr/ImmunarchLoading.R +0 -0
  200. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/tcr/ImmunarchSplitIdents.R +0 -0
  201. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/tcr/SampleDiversity.R +0 -0
  202. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/tcr/TCRClustering.R +0 -0
  203. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/tcr/TCRDock.py +0 -0
  204. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/tcr/TESSA.R +0 -0
  205. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/tcr/TESSA_source/Atchley_factors.csv +0 -0
  206. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/tcr/TESSA_source/BriseisEncoder.py +0 -0
  207. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/tcr/TESSA_source/MCMC_control.R +0 -0
  208. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/tcr/TESSA_source/TrainedEncoder.h5 +0 -0
  209. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/tcr/TESSA_source/fixed_b.csv +0 -0
  210. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/tcr/TESSA_source/initialization.R +0 -0
  211. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/tcr/TESSA_source/post_analysis.R +0 -0
  212. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/tcr/TESSA_source/real_data.R +0 -0
  213. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/tcr/TESSA_source/update.R +0 -0
  214. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/tcr/TESSA_source/utility.R +0 -0
  215. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/tcr/VJUsage.R +0 -0
  216. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/tcr/immunarch-patched.R +0 -0
  217. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/tcr/vdjtools-patch.sh +0 -0
  218. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/vcf/TruvariBench.sh +0 -0
  219. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/vcf/TruvariBenchSummary.R +0 -0
  220. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/vcf/TruvariConsistency.R +0 -0
  221. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/vcf/Vcf2Bed.py +0 -0
  222. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/vcf/VcfAnno.py +0 -0
  223. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/vcf/VcfDownSample.sh +0 -0
  224. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/vcf/VcfFilter.py +0 -0
  225. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/vcf/VcfFix.py +0 -0
  226. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/vcf/VcfFix_utils.py +0 -0
  227. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/vcf/VcfIndex.py +0 -0
  228. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/vcf/VcfIntersect.py +0 -0
  229. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/vcf/VcfLiftOver.sh +0 -0
  230. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/vcf/VcfSplitSamples.py +0 -0
  231. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/web/Download.py +0 -0
  232. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/scripts/web/DownloadList.py +0 -0
  233. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/utils/__init__.py +0 -0
  234. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/utils/caching.R +0 -0
  235. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/utils/common_docstrs.py +0 -0
  236. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/utils/gene.R +0 -0
  237. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/utils/gene.py +0 -0
  238. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/utils/gsea.R +0 -0
  239. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/utils/io.R +0 -0
  240. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/utils/misc.R +0 -0
  241. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/utils/misc.py +0 -0
  242. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/utils/mutate_helpers.R +0 -0
  243. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/utils/plot.R +0 -0
  244. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/utils/reference.py +0 -0
  245. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/utils/rnaseq.R +0 -0
  246. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/utils/single_cell.R +0 -0
  247. {biopipen-0.27.7 → biopipen-0.27.9}/biopipen/utils/vcf.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: biopipen
3
- Version: 0.27.7
3
+ Version: 0.27.9
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.27.9"
@@ -1769,13 +1769,18 @@ class SeuratMap2Ref(Proc):
1769
1769
  sobjfile: The seurat object
1770
1770
 
1771
1771
  Output:
1772
- outfile: The rds file of seurat object with cell type annotated
1772
+ outfile: The rds file of seurat object with cell type annotated.
1773
+ Note that the reduction name will be `ref.umap` for the mapping.
1774
+ To visualize the mapping, you should use `ref.umap` as the reduction name.
1773
1775
 
1774
1776
  Envs:
1775
1777
  ncores (type=int;order=-100): Number of cores to use.
1776
- Used in `future::plan(strategy = "multicore", workers = <ncores>)`
1778
+ When `split_by` is used, this will be the number of cores for each object to map to the reference.
1779
+ When `split_by` is not used, this is used in `future::plan(strategy = "multicore", workers = <ncores>)`
1777
1780
  to parallelize some Seurat procedures.
1778
- See also: <https://satijalab.org/seurat/articles/future_vignette.html>
1781
+ See also: <https://satijalab.org/seurat/archive/v3.0/future_vignette.html>
1782
+ mutaters (type=json): The mutaters to mutate the metadata.
1783
+ This is helpful when we want to create new columns for `split_by`.
1779
1784
  use: A column name of metadata from the reference
1780
1785
  (e.g. `celltype.l1`, `celltype.l2`) to transfer to the query as the
1781
1786
  cell types (ident) for downstream analysis. This field is required.
@@ -1787,16 +1792,29 @@ class SeuratMap2Ref(Proc):
1787
1792
  `Seurat::LoadH5Seurat()`.
1788
1793
  The file type is determined by the extension. `.rds` or `.RDS` for
1789
1794
  RDS file, `.h5seurat` or `.h5` for h5seurat file.
1795
+ refnorm (choice): Normalization method the reference used. The same method will be used for the query.
1796
+ - NormalizeData: Using [`NormalizeData`](https://satijalab.org/seurat/reference/normalizedata).
1797
+ - SCTransform: Using [`SCTransform`](https://satijalab.org/seurat/reference/sctransform).
1798
+ - auto: Automatically detect the normalization method.
1799
+ If the default assay of reference is `SCT`, then `SCTransform` will be used.
1800
+ split_by: The column name in metadata to split the query into multiple objects.
1801
+ This helps when the original query is too large to process.
1790
1802
  SCTransform (ns): Arguments for [`SCTransform()`](https://satijalab.org/seurat/reference/sctransform)
1791
1803
  - do-correct-umi (flag): Place corrected UMI matrix in assay counts layer?
1792
1804
  - do-scale (flag): Whether to scale residuals to have unit variance?
1793
1805
  - do-center (flag): Whether to center residuals to have mean zero?
1794
1806
  - <more>: See <https://satijalab.org/seurat/reference/sctransform>.
1795
1807
  Note that the hyphen (`-`) will be transformed into `.` for the keys.
1808
+ NormalizeData (ns): Arguments for [`NormalizeData()`](https://satijalab.org/seurat/reference/normalizedata)
1809
+ - normalization-method: Normalization method.
1810
+ - <more>: See <https://satijalab.org/seurat/reference/normalizedata>.
1811
+ Note that the hyphen (`-`) will be transformed into `.` for the keys.
1796
1812
  FindTransferAnchors (ns): Arguments for [`FindTransferAnchors()`](https://satijalab.org/seurat/reference/findtransferanchors)
1797
1813
  - normalization-method (choice): Name of normalization method used.
1798
1814
  - LogNormalize: Log-normalize the data matrix
1799
1815
  - SCT: Scale data using the SCTransform method
1816
+ - auto: Automatically detect the normalization method.
1817
+ See `envs.refnorm`.
1800
1818
  - reference-reduction: Name of dimensional reduction to use from the reference if running the pcaproject workflow.
1801
1819
  Optionally enables reuse of precomputed reference dimensional reduction.
1802
1820
  - <more>: See <https://satijalab.org/seurat/reference/findtransferanchors>.
@@ -1822,14 +1840,19 @@ class SeuratMap2Ref(Proc):
1822
1840
  "ncores": config.misc.ncores,
1823
1841
  "use": None,
1824
1842
  "ident": "seurat_clusters",
1843
+ "mutaters": {},
1825
1844
  "ref": None,
1845
+ "refnorm": "auto",
1846
+ "split_by": None,
1826
1847
  "SCTransform": {
1827
1848
  "do-correct-umi": False,
1828
1849
  "do-scale": False,
1829
1850
  "do-center": True,
1830
1851
  },
1852
+ "NormalizeData": {
1853
+ "normalization-method": "LogNormalize",
1854
+ },
1831
1855
  "FindTransferAnchors": {
1832
- "normalization-method": "SCT",
1833
1856
  "reference-reduction": "spca",
1834
1857
  },
1835
1858
  "MapQuery": {
@@ -1310,6 +1310,10 @@ class TCRClusterStats(Proc):
1310
1310
  numbers on the heatmap.
1311
1311
  - heatmap_meta (list): The columns of metadata to show on the
1312
1312
  heatmap.
1313
+ - cluster_rows (flag): Whether to cluster the rows on the heatmap.
1314
+ - sample_order: The order of the samples on the heatmap.
1315
+ Either a string separated by `,` or a list of sample names.
1316
+ This only works for columns if `cluster_rows` is `True`.
1313
1317
  - grouping: The groups to investigate the shared clusters.
1314
1318
  If specified, venn diagrams will be drawn instead of heatmaps.
1315
1319
  In such case, `numbers_on_heatmap` and `heatmap_meta` will be
@@ -1373,6 +1377,9 @@ class TCRClusterStats(Proc):
1373
1377
  "shared_clusters": {
1374
1378
  "numbers_on_heatmap": True,
1375
1379
  "heatmap_meta": [],
1380
+ "cluster_rows": True,
1381
+ "sample_order": None,
1382
+ "cluster_rows": True,
1376
1383
  "grouping": None,
1377
1384
  "devpars": {"width": 1000, "height": 1000, "res": 100},
1378
1385
  "cases": {},
@@ -38,7 +38,7 @@ do_one_stats = function(name) {
38
38
  df_cells = df_cells %>% filter(!!rlang::parse_expr(case$subset))
39
39
  }
40
40
 
41
- select_cols = c(case$ident, case$group.by, case$split.by)
41
+ select_cols = unique(c(case$ident, case$group.by, case$split.by))
42
42
  if (!is.null(case$split.by)) {
43
43
  plot_df = do_call(rbind, lapply(group_split(
44
44
  df_cells %>% select(all_of(select_cols)),
@@ -0,0 +1,302 @@
1
+ source("{{biopipen_dir}}/utils/misc.R")
2
+
3
+ library(parallel)
4
+ library(Seurat)
5
+ library(SeuratDisk)
6
+ library(rlang)
7
+ library(dplyr)
8
+
9
+ set.seed(8525)
10
+
11
+ sobjfile = {{in.sobjfile | r}}
12
+ outfile = {{out.outfile | r}}
13
+ use = {{envs.use | r}}
14
+ ident = {{envs.ident | r}}
15
+ ref = {{envs.ref | r}}
16
+ refnorm = {{envs.refnorm | r}}
17
+ ncores = {{envs.ncores | r}}
18
+ split_by = {{envs.split_by | r}}
19
+ mutaters = {{envs.mutaters | r}}
20
+ sctransform_args = {{envs.SCTransform | r: todot="-"}}
21
+ normalizedata_args = {{envs.NormalizeData | r: todot="-"}}
22
+ findtransferanchors_args = {{envs.FindTransferAnchors | r: todot="-"}}
23
+ mappingscore_args = {{envs.MappingScore | r: todot="-"}}
24
+ mapquery_args = {{envs.MapQuery | r: todot="-"}}
25
+
26
+ # See if we have a reference
27
+ if (is.null(ref)) {
28
+ stop("No reference provided (envs.ref)")
29
+ }
30
+
31
+ if (is.null(use)) {
32
+ stop("No use provided (envs.use), don't know which column to transfer as cluster")
33
+ }
34
+
35
+ if (is.null(mapquery_args$refdata) || length(mapquery_args$refdata) == 0) {
36
+ mapquery_args$refdata = list()
37
+ }
38
+
39
+ mapquery_args$refdata[[use]] = use
40
+
41
+ outdir = dirname(outfile)
42
+ if (is.null(split_by)) {
43
+ options(future.globals.maxSize = 80000 * 1024^2)
44
+ future::plan(strategy = "multicore", workers = ncores)
45
+ }
46
+
47
+ .expand_dims = function(args, name = "dims") {
48
+ # Expand dims from 30 to 1:30
49
+ if (is.numeric(args[[name]]) && length(args[[name]] == 1)) {
50
+ args[[name]] = 1:args[[name]]
51
+ }
52
+ args
53
+ }
54
+ findtransferanchors_args = .expand_dims(findtransferanchors_args)
55
+
56
+ # Load reference
57
+ log_info("- Loading reference")
58
+ if (endsWith(ref, ".rds") || endsWith(ref, ".RDS")) {
59
+ reference = readRDS(ref)
60
+ } else if (endsWith(ref, ".h5ad") || endsWith(ref, ".H5AD")) {
61
+ reference = ReadH5AD(ref)
62
+ } else {
63
+ reference = LoadH5Seurat(ref)
64
+ }
65
+
66
+ if (refnorm == "auto" && DefaultAssay(reference) == "SCT") {
67
+ refnorm = "SCTransform"
68
+ }
69
+ log_info(" Normalization method used: {refnorm}")
70
+ if (refnorm == "SCTransform") {
71
+ findtransferanchors_args$normalization.method = "SCT"
72
+ } else if (refnorm == "NormalizeData") {
73
+ findtransferanchors_args$normalization.method = "LogNormalize"
74
+ } else {
75
+ stop("Unknown normalization method: {refnorm}")
76
+ }
77
+
78
+ # Load Seurat object
79
+ log_info("- Loading Seurat object")
80
+ sobj = readRDS(sobjfile)
81
+
82
+ if (!is.null(mutaters) && length(mutaters) > 0) {
83
+ log_info("- Applying mutaters")
84
+ sobj@meta.data <- sobj@meta.data %>% mutate(!!!lapply(mutaters, parse_expr))
85
+ }
86
+
87
+ if (!is.null(split_by)) {
88
+ # check if each split has more than 100 cells
89
+ cellno = table(sobj@meta.data[[split_by]])
90
+ cellno = cellno[cellno < 100]
91
+ if (length(cellno) > 0) {
92
+ # stop and print the splits with # cells
93
+ stop(paste0(
94
+ "The following splits have less than 100 cells: \n",
95
+ paste0("- ", names(cellno), ": ", cellno, collapse = "\n"),
96
+ "\n\n",
97
+ "You can use `envs.mutaters` to merge these splits and use `newsplit` as `envs.split_by`: \n",
98
+ "> mutaters = {\n",
99
+ "> newsplit = \"if_else(oldsplit %in% c('split1', 'split2'), 'mergedsplit', oldsplit)\"\n",
100
+ "> }\n"
101
+ ))
102
+ }
103
+ sobj = SplitObject(sobj, split.by = split_by)
104
+ }
105
+
106
+ # Normalize data
107
+ log_info("- Normalizing data")
108
+ if (refnorm == "SCTransform") {
109
+ log_info(" Using SCTransform normalization")
110
+ sctransform_args$residual.features = rownames(x = reference)
111
+ if (is.null(split_by)) {
112
+ sctransform_args$object = sobj
113
+ query = do_call(SCTransform, sctransform_args)
114
+ } else {
115
+ query = mclapply(
116
+ X = sobj,
117
+ FUN = function(x) {
118
+ sctransform_args$object = x
119
+ do_call(SCTransform, sctransform_args)
120
+ },
121
+ mc.cores = ncores
122
+ )
123
+ if (any(unlist(lapply(query, class)) == "try-error")) {
124
+ stop(paste0("\nmclapply (SCTransform) error:", query))
125
+ }
126
+ }
127
+ } else {
128
+ log_info(" Using NormalizeData normalization")
129
+ if (is.null(split_by)) {
130
+ normalizedata_args$object = sobj
131
+ query = do_call(NormalizeData, normalizedata_args)
132
+ } else {
133
+ query = mclapply(
134
+ X = sobj,
135
+ FUN = function(x) {
136
+ normalizedata_args$object = x
137
+ do_call(NormalizeData, normalizedata_args)
138
+ },
139
+ mc.cores = ncores
140
+ )
141
+ if (any(unlist(lapply(query, class)) == "try-error")) {
142
+ stop(paste0("\nmclapply (NormalizeData) error:", query))
143
+ }
144
+ }
145
+ }
146
+
147
+ # Find anchors between query and reference
148
+ log_info("- Finding anchors")
149
+ findtransferanchors_args$reference = reference
150
+ if (is.null(split_by)) {
151
+ findtransferanchors_args$query = query
152
+ anchors = do_call(FindTransferAnchors, findtransferanchors_args)
153
+ } else {
154
+ anchors = mclapply(
155
+ X = query,
156
+ FUN = function(x) {
157
+ findtransferanchors_args$query = x
158
+ do_call(FindTransferAnchors, findtransferanchors_args)
159
+ },
160
+ mc.cores = ncores
161
+ )
162
+ if (any(unlist(lapply(anchors, class)) == "try-error")) {
163
+ stop(paste0("\nmclapply (FindTransferAnchors) error:", anchors))
164
+ }
165
+ }
166
+
167
+ # Map query to reference
168
+ log_info("- Mapping query to reference")
169
+ mapquery_args$reference = reference
170
+ if (is.null(split_by)) {
171
+ mapquery_args$query = query
172
+ mapquery_args$anchorset = anchors
173
+ query = do_call(MapQuery, mapquery_args)
174
+ } else {
175
+ query = mclapply(
176
+ X = seq_along(query),
177
+ FUN = function(i) {
178
+ mapquery_args$query = query[[i]]
179
+ mapquery_args$anchorset = anchors[[i]]
180
+ do_call(MapQuery, mapquery_args)
181
+ },
182
+ mc.cores = ncores
183
+ )
184
+ if (any(unlist(lapply(query, class)) == "try-error")) {
185
+ stop(paste0("\nmclapply (MapQuery) error:", query))
186
+ }
187
+ }
188
+
189
+ # Calculating mapping score
190
+ log_info("- Calculating mapping score")
191
+ mappingscore_sob_msg = paste0(
192
+ "While calculating mapping score, the following error was encountered: \n",
193
+ "subscript out of bounds. \n\n",
194
+ "You may want to try a smaller `ndim` (default: 50) in `envs.MappingScore`."
195
+ )
196
+ if (is.null(split_by)) {
197
+ mappingscore_args$anchors = anchors
198
+ mappingscore = tryCatch({
199
+ do_call(MappingScore, mappingscore_args)
200
+ }, error = function(e) {
201
+ if (e$message == "subscript out of bounds") stop(mappingscore_sob_msg)
202
+ stop(e)
203
+ })
204
+ } else {
205
+ mappingscore = mclapply(
206
+ X = seq_along(query),
207
+ FUN = function(i) {
208
+ mappingscore_args$anchors = anchors[[i]]
209
+ tryCatch({
210
+ do_call(MappingScore, mappingscore_args)
211
+ }, error = function(e) {
212
+ if (e$message == "subscript out of bounds") stop(mappingscore_sob_msg)
213
+ stop(e)
214
+ })
215
+ },
216
+ mc.cores = ncores
217
+ )
218
+ if (any(unlist(lapply(mappingscore, class)) == "try-error")) {
219
+ stop(paste0("\nmclapply (MappingScore) error:", mappingscore))
220
+ }
221
+ }
222
+
223
+ # Calculate mapping score and add to metadata
224
+ log_info("- Adding mapping score to metadata")
225
+ if (is.null(split_by)) {
226
+ query = AddMetaData(
227
+ object = query,
228
+ metadata = mappingscore,
229
+ col.name = "mapping.score"
230
+ )
231
+ } else {
232
+ query = mclapply(
233
+ X = seq_along(query),
234
+ FUN = function(i) {
235
+ AddMetaData(
236
+ object = query[[i]],
237
+ metadata = mappingscore[[i]],
238
+ col.name = "mapping.score"
239
+ )
240
+ },
241
+ mc.cores = ncores
242
+ )
243
+ if (any(unlist(lapply(query, class)) == "try-error")) {
244
+ stop(paste0("\nmclapply (AddMetaData) error:", query))
245
+ }
246
+
247
+ # Combine the results
248
+ log_info("- Merging the results")
249
+ query = merge(query[[1]], query[2:length(query)], merge.dr = "ref.umap")
250
+ }
251
+
252
+ # Add the alias to the metadata for the clusters
253
+ log_info("- Adding ident to metadata and set as ident")
254
+ query@meta.data = query@meta.data %>% mutate(
255
+ !!sym(ident) := as.factor(!!parse_expr(paste0("predicted.", use)))
256
+ )
257
+ Idents(query) = ident
258
+
259
+ # Save
260
+ log_info("- Saving result ...")
261
+ saveRDS(query, file = outfile)
262
+
263
+
264
+ # ############################
265
+ # Some plots
266
+ # ############################
267
+
268
+ # # Plot the UMAP
269
+ log_info("- Plotting for transferred data ...")
270
+ ref.reduction = mapquery_args$reduction.model %||% "wnn.umap"
271
+ for (qname in names(mapquery_args$refdata)) {
272
+ rname <- mapquery_args$refdata[[qname]]
273
+
274
+ if (grepl("Array", class(reference[[rname]])) && grepl("Array", class(query[[qname]]))) {
275
+ log_warn(" Skipping transferred array: {qname} -> {rname}")
276
+ next
277
+ }
278
+
279
+ log_info(" Plotting transferred data: {qname} -> {rname}")
280
+
281
+ ref_p <- DimPlot(
282
+ object = reference,
283
+ reduction = ref.reduction,
284
+ group.by = rname,
285
+ label = TRUE,
286
+ label.size = 3,
287
+ repel = TRUE,
288
+ ) + NoLegend()
289
+
290
+ query_p <- DimPlot(
291
+ object = query,
292
+ reduction = "ref.umap",
293
+ group.by = paste0("predicted.", qname),
294
+ label = TRUE,
295
+ label.size = 3,
296
+ repel = TRUE,
297
+ ) + NoLegend()
298
+
299
+ png(file.path(outdir, paste0("UMAPs.png")), width = 1400, height = 700, res = 100)
300
+ print(ref_p | query_p)
301
+ dev.off()
302
+ }
@@ -137,6 +137,26 @@ shared_clusters = function(name) {
137
137
  anno = do_call(ComplexHeatmap::HeatmapAnnotation, anno)
138
138
  }
139
139
 
140
+ if (!is.null(case$sample_order) && length(case$sample_order) > 0) {
141
+ if (length(case$sample_order) == 1) {
142
+ case$sample_order = trimws(strsplit(case$sample_order, ",")[[1]])
143
+ }
144
+ nonexisting = setdiff(case$sample_order, samples)
145
+ if (length(nonexisting) > 0) {
146
+ stop(paste(" The following samples do not exist in `sample_order`:", paste(nonexisting, collapse=", ")))
147
+ }
148
+ plotdata = plotdata[, case$sample_order, drop=FALSE]
149
+ }
150
+
151
+ cluster_rows = case$cluster_rows && nrow(plotdata) > 2
152
+ col_samples = colnames(plotdata)
153
+ if (!cluster_rows) {
154
+ plotdata = plotdata[col_samples, ]
155
+ row_samples = col_samples
156
+ } else {
157
+ row_samples = samples
158
+ }
159
+
140
160
  # Plot heatmap
141
161
  plotHeatmap(
142
162
  plotdata,
@@ -144,12 +164,12 @@ shared_clusters = function(name) {
144
164
  name = "Shared TCR Clusters",
145
165
  col = c("#ffe1e1", "red3"),
146
166
  cluster_columns = FALSE,
147
- cluster_rows = nrow(plotdata) > 2,
167
+ cluster_rows = cluster_rows,
148
168
  top_annotation = anno,
149
169
  cell_fun = if (
150
170
  is.null(case$numbers_on_heatmap) || !case$numbers_on_heatmap
151
171
  ) NULL else function(j, i, x, y, width, height, fill) {
152
- grid.text(plotdata[samples[i], samples[j]], x, y, gp = gpar(fontsize = 10))
172
+ grid.text(row_samples[i], col_samples[j], x, y, gp = gpar(fontsize = 10))
153
173
  }
154
174
  ),
155
175
  devpars = case$devpars,
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "biopipen"
3
- version = "0.27.7"
3
+ version = "0.27.9"
4
4
  description = "Bioinformatics processes/pipelines that can be run from `pipen run`"
5
5
  authors = ["pwwang <pwwang@pwwang.com>"]
6
6
  license = "MIT"
@@ -81,7 +81,7 @@ entry_points = \
81
81
 
82
82
  setup_kwargs = {
83
83
  'name': 'biopipen',
84
- 'version': '0.27.7',
84
+ 'version': '0.27.9',
85
85
  'description': 'Bioinformatics processes/pipelines that can be run from `pipen run`',
86
86
  'long_description': 'None',
87
87
  'author': 'pwwang',
@@ -1 +0,0 @@
1
- __version__ = "0.27.7"
@@ -1,156 +0,0 @@
1
- source("{{biopipen_dir}}/utils/misc.R")
2
-
3
- library(Seurat)
4
- library(SeuratDisk)
5
- library(rlang)
6
- library(dplyr)
7
-
8
- set.seed(8525)
9
-
10
- sobjfile = {{in.sobjfile | r}}
11
- outfile = {{out.outfile | r}}
12
- use = {{envs.use | r}}
13
- ident = {{envs.ident | r}}
14
- ref = {{envs.ref | r}}
15
- ncores = {{envs.ncores | r}}
16
- sctransform_args = {{envs.SCTransform | r: todot="-"}}
17
- findtransferanchors_args = {{envs.FindTransferAnchors | r: todot="-"}}
18
- mappingscore_args = {{envs.MappingScore | r: todot="-"}}
19
- mapquery_args = {{envs.MapQuery | r: todot="-"}}
20
-
21
- # See if we have a reference
22
- if (is.null(ref)) {
23
- stop("No reference provided (envs.ref)")
24
- }
25
-
26
- if (is.null(use)) {
27
- stop("No use provided (envs.use), don't know which column to transfer as cluster")
28
- }
29
-
30
- if (is.null(mapquery_args$refdata) || length(mapquery_args$refdata) == 0) {
31
- mapquery_args$refdata = list()
32
- }
33
-
34
- mapquery_args$refdata[[use]] = use
35
-
36
- outdir = dirname(outfile)
37
- options(future.globals.maxSize = 80000 * 1024^2)
38
- plan(strategy = "multicore", workers = ncores)
39
-
40
- .expand_dims = function(args, name = "dims") {
41
- # Expand dims from 30 to 1:30
42
- if (is.numeric(args[[name]]) && length(args[[name]] == 1)) {
43
- args[[name]] = 1:args[[name]]
44
- }
45
- args
46
- }
47
- findtransferanchors_args = .expand_dims(findtransferanchors_args)
48
-
49
- # Load reference
50
- log_info("- Loading reference")
51
- if (endsWith(ref, ".rds") || endsWith(ref, ".RDS")) {
52
- reference = readRDS(ref)
53
- } else if (endsWith(ref, ".h5ad") || endsWith(ref, ".H5AD")) {
54
- reference = ReadH5AD(ref)
55
- } else {
56
- reference = LoadH5Seurat(ref)
57
- }
58
-
59
- # Load Seurat object
60
- log_info("- Loading Seurat object")
61
- sobj = readRDS(sobjfile)
62
-
63
- # Normalize data
64
- log_info("- Normalizing data")
65
- sctransform_args$object = sobj
66
- sctransform_args$residual.features = rownames(x = reference)
67
- query = do_call(SCTransform, sctransform_args)
68
-
69
- # Find anchors between query and reference
70
- log_info("- Finding anchors")
71
- findtransferanchors_args$reference = reference
72
- findtransferanchors_args$query = query
73
- anchors = do_call(FindTransferAnchors, findtransferanchors_args)
74
-
75
- # Map query to reference
76
- log_info("- Mapping query to reference")
77
- mapquery_args$reference = reference
78
- mapquery_args$query = query
79
- mapquery_args$anchorset = anchors
80
- query = do_call(MapQuery, mapquery_args)
81
-
82
- # Calculating mapping score
83
- log_info("- Calculating mapping score")
84
- mappingscore_args$anchors = anchors
85
- mappingscore = tryCatch({
86
- do_call(MappingScore, mappingscore_args)
87
- }, error = function(e) {
88
- if (e$message == "subscript out of bounds") {
89
- stop(paste0(
90
- "While calculating mapping score, the following error was encountered: \n",
91
- "subscript out of bounds. \n\n",
92
- "You may want to try a smaller `ndim` (default: 50) in `envs.MappingScore`."
93
- ))
94
- }
95
- stop(e)
96
- })
97
-
98
- # Calculate mapping score and add to metadata
99
- log_info("- Calculating mapping score")
100
- query = AddMetaData(
101
- object = query,
102
- metadata = mappingscore,
103
- col.name = "mapping.score"
104
- )
105
-
106
- # Add the alias to the metadata for the clusters
107
- log_info("- Adding ident to metadata and set as ident")
108
- query@meta.data = query@meta.data %>% mutate(
109
- !!sym(ident) := as.factor(!!parse_expr(paste0("predicted.", use)))
110
- )
111
- Idents(query) = ident
112
-
113
- # Save
114
- log_info("- Saving result ...")
115
- saveRDS(query, file = outfile)
116
-
117
-
118
- # ############################
119
- # Some plots
120
- # ############################
121
-
122
- # # Plot the UMAP
123
- log_info("- Plotting for transferred data ...")
124
- ref.reduction = mapquery_args$reduction.model %||% "wnn.umap"
125
- for (qname in names(mapquery_args$refdata)) {
126
- rname <- mapquery_args$refdata[[qname]]
127
-
128
- if (grepl("Array", class(reference[[rname]])) && grepl("Array", class(query[[qname]]))) {
129
- log_warn(" Skipping transferred array: {qname} -> {rname}")
130
- next
131
- }
132
-
133
- log_info(" Plotting transferred data: {qname} -> {rname}")
134
-
135
- ref_p <- DimPlot(
136
- object = reference,
137
- reduction = ref.reduction,
138
- group.by = rname,
139
- label = TRUE,
140
- label.size = 3,
141
- repel = TRUE,
142
- ) + NoLegend()
143
-
144
- query_p <- DimPlot(
145
- object = query,
146
- reduction = "ref.umap",
147
- group.by = paste0("predicted.", qname),
148
- label = TRUE,
149
- label.size = 3,
150
- repel = TRUE,
151
- ) + NoLegend()
152
-
153
- png(file.path(outdir, paste0("UMAPs.png")), width = 1400, height = 700, res = 100)
154
- print(ref_p | query_p)
155
- dev.off()
156
- }
File without changes
File without changes
File without changes