biopipen 0.27.6__tar.gz → 0.27.8__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 (248) hide show
  1. {biopipen-0.27.6 → biopipen-0.27.8}/PKG-INFO +1 -1
  2. biopipen-0.27.8/biopipen/__init__.py +1 -0
  3. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/core/filters.py +5 -4
  4. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/ns/scrna.py +30 -7
  5. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/ns/scrna_metabolic_landscape.py +4 -4
  6. biopipen-0.27.8/biopipen/scripts/scrna/ExprImputation.R +7 -0
  7. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/scrna/SeuratClusterStats-stats.R +1 -1
  8. biopipen-0.27.8/biopipen/scripts/scrna/SeuratMap2Ref.R +302 -0
  9. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/scrna_metabolic_landscape/MetabolicFeatures.R +11 -1
  10. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/scrna_metabolic_landscape/MetabolicFeaturesIntraSubset.R +9 -5
  11. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/utils/gsea.R +41 -10
  12. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/utils/misc.R +1 -0
  13. {biopipen-0.27.6 → biopipen-0.27.8}/pyproject.toml +1 -1
  14. {biopipen-0.27.6 → biopipen-0.27.8}/setup.py +1 -1
  15. biopipen-0.27.6/biopipen/__init__.py +0 -1
  16. biopipen-0.27.6/biopipen/scripts/scrna/ExprImpution.R +0 -7
  17. biopipen-0.27.6/biopipen/scripts/scrna/SeuratMap2Ref.R +0 -156
  18. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/core/__init__.py +0 -0
  19. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/core/config.py +0 -0
  20. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/core/config.toml +0 -0
  21. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/core/defaults.py +0 -0
  22. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/core/proc.py +0 -0
  23. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/core/testing.py +0 -0
  24. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/ns/__init__.py +0 -0
  25. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/ns/bam.py +0 -0
  26. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/ns/bcftools.py +0 -0
  27. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/ns/bed.py +0 -0
  28. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/ns/cellranger.py +0 -0
  29. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/ns/cellranger_pipeline.py +0 -0
  30. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/ns/cnv.py +0 -0
  31. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/ns/cnvkit.py +0 -0
  32. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/ns/cnvkit_pipeline.py +0 -0
  33. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/ns/delim.py +0 -0
  34. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/ns/gene.py +0 -0
  35. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/ns/gsea.py +0 -0
  36. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/ns/misc.py +0 -0
  37. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/ns/plot.py +0 -0
  38. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/ns/rnaseq.py +0 -0
  39. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/ns/snp.py +0 -0
  40. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/ns/stats.py +0 -0
  41. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/ns/tcgamaf.py +0 -0
  42. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/ns/tcr.py +0 -0
  43. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/ns/vcf.py +0 -0
  44. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/ns/web.py +0 -0
  45. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/reports/bam/CNAClinic.svelte +0 -0
  46. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/reports/bam/CNVpytor.svelte +0 -0
  47. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/reports/bam/ControlFREEC.svelte +0 -0
  48. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/reports/cellranger/CellRangerCount.svelte +0 -0
  49. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/reports/cellranger/CellRangerSummary.svelte +0 -0
  50. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/reports/cellranger/CellRangerVdj.svelte +0 -0
  51. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/reports/cnv/AneuploidyScore.svelte +0 -0
  52. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/reports/cnv/AneuploidyScoreSummary.svelte +0 -0
  53. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/reports/cnv/TMADScoreSummary.svelte +0 -0
  54. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/reports/cnvkit/CNVkitDiagram.svelte +0 -0
  55. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/reports/cnvkit/CNVkitHeatmap.svelte +0 -0
  56. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/reports/cnvkit/CNVkitScatter.svelte +0 -0
  57. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/reports/delim/SampleInfo.svelte +0 -0
  58. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/reports/gsea/FGSEA.svelte +0 -0
  59. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/reports/gsea/GSEA.svelte +0 -0
  60. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/reports/scrna/CellsDistribution.svelte +0 -0
  61. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/reports/scrna/DimPlots.svelte +0 -0
  62. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/reports/scrna/MarkersFinder.svelte +0 -0
  63. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/reports/scrna/MetaMarkers.svelte +0 -0
  64. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/reports/scrna/RadarPlots.svelte +0 -0
  65. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/reports/scrna/ScFGSEA.svelte +0 -0
  66. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/reports/scrna/SeuratClusterStats.svelte +0 -0
  67. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/reports/scrna/SeuratMap2Ref.svelte +0 -0
  68. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/reports/scrna/SeuratPreparing.svelte +0 -0
  69. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/reports/scrna/TopExpressingGenes.svelte +0 -0
  70. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/reports/scrna_metabolic_landscape/MetabolicFeatures.svelte +0 -0
  71. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/reports/scrna_metabolic_landscape/MetabolicFeaturesIntraSubset.svelte +0 -0
  72. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/reports/scrna_metabolic_landscape/MetabolicPathwayActivity.svelte +0 -0
  73. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/reports/scrna_metabolic_landscape/MetabolicPathwayHeterogeneity.svelte +0 -0
  74. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/reports/tcr/CDR3AAPhyschem.svelte +0 -0
  75. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/reports/tcr/CloneResidency.svelte +0 -0
  76. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/reports/tcr/Immunarch.svelte +0 -0
  77. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/reports/tcr/SampleDiversity.svelte +0 -0
  78. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/reports/tcr/TCRClusterStats.svelte +0 -0
  79. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/reports/tcr/TESSA.svelte +0 -0
  80. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/reports/tcr/VJUsage.svelte +0 -0
  81. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/reports/utils/gsea.liq +0 -0
  82. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/reports/utils/misc.liq +0 -0
  83. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/reports/vcf/TruvariBenchSummary.svelte +0 -0
  84. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/reports/vcf/TruvariConsistency.svelte +0 -0
  85. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/bam/BamMerge.py +0 -0
  86. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/bam/BamSplitChroms.py +0 -0
  87. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/bam/CNAClinic.R +0 -0
  88. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/bam/CNVpytor.py +0 -0
  89. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/bam/ControlFREEC.py +0 -0
  90. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/bcftools/BcftoolsAnnotate.py +0 -0
  91. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/bcftools/BcftoolsFilter.py +0 -0
  92. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/bcftools/BcftoolsSort.py +0 -0
  93. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/bed/Bed2Vcf.py +0 -0
  94. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/bed/BedConsensus.py +0 -0
  95. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/bed/BedLiftOver.sh +0 -0
  96. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/bed/BedtoolsMerge.py +0 -0
  97. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/cellranger/CellRangerCount.py +0 -0
  98. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/cellranger/CellRangerSummary.R +0 -0
  99. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/cellranger/CellRangerVdj.py +0 -0
  100. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/cnv/AneuploidyScore.R +0 -0
  101. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/cnv/AneuploidyScoreSummary.R +0 -0
  102. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/cnv/TMADScore.R +0 -0
  103. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/cnv/TMADScoreSummary.R +0 -0
  104. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/cnvkit/CNVkitAccess.py +0 -0
  105. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/cnvkit/CNVkitAutobin.py +0 -0
  106. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/cnvkit/CNVkitBatch.py +0 -0
  107. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/cnvkit/CNVkitCall.py +0 -0
  108. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/cnvkit/CNVkitCoverage.py +0 -0
  109. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/cnvkit/CNVkitDiagram.py +0 -0
  110. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/cnvkit/CNVkitFix.py +0 -0
  111. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/cnvkit/CNVkitGuessBaits.py +0 -0
  112. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/cnvkit/CNVkitHeatmap.py +0 -0
  113. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/cnvkit/CNVkitReference.py +0 -0
  114. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/cnvkit/CNVkitScatter.py +0 -0
  115. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/cnvkit/CNVkitSegment.py +0 -0
  116. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/cnvkit/guess_baits.py +0 -0
  117. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/delim/RowsBinder.R +0 -0
  118. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/delim/SampleInfo.R +0 -0
  119. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/gene/GeneNameConversion.py +0 -0
  120. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/gsea/Enrichr.R +0 -0
  121. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/gsea/FGSEA.R +0 -0
  122. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/gsea/GSEA.R +0 -0
  123. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/gsea/PreRank.R +0 -0
  124. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/misc/Config2File.py +0 -0
  125. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/misc/Str2File.py +0 -0
  126. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/plot/Heatmap.R +0 -0
  127. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/plot/ROC.R +0 -0
  128. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/plot/VennDiagram.R +0 -0
  129. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/rnaseq/Simulation-ESCO.R +0 -0
  130. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/rnaseq/Simulation-RUVcorr.R +0 -0
  131. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/rnaseq/Simulation.R +0 -0
  132. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/rnaseq/UnitConversion.R +0 -0
  133. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/scrna/AnnData2Seurat.R +0 -0
  134. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/scrna/CellTypeAnnotation-celltypist.R +0 -0
  135. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/scrna/CellTypeAnnotation-direct.R +0 -0
  136. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/scrna/CellTypeAnnotation-hitype.R +0 -0
  137. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/scrna/CellTypeAnnotation-sccatch.R +0 -0
  138. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/scrna/CellTypeAnnotation-sctype.R +0 -0
  139. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/scrna/CellTypeAnnotation.R +0 -0
  140. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/scrna/CellsDistribution.R +0 -0
  141. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/scrna/DimPlots.R +0 -0
  142. /biopipen-0.27.6/biopipen/scripts/scrna/ExprImpution-alra.R → /biopipen-0.27.8/biopipen/scripts/scrna/ExprImputation-alra.R +0 -0
  143. /biopipen-0.27.6/biopipen/scripts/scrna/ExprImpution-rmagic.R → /biopipen-0.27.8/biopipen/scripts/scrna/ExprImputation-rmagic.R +0 -0
  144. /biopipen-0.27.6/biopipen/scripts/scrna/ExprImpution-scimpute.R → /biopipen-0.27.8/biopipen/scripts/scrna/ExprImputation-scimpute.R +0 -0
  145. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/scrna/MarkersFinder.R +0 -0
  146. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/scrna/MetaMarkers.R +0 -0
  147. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/scrna/ModuleScoreCalculator.R +0 -0
  148. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/scrna/RadarPlots.R +0 -0
  149. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/scrna/SCImpute.R +0 -0
  150. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/scrna/ScFGSEA.R +0 -0
  151. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/scrna/Seurat2AnnData.R +0 -0
  152. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/scrna/SeuratClusterStats-dimplots.R +0 -0
  153. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/scrna/SeuratClusterStats-features.R +0 -0
  154. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/scrna/SeuratClusterStats-hists.R +0 -0
  155. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/scrna/SeuratClusterStats-ngenes.R +0 -0
  156. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/scrna/SeuratClusterStats.R +0 -0
  157. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/scrna/SeuratClustering.R +0 -0
  158. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/scrna/SeuratFilter.R +0 -0
  159. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/scrna/SeuratLoading.R +0 -0
  160. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/scrna/SeuratMetadataMutater.R +0 -0
  161. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/scrna/SeuratPreparing.R +0 -0
  162. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/scrna/SeuratSplit.R +0 -0
  163. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/scrna/SeuratSubClustering.R +0 -0
  164. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/scrna/SeuratSubset.R +0 -0
  165. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/scrna/SeuratTo10X.R +0 -0
  166. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/scrna/Subset10X.R +0 -0
  167. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/scrna/TopExpressingGenes.R +0 -0
  168. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/scrna/celltypist-wrapper.py +0 -0
  169. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/scrna/sctype.R +0 -0
  170. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/scrna_metabolic_landscape/MetabolicPathwayActivity.R +0 -0
  171. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/scrna_metabolic_landscape/MetabolicPathwayHeterogeneity.R +0 -0
  172. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/snp/MatrixEQTL.R +0 -0
  173. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/snp/PlinkSimulation.py +0 -0
  174. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/stats/ChowTest.R +0 -0
  175. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/stats/DiffCoexpr.R +0 -0
  176. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/stats/LiquidAssoc.R +0 -0
  177. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/stats/MetaPvalue.R +0 -0
  178. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/tcgamaf/Maf2Vcf.py +0 -0
  179. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/tcgamaf/MafAddChr.py +0 -0
  180. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/tcgamaf/maf2vcf.pl +0 -0
  181. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/tcr/Attach2Seurat.R +0 -0
  182. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/tcr/CDR3AAPhyschem.R +0 -0
  183. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/tcr/CloneResidency.R +0 -0
  184. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/tcr/CloneSizeQQPlot.R +0 -0
  185. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/tcr/GIANA/GIANA.py +0 -0
  186. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/tcr/GIANA/GIANA4.py +0 -0
  187. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/tcr/GIANA/Imgt_Human_TRBV.fasta +0 -0
  188. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/tcr/GIANA/query.py +0 -0
  189. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/tcr/Immunarch-basic.R +0 -0
  190. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/tcr/Immunarch-clonality.R +0 -0
  191. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/tcr/Immunarch-diversity.R +0 -0
  192. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/tcr/Immunarch-geneusage.R +0 -0
  193. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/tcr/Immunarch-kmer.R +0 -0
  194. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/tcr/Immunarch-overlap.R +0 -0
  195. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/tcr/Immunarch-spectratyping.R +0 -0
  196. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/tcr/Immunarch-tracking.R +0 -0
  197. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/tcr/Immunarch-vjjunc.R +0 -0
  198. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/tcr/Immunarch.R +0 -0
  199. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/tcr/Immunarch2VDJtools.R +0 -0
  200. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/tcr/ImmunarchFilter.R +0 -0
  201. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/tcr/ImmunarchLoading.R +0 -0
  202. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/tcr/ImmunarchSplitIdents.R +0 -0
  203. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/tcr/SampleDiversity.R +0 -0
  204. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/tcr/TCRClusterStats.R +0 -0
  205. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/tcr/TCRClustering.R +0 -0
  206. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/tcr/TCRDock.py +0 -0
  207. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/tcr/TESSA.R +0 -0
  208. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/tcr/TESSA_source/Atchley_factors.csv +0 -0
  209. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/tcr/TESSA_source/BriseisEncoder.py +0 -0
  210. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/tcr/TESSA_source/MCMC_control.R +0 -0
  211. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/tcr/TESSA_source/TrainedEncoder.h5 +0 -0
  212. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/tcr/TESSA_source/fixed_b.csv +0 -0
  213. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/tcr/TESSA_source/initialization.R +0 -0
  214. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/tcr/TESSA_source/post_analysis.R +0 -0
  215. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/tcr/TESSA_source/real_data.R +0 -0
  216. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/tcr/TESSA_source/update.R +0 -0
  217. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/tcr/TESSA_source/utility.R +0 -0
  218. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/tcr/VJUsage.R +0 -0
  219. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/tcr/immunarch-patched.R +0 -0
  220. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/tcr/vdjtools-patch.sh +0 -0
  221. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/vcf/TruvariBench.sh +0 -0
  222. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/vcf/TruvariBenchSummary.R +0 -0
  223. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/vcf/TruvariConsistency.R +0 -0
  224. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/vcf/Vcf2Bed.py +0 -0
  225. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/vcf/VcfAnno.py +0 -0
  226. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/vcf/VcfDownSample.sh +0 -0
  227. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/vcf/VcfFilter.py +0 -0
  228. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/vcf/VcfFix.py +0 -0
  229. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/vcf/VcfFix_utils.py +0 -0
  230. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/vcf/VcfIndex.py +0 -0
  231. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/vcf/VcfIntersect.py +0 -0
  232. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/vcf/VcfLiftOver.sh +0 -0
  233. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/vcf/VcfSplitSamples.py +0 -0
  234. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/web/Download.py +0 -0
  235. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/scripts/web/DownloadList.py +0 -0
  236. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/utils/__init__.py +0 -0
  237. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/utils/caching.R +0 -0
  238. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/utils/common_docstrs.py +0 -0
  239. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/utils/gene.R +0 -0
  240. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/utils/gene.py +0 -0
  241. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/utils/io.R +0 -0
  242. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/utils/misc.py +0 -0
  243. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/utils/mutate_helpers.R +0 -0
  244. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/utils/plot.R +0 -0
  245. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/utils/reference.py +0 -0
  246. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/utils/rnaseq.R +0 -0
  247. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/utils/single_cell.R +0 -0
  248. {biopipen-0.27.6 → biopipen-0.27.8}/biopipen/utils/vcf.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: biopipen
3
- Version: 0.27.6
3
+ Version: 0.27.8
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.8"
@@ -235,8 +235,8 @@ def _render_fgsea(
235
235
  with Path(cont["dir"]).joinpath("fgsea.txt").open() as f:
236
236
  next(f) # skip header
237
237
  for line in f:
238
- pathway, _ = line.split("\t", 1)
239
- pathways.append(pathway)
238
+ items = line.strip().split("\t")
239
+ pathways.append((items[0], items[-1]))
240
240
  if len(pathways) >= n_pathways:
241
241
  break
242
242
 
@@ -263,6 +263,7 @@ def _render_fgsea(
263
263
  {
264
264
  "kind": "table",
265
265
  "src": str(Path(cont["dir"]).joinpath("fgsea.txt")),
266
+ "data": {"excluded": {"slug"}},
266
267
  }
267
268
  ],
268
269
  },
@@ -274,10 +275,10 @@ def _render_fgsea(
274
275
  "ui": "table_of_images",
275
276
  "contents": [
276
277
  {
277
- "src": str(Path(cont["dir"]) / f"fgsea_{pw.replace('/', '-')}.png"),
278
+ "src": str(Path(cont["dir"]) / f"fgsea_{slug}.png"),
278
279
  "title": pw,
279
280
  }
280
- for pw in pathways
281
+ for pw, slug in pathways
281
282
  ]
282
283
  },
283
284
  ]
@@ -1241,7 +1241,7 @@ class TopExpressingGenes(Proc):
1241
1241
  }
1242
1242
 
1243
1243
 
1244
- class ExprImpution(Proc):
1244
+ class ExprImputation(Proc):
1245
1245
  """This process imputes the dropout values in scRNA-seq data.
1246
1246
 
1247
1247
  It takes the Seurat object as input and outputs the Seurat object with
@@ -1317,13 +1317,13 @@ class ExprImpution(Proc):
1317
1317
  },
1318
1318
  "alra_args": {},
1319
1319
  }
1320
- script = "file://../scripts/scrna/ExprImpution.R"
1320
+ script = "file://../scripts/scrna/ExprImputation.R"
1321
1321
 
1322
1322
 
1323
1323
  class SCImpute(Proc):
1324
1324
  """Impute the dropout values in scRNA-seq data.
1325
1325
 
1326
- Deprecated. Use `ExprImpution` instead.
1326
+ Deprecated. Use `ExprImputation` instead.
1327
1327
 
1328
1328
  Input:
1329
1329
  infile: The input file for imputation
@@ -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": {
@@ -566,8 +566,8 @@ class ScrnaMetabolicLandscape(ProcGroup):
566
566
  input_data = lambda ch: tibble(
567
567
  srtobj=ch.iloc[:, 0],
568
568
  metafile=[None],
569
- mutaters=[self.opts.mutaters],
570
569
  )
570
+ envs = {"mutaters": self.opts.mutaters}
571
571
 
572
572
  return MetabolicSeuratMetadataMutater
573
573
 
@@ -577,10 +577,10 @@ class ScrnaMetabolicLandscape(ProcGroup):
577
577
  if self.opts.noimpute:
578
578
  return self.p_mutater
579
579
 
580
- from .scrna import ExprImpution
580
+ from .scrna import ExprImputation
581
581
 
582
582
  @annotate.format_doc(indent=3)
583
- class MetabolicExprImpution(ExprImpution):
583
+ class MetabolicExprImputation(ExprImputation):
584
584
  """{{Summary}}
585
585
 
586
586
  You can turn off the imputation by setting the `noimpute` option
@@ -588,7 +588,7 @@ class ScrnaMetabolicLandscape(ProcGroup):
588
588
  """
589
589
  requires = self.p_mutater
590
590
 
591
- return MetabolicExprImpution
591
+ return MetabolicExprImputation
592
592
 
593
593
  @ProcGroup.add_proc
594
594
  def p_pathway_activity(self) -> Type[Proc]:
@@ -0,0 +1,7 @@
1
+ {% if envs.tool == "rmagic" %}
2
+ {% include biopipen_dir + "/scripts/scrna/ExprImputation-rmagic.R" %}
3
+ {% elif envs.tool == "scimpute" %}
4
+ {% include biopipen_dir + "/scripts/scrna/ExprImputation-scimpute.R" %}
5
+ {% elif envs.tool == "alra" %}
6
+ {% include biopipen_dir + "/scripts/scrna/ExprImputation-alra.R" %}
7
+ {% endif %}
@@ -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
+ }
@@ -50,8 +50,18 @@ do_one_group <- function(obj, features, group, outputdir, h1) {
50
50
  classes[classes != group] <- "_REST"
51
51
  classes[classes == group] <- groupname
52
52
  if (any(table(classes) < 5)) {
53
- msg <- paste("Group", group, "has less than 5 cells, or only 5 cells left.")
53
+ msg <- paste(" Skipped. One of the groups has less than 5 cells.")
54
54
  log_warn(msg)
55
+ # write a warning.txt to odir with the message and table(classes)
56
+ write(paste0(msg, "\n\n"), file = file.path(odir, "warning.txt"))
57
+ write.table(
58
+ table(classes),
59
+ file = file.path(odir, "warning.txt"),
60
+ sep = "\t",
61
+ quote = FALSE,
62
+ row.names = FALSE,
63
+ append = TRUE
64
+ )
55
65
  return(
56
66
  list(
57
67
  list(kind = "error", content = msg),
@@ -84,14 +84,18 @@ do_one_comparison <- function(
84
84
 
85
85
  odir = file.path(groupdir, paste0(subset_prefix, compname))
86
86
  dir.create(odir, showWarnings = FALSE)
87
- if (ncol(exprs_case) < 3 || ncol(exprs_control) < 3) {
88
- log_warn(" Skip (not enough cells)")
89
- add_report(
87
+ if (ncol(exprs_case) < 5 || ncol(exprs_control) < 5) {
88
+ log_warn(" Skipped (not enough cells).")
89
+ wfile <- file.path(odir, "warning.txt")
90
+ write("Skipped (not enough cells)\n\n", file = wfile)
91
+ write(paste0("n_cells (Case):", ncol(exprs_case)), file = wfile, append = TRUE)
92
+ write(paste0("n_cells (Control):", ncol(exprs_control)), file = wfile, append = TRUE)
93
+
94
+ return(list(
90
95
  list(kind = "error", content = "Not enough cells"),
91
96
  h1 = groupname,
92
97
  h2 = compname
93
- )
94
- return (NULL)
98
+ ))
95
99
  }
96
100
  if (fgsea) {
97
101
  ranks = prerank(
@@ -2,11 +2,36 @@ library(ggplot2)
2
2
  library(dplyr)
3
3
  library(tibble)
4
4
 
5
- .slugify <- function(x, non_alphanum_replace="-", collapse_replace=TRUE, tolower=FALSE) {
6
- x <- gsub("[^[:alnum:]_]", non_alphanum_replace, x)
7
- if(collapse_replace) x <- gsub(paste0(non_alphanum_replace, "+"), non_alphanum_replace, x)
8
- if(tolower) x <- tolower(x)
9
- x
5
+ if (!exists("slugify")) {
6
+ slugify <- function(x, non_alphanum_replace="-", collapse_replace=TRUE, tolower=FALSE) {
7
+ subs <- list(
8
+ "š"="s", "œ"="oe", "ž"="z", "ß"="ss", "þ"="y", "à"="a", "á"="a", "â"="a",
9
+ "ã"="a", "ä"="a", "å"="a", "æ"="ae", "ç"="c", "è"="e", "é"="e", "ê"="e",
10
+ "ë"="e", "ì"="i", "í"="i", "î"="i", "ï"="i", "ð"="d", "ñ"="n", "ò"="o",
11
+ "ó"="o", "ô"="o", "õ"="o", "ö"="o", "ø"="oe", "ù"="u", "ú"="u", "û"="u",
12
+ "ü"="u", "ý"="y", "ÿ"="y", "ğ"="g", "ı"="i", "ij"="ij", "ľ"="l", "ň"="n",
13
+ "ř"="r", "ş"="s", "ť"="t", "ų"="u", "ů"="u", "ý"="y", "ź"="z", "ż"="z",
14
+ "ſ"="s", "α"="a", "β"="b", "γ"="g", "δ"="d", "ε"="e", "ζ"="z", "η"="h",
15
+ "θ"="th", "ι"="i", "κ"="k", "λ"="l", "μ"="m", "ν"="n", "ξ"="x", "ο"="o",
16
+ "π"="p", "ρ"="r", "σ"="s", "τ"="t", "υ"="u", "φ"="ph", "χ"="ch", "ψ"="ps",
17
+ "ω"="o", "ά"="a", "έ"="e", "ή"="h", "ί"="i", "ό"="o", "ύ"="u", "ώ"="o",
18
+ "ϐ"="b", "ϑ"="th", "ϒ"="y", "ϕ"="ph", "ϖ"="p", "Ϛ"="st", "ϛ"="st", "Ϝ"="f",
19
+ "ϝ"="f", "Ϟ"="k", "ϟ"="k", "Ϡ"="k", "ϡ"="k", "ϰ"="k", "ϱ"="r", "ϲ"="s",
20
+ "ϳ"="j", "ϴ"="th", "ϵ"="e", "϶"="p"
21
+ )
22
+ # replace latin and greek characters to the closest english character
23
+ for (k in names(subs)) {
24
+ x <- gsub(k, subs[[k]], x)
25
+ }
26
+ x <- gsub("[^[:alnum:]_]", non_alphanum_replace, x)
27
+ if(collapse_replace) x <- gsub(
28
+ paste0(gsub("([][{}()+*^$|\\\\?.])", "\\\\\\1", non_alphanum_replace), "+"),
29
+ non_alphanum_replace,
30
+ x
31
+ )
32
+ if(tolower) x <- tolower(x)
33
+ x
34
+ }
10
35
  }
11
36
 
12
37
  localizeGmtfile <- function(gmturl, cachedir = tempdir()) {
@@ -25,7 +50,12 @@ localizeGmtfile <- function(gmturl, cachedir = tempdir()) {
25
50
  if (nrow(items) == 0) {
26
51
  stop(paste0("Empty GMT file: ", gmtfile, ", from ", gmturl))
27
52
  }
28
- if (nchar(items$V2[1]) < nchar(items$V1[1]) && nchar(items$V2[1]) > 0) {
53
+ if (
54
+ is.character(items$V2[1]) &&
55
+ nchar(items$V2[1]) < nchar(items$V1[1]) &&
56
+ nchar(items$V2[1]) > 0 &&
57
+ is.na(suppressWarnings(as.numeric(items$V2[1])))
58
+ ) {
29
59
  warning(paste0(
30
60
  "The second column is shorter, switching the first and second columns in GMT file ",
31
61
  gmtfile,
@@ -153,7 +183,8 @@ runFGSEA = function(
153
183
 
154
184
  write.table(
155
185
  gsea_res %>%
156
- mutate(leadingEdge = sapply(leadingEdge, function(x) paste(x, collapse=","))),
186
+ mutate(leadingEdge = sapply(leadingEdge, function(x) paste(x, collapse=",")),
187
+ slug = sapply(pathway, slugify)),
157
188
  file = file.path(outdir, "fgsea.txt"),
158
189
  row.names = FALSE,
159
190
  col.names = TRUE,
@@ -172,16 +203,16 @@ runFGSEA = function(
172
203
 
173
204
  tablefig = file.path(outdir, "gsea_table.png")
174
205
  png(tablefig, res=100, width=1000, height=200 + 40 * length(topPathways))
175
- plotGseaTable(
206
+ print(plotGseaTable(
176
207
  envs$pathways[topPathways],
177
208
  ranks,
178
209
  gsea_res,
179
210
  gseaParam = if (!is.null(envs$gseaParam)) envs$gseaParam else 1
180
- )
211
+ ))
181
212
  dev.off()
182
213
 
183
214
  for (pathway in topPathways) {
184
- enrfig = file.path(outdir, paste0("fgsea_", .slugify(pathway), ".png"))
215
+ enrfig = file.path(outdir, paste0("fgsea_", slugify(pathway), ".png"))
185
216
  png(enrfig, res=100, width=1000, height=800)
186
217
  print(plotEnrichment(
187
218
  envs$pathways[[pathway]],
@@ -33,6 +33,7 @@ bQuote <- function(x) {
33
33
  }
34
34
 
35
35
  #' Slugify a string
36
+ #' Remember also update the one in gsea.R
36
37
  #' @param x A string
37
38
  #' @param non_alphanum_replace Replace non-alphanumeric characters
38
39
  #' @param collapse_replace Collapse consecutive non-alphanumeric character replacements
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "biopipen"
3
- version = "0.27.6"
3
+ version = "0.27.8"
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.6',
84
+ 'version': '0.27.8',
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.6"
@@ -1,7 +0,0 @@
1
- {% if envs.tool == "rmagic" %}
2
- {% include biopipen_dir + "/scripts/scrna/ExprImpution-rmagic.R" %}
3
- {% elif envs.tool == "scimpute" %}
4
- {% include biopipen_dir + "/scripts/scrna/ExprImpution-scimpute.R" %}
5
- {% elif envs.tool == "alra" %}
6
- {% include biopipen_dir + "/scripts/scrna/ExprImpution-alra.R" %}
7
- {% endif %}