biopipen 0.22.1__tar.gz → 0.22.2__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 (225) hide show
  1. {biopipen-0.22.1 → biopipen-0.22.2}/PKG-INFO +1 -1
  2. biopipen-0.22.2/biopipen/__init__.py +1 -0
  3. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/core/config.toml +6 -0
  4. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/core/filters.py +12 -0
  5. biopipen-0.22.2/biopipen/ns/cellranger.py +101 -0
  6. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/ns/scrna.py +2 -0
  7. biopipen-0.22.2/biopipen/reports/cellranger/CellRangerCount.svelte +16 -0
  8. biopipen-0.22.2/biopipen/reports/cellranger/CellRangerVdj.svelte +16 -0
  9. biopipen-0.22.2/biopipen/scripts/cellranger/CellRangerCount.py +79 -0
  10. biopipen-0.22.2/biopipen/scripts/cellranger/CellRangerVdj.py +79 -0
  11. biopipen-0.22.2/biopipen/scripts/scrna/CellTypeAnnotation-direct.R +55 -0
  12. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/scrna/CellsDistribution.R +3 -8
  13. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/scrna/MarkersFinder.R +106 -28
  14. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/scrna/SeuratClusterStats-features.R +2 -2
  15. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/utils/common_docstrs.py +3 -0
  16. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/utils/mutate_helpers.R +110 -106
  17. {biopipen-0.22.1 → biopipen-0.22.2}/pyproject.toml +2 -1
  18. {biopipen-0.22.1 → biopipen-0.22.2}/setup.py +4 -1
  19. biopipen-0.22.1/biopipen/__init__.py +0 -1
  20. biopipen-0.22.1/biopipen/scripts/scrna/CellTypeAnnotation-direct.R +0 -48
  21. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/core/__init__.py +0 -0
  22. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/core/config.py +0 -0
  23. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/core/defaults.py +0 -0
  24. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/core/proc.py +0 -0
  25. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/core/testing.py +0 -0
  26. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/ns/__init__.py +0 -0
  27. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/ns/bam.py +0 -0
  28. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/ns/bcftools.py +0 -0
  29. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/ns/bed.py +0 -0
  30. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/ns/cnv.py +0 -0
  31. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/ns/cnvkit.py +0 -0
  32. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/ns/cnvkit_pipeline.py +0 -0
  33. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/ns/delim.py +0 -0
  34. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/ns/gene.py +0 -0
  35. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/ns/gsea.py +0 -0
  36. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/ns/misc.py +0 -0
  37. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/ns/plot.py +0 -0
  38. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/ns/rnaseq.py +0 -0
  39. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/ns/scrna_basic.py +0 -0
  40. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/ns/scrna_metabolic_landscape.py +0 -0
  41. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/ns/tcgamaf.py +0 -0
  42. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/ns/tcr.py +0 -0
  43. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/ns/vcf.py +0 -0
  44. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/ns/web.py +0 -0
  45. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/reports/bam/CNAClinic.svelte +0 -0
  46. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/reports/bam/CNVpytor.svelte +0 -0
  47. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/reports/bam/ControlFREEC.svelte +0 -0
  48. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/reports/cnv/AneuploidyScore.svelte +0 -0
  49. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/reports/cnv/AneuploidyScoreSummary.svelte +0 -0
  50. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/reports/cnv/TMADScoreSummary.svelte +0 -0
  51. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/reports/cnvkit/CNVkitDiagram.svelte +0 -0
  52. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/reports/cnvkit/CNVkitHeatmap.svelte +0 -0
  53. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/reports/cnvkit/CNVkitScatter.svelte +0 -0
  54. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/reports/delim/SampleInfo.svelte +0 -0
  55. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/reports/gsea/FGSEA.svelte +0 -0
  56. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/reports/gsea/GSEA.svelte +0 -0
  57. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/reports/scrna/CellsDistribution.svelte +0 -0
  58. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/reports/scrna/DimPlots.svelte +0 -0
  59. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/reports/scrna/GeneExpressionInvistigation.svelte +0 -0
  60. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/reports/scrna/MarkersFinder.svelte +0 -0
  61. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/reports/scrna/MetaMarkers.svelte +0 -0
  62. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/reports/scrna/RadarPlots.svelte +0 -0
  63. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/reports/scrna/ScFGSEA.svelte +0 -0
  64. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/reports/scrna/SeuratClusterStats.svelte +0 -0
  65. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/reports/scrna/SeuratMap2Ref.svelte +0 -0
  66. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/reports/scrna/SeuratPreparing.svelte +0 -0
  67. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/reports/scrna/TopExpressingGenes.svelte +0 -0
  68. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/reports/scrna_metabolic_landscape/MetabolicFeatures.svelte +0 -0
  69. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/reports/scrna_metabolic_landscape/MetabolicFeaturesIntraSubset.svelte +0 -0
  70. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/reports/scrna_metabolic_landscape/MetabolicPathwayActivity.svelte +0 -0
  71. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/reports/scrna_metabolic_landscape/MetabolicPathwayHeterogeneity.svelte +0 -0
  72. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/reports/tcr/CDR3AAPhyschem.svelte +0 -0
  73. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/reports/tcr/CloneResidency.svelte +0 -0
  74. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/reports/tcr/Immunarch.svelte +0 -0
  75. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/reports/tcr/SampleDiversity.svelte +0 -0
  76. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/reports/tcr/TCRClusterStats.svelte +0 -0
  77. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/reports/tcr/TESSA.svelte +0 -0
  78. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/reports/tcr/VJUsage.svelte +0 -0
  79. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/reports/utils/gsea.liq +0 -0
  80. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/reports/utils/misc.liq +0 -0
  81. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/reports/vcf/TruvariBenchSummary.svelte +0 -0
  82. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/reports/vcf/TruvariConsistency.svelte +0 -0
  83. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/bam/BamMerge.py +0 -0
  84. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/bam/BamSplitChroms.py +0 -0
  85. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/bam/CNAClinic.R +0 -0
  86. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/bam/CNVpytor.py +0 -0
  87. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/bam/ControlFREEC.py +0 -0
  88. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/bcftools/BcftoolsAnnotate.py +0 -0
  89. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/bcftools/BcftoolsFilter.py +0 -0
  90. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/bcftools/BcftoolsSort.py +0 -0
  91. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/bed/Bed2Vcf.py +0 -0
  92. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/bed/BedConsensus.py +0 -0
  93. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/bed/BedLiftOver.sh +0 -0
  94. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/bed/BedtoolsMerge.py +0 -0
  95. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/cnv/AneuploidyScore.R +0 -0
  96. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/cnv/AneuploidyScoreSummary.R +0 -0
  97. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/cnv/TMADScore.R +0 -0
  98. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/cnv/TMADScoreSummary.R +0 -0
  99. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/cnvkit/CNVkitAccess.py +0 -0
  100. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/cnvkit/CNVkitAutobin.py +0 -0
  101. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/cnvkit/CNVkitBatch.py +0 -0
  102. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/cnvkit/CNVkitCall.py +0 -0
  103. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/cnvkit/CNVkitCoverage.py +0 -0
  104. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/cnvkit/CNVkitDiagram.py +0 -0
  105. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/cnvkit/CNVkitFix.py +0 -0
  106. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/cnvkit/CNVkitGuessBaits.py +0 -0
  107. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/cnvkit/CNVkitHeatmap.py +0 -0
  108. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/cnvkit/CNVkitReference.py +0 -0
  109. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/cnvkit/CNVkitScatter.py +0 -0
  110. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/cnvkit/CNVkitSegment.py +0 -0
  111. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/cnvkit/guess_baits.py +0 -0
  112. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/delim/RowsBinder.R +0 -0
  113. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/delim/SampleInfo.R +0 -0
  114. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/gene/GeneNameConversion.py +0 -0
  115. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/gsea/Enrichr.R +0 -0
  116. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/gsea/FGSEA.R +0 -0
  117. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/gsea/GSEA.R +0 -0
  118. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/gsea/PreRank.R +0 -0
  119. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/misc/Config2File.py +0 -0
  120. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/misc/Str2File.py +0 -0
  121. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/plot/Heatmap.R +0 -0
  122. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/plot/VennDiagram.R +0 -0
  123. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/rnaseq/UnitConversion.R +0 -0
  124. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/scrna/CellTypeAnnotation-hitype.R +0 -0
  125. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/scrna/CellTypeAnnotation-sccatch.R +0 -0
  126. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/scrna/CellTypeAnnotation-sctype.R +0 -0
  127. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/scrna/CellTypeAnnotation.R +0 -0
  128. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/scrna/DimPlots.R +0 -0
  129. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/scrna/ExprImpution-alra.R +0 -0
  130. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/scrna/ExprImpution-rmagic.R +0 -0
  131. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/scrna/ExprImpution-scimpute.R +0 -0
  132. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/scrna/ExprImpution.R +0 -0
  133. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/scrna/GeneExpressionInvistigation.R +0 -0
  134. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/scrna/MetaMarkers.R +0 -0
  135. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/scrna/ModuleScoreCalculator.R +0 -0
  136. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/scrna/RadarPlots.R +0 -0
  137. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/scrna/SCImpute.R +0 -0
  138. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/scrna/ScFGSEA.R +0 -0
  139. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/scrna/SeuratClusterStats-dimplots.R +0 -0
  140. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/scrna/SeuratClusterStats-stats.R +0 -0
  141. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/scrna/SeuratClusterStats.R +0 -0
  142. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/scrna/SeuratClustering.R +0 -0
  143. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/scrna/SeuratFilter.R +0 -0
  144. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/scrna/SeuratLoading.R +0 -0
  145. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/scrna/SeuratMap2Ref.R +0 -0
  146. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/scrna/SeuratMetadataMutater.R +0 -0
  147. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/scrna/SeuratPreparing.R +0 -0
  148. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/scrna/SeuratSplit.R +0 -0
  149. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/scrna/SeuratSubset.R +0 -0
  150. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/scrna/Subset10X.R +0 -0
  151. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/scrna/TopExpressingGenes.R +0 -0
  152. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/scrna/Write10X.R +0 -0
  153. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/scrna/sctype.R +0 -0
  154. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/scrna_metabolic_landscape/MetabolicFeatures.R +0 -0
  155. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/scrna_metabolic_landscape/MetabolicFeaturesIntraSubset.R +0 -0
  156. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/scrna_metabolic_landscape/MetabolicPathwayActivity.R +0 -0
  157. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/scrna_metabolic_landscape/MetabolicPathwayHeterogeneity.R +0 -0
  158. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/tcgamaf/Maf2Vcf.py +0 -0
  159. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/tcgamaf/MafAddChr.py +0 -0
  160. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/tcgamaf/maf2vcf.pl +0 -0
  161. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/tcr/Attach2Seurat.R +0 -0
  162. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/tcr/CDR3AAPhyschem.R +0 -0
  163. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/tcr/CloneResidency.R +0 -0
  164. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/tcr/CloneSizeQQPlot.R +0 -0
  165. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/tcr/GIANA/GIANA.py +0 -0
  166. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/tcr/GIANA/GIANA4.py +0 -0
  167. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/tcr/GIANA/Imgt_Human_TRBV.fasta +0 -0
  168. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/tcr/GIANA/query.py +0 -0
  169. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/tcr/Immunarch-basic.R +0 -0
  170. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/tcr/Immunarch-clonality.R +0 -0
  171. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/tcr/Immunarch-diversity.R +0 -0
  172. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/tcr/Immunarch-geneusage.R +0 -0
  173. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/tcr/Immunarch-kmer.R +0 -0
  174. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/tcr/Immunarch-overlap.R +0 -0
  175. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/tcr/Immunarch-spectratyping.R +0 -0
  176. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/tcr/Immunarch-tracking.R +0 -0
  177. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/tcr/Immunarch-vjjunc.R +0 -0
  178. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/tcr/Immunarch.R +0 -0
  179. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/tcr/Immunarch2VDJtools.R +0 -0
  180. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/tcr/ImmunarchFilter.R +0 -0
  181. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/tcr/ImmunarchLoading.R +0 -0
  182. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/tcr/ImmunarchSplitIdents.R +0 -0
  183. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/tcr/SampleDiversity.R +0 -0
  184. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/tcr/TCRClusterStats.R +0 -0
  185. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/tcr/TCRClustering.R +0 -0
  186. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/tcr/TESSA.R +0 -0
  187. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/tcr/TESSA_source/Atchley_factors.csv +0 -0
  188. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/tcr/TESSA_source/BriseisEncoder.py +0 -0
  189. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/tcr/TESSA_source/MCMC_control.R +0 -0
  190. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/tcr/TESSA_source/TrainedEncoder.h5 +0 -0
  191. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/tcr/TESSA_source/fixed_b.csv +0 -0
  192. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/tcr/TESSA_source/initialization.R +0 -0
  193. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/tcr/TESSA_source/post_analysis.R +0 -0
  194. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/tcr/TESSA_source/real_data.R +0 -0
  195. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/tcr/TESSA_source/update.R +0 -0
  196. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/tcr/TESSA_source/utility.R +0 -0
  197. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/tcr/VJUsage.R +0 -0
  198. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/tcr/vdjtools-patch.sh +0 -0
  199. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/vcf/TruvariBench.sh +0 -0
  200. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/vcf/TruvariBenchSummary.R +0 -0
  201. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/vcf/TruvariConsistency.R +0 -0
  202. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/vcf/Vcf2Bed.py +0 -0
  203. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/vcf/VcfAnno.py +0 -0
  204. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/vcf/VcfDownSample.sh +0 -0
  205. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/vcf/VcfFilter.py +0 -0
  206. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/vcf/VcfFix.py +0 -0
  207. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/vcf/VcfFix_utils.py +0 -0
  208. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/vcf/VcfIndex.py +0 -0
  209. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/vcf/VcfIntersect.py +0 -0
  210. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/vcf/VcfLiftOver.sh +0 -0
  211. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/vcf/VcfSplitSamples.py +0 -0
  212. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/web/Download.py +0 -0
  213. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/scripts/web/DownloadList.py +0 -0
  214. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/utils/__init__.py +0 -0
  215. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/utils/gene.R +0 -0
  216. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/utils/gene.py +0 -0
  217. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/utils/gsea.R +0 -0
  218. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/utils/io.R +0 -0
  219. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/utils/misc.R +0 -0
  220. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/utils/misc.py +0 -0
  221. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/utils/plot.R +0 -0
  222. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/utils/reference.py +0 -0
  223. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/utils/rnaseq.R +0 -0
  224. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/utils/single_cell.R +0 -0
  225. {biopipen-0.22.1 → biopipen-0.22.2}/biopipen/utils/vcf.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: biopipen
3
- Version: 0.22.1
3
+ Version: 0.22.2
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.22.2"
@@ -4,6 +4,8 @@
4
4
  bedtools = "bedtools"
5
5
  # bcftools to handle bcf/vcf files
6
6
  bcftools = "bcftools"
7
+ # cellranger
8
+ cellranger = "cellranger"
7
9
  # Control-FREEC to call cnvs
8
10
  freec = "freec"
9
11
  # liftover coordinates across genomes
@@ -59,6 +61,10 @@ liftover_chain = ""
59
61
  # tmpdir = ""
60
62
 
61
63
  [ref]
64
+ # The reference for cellranger gex
65
+ ref_cellranger_gex = ""
66
+ # The reference for cellranger vdj
67
+ ref_cellranger_vdj = ""
62
68
  # The reference genome
63
69
  reffa = ""
64
70
  # The directory with reference for each chromosome
@@ -15,6 +15,7 @@ filtermanager = FilterManager()
15
15
  @filtermanager.register
16
16
  def dict_to_cli_args(
17
17
  dic: Mapping[str, Any],
18
+ exclude: List[str] = None,
18
19
  prefix: str | None = None,
19
20
  sep: str | None = " ",
20
21
  dup_key: bool = True,
@@ -27,6 +28,7 @@ def dict_to_cli_args(
27
28
 
28
29
  Args:
29
30
  dic: The dict to convert
31
+ exclude: The keys to exclude
30
32
  prefix: The prefix of the keys after conversion
31
33
  Defaults to `None`, mean `-` for short keys and `--` for long keys
32
34
  sep: The separator between key and value
@@ -37,6 +39,13 @@ def dict_to_cli_args(
37
39
  If `sep` is `None` or `=`, this must be True, otherwise an error
38
40
  will be raised
39
41
  join: Whether to join the arguments into a single string
42
+ start_key: The key to start the arguments
43
+ This is useful when you want to put some arguments at the beginning
44
+ of the command line
45
+ end_key: The key to end the arguments
46
+ This is useful when you want to put some arguments at the end
47
+ of the command line
48
+ dashify: Whether to replace `_` with `-` in the keys
40
49
 
41
50
  Returns:
42
51
  The converted string or list of strings
@@ -44,6 +53,9 @@ def dict_to_cli_args(
44
53
  if sep in [None, "="] and not dup_key:
45
54
  raise ValueError("`dup_key` must be True when sep is `None` or `=`")
46
55
 
56
+ if exclude:
57
+ dic = {k: v for k, v in dic.items() if k not in exclude}
58
+
47
59
  starts = []
48
60
  ends = []
49
61
  out = []
@@ -0,0 +1,101 @@
1
+ """Cellranger pipeline module for BioPipen"""
2
+ from ..core.proc import Proc
3
+ from ..core.config import config
4
+
5
+
6
+ class CellRangerCount(Proc):
7
+ """Run cellranger count
8
+
9
+ to count gene expression and/or feature barcode reads
10
+
11
+ Input:
12
+ fastqs: The input fastq files
13
+ Either a list of fastq files or a directory containing fastq files
14
+ If a directory is provided, it should be passed as a list with one
15
+ element.
16
+
17
+ Output:
18
+ outdir: The output directory
19
+
20
+ Envs:
21
+ ncores: Number of cores to use
22
+ cellranger: Path to cellranger
23
+ ref: Path of folder containing 10x-compatible transcriptome reference
24
+ tmpdir: Path to temporary directory, used to save the soft-lined fastq files
25
+ to pass to cellranger
26
+ include_introns: Set to false to exclude intronic reads in count.
27
+ <more>: Other environment variables required by `cellranger count`
28
+ See `cellranger count --help` for more details or
29
+ https://www.10xgenomics.com/support/software/cell-ranger/advanced/cr-command-line-arguments#count
30
+ """ # noqa: E501
31
+ input = "fastqs:files"
32
+ output = """outdir:dir:
33
+ {%- set fastqs = in.fastqs -%}
34
+ {%- if len(fastqs) == 1 and isdir(fastqs[0]) -%}
35
+ {%- set fastqs = fastqs[0] | glob: "*.fastq.gz" -%}
36
+ {%- endif -%}
37
+ {%- set sample = commonprefix(*fastqs) |
38
+ regex_replace: "_L\\d+_$", "" |
39
+ regex_replace: "_S\\d+$", "" -%}
40
+ {{- sample -}}
41
+ """
42
+ lang = config.lang.python
43
+ envs = {
44
+ "ncores": config.misc.ncores,
45
+ "cellranger": config.exe.cellranger,
46
+ "ref": config.ref.ref_cellranger_gex,
47
+ "tmpdir": config.path.tmpdir,
48
+ "include_introns": "true",
49
+ }
50
+ script = "file://../scripts/cellranger/CellRangerCount.py"
51
+ plugin_opts = {
52
+ "report": "file://../reports/cellranger/CellRangerCount.svelte",
53
+ }
54
+
55
+
56
+ class CellRangerVdj(Proc):
57
+ """Run cellranger vdj
58
+
59
+ to perform sequence assembly and paired clonotype calling
60
+
61
+ Input:
62
+ fastqs: The input fastq files
63
+ Either a list of fastq files or a directory containing fastq files
64
+ If a directory is provided, it should be passed as a list with one
65
+ element.
66
+
67
+ Output:
68
+ outdir: The output directory
69
+
70
+ Envs:
71
+ ncores: Number of cores to use
72
+ cellranger: Path to cellranger
73
+ ref: Path of folder containing 10x-compatible transcriptome reference
74
+ tmpdir: Path to temporary directory, used to save the soft-lined fastq files
75
+ to pass to cellranger
76
+ <more>: Other environment variables required by `cellranger vdj`
77
+ See `cellranger vdj --help` for more details or
78
+ https://www.10xgenomics.com/support/software/cell-ranger/advanced/cr-command-line-arguments#vdj
79
+ """ # noqa: E501
80
+ input = "fastqs:files"
81
+ output = """outdir:dir:
82
+ {%- set fastqs = in.fastqs -%}
83
+ {%- if len(fastqs) == 1 and isdir(fastqs[0]) -%}
84
+ {%- set fastqs = fastqs[0] | glob: "*.fastq.gz" -%}
85
+ {%- endif -%}
86
+ {%- set sample = commonprefix(*fastqs) |
87
+ regex_replace: "_L\\d+_$", "" |
88
+ regex_replace: "_S\\d+$", "" -%}
89
+ {{- sample -}}
90
+ """
91
+ lang = config.lang.python
92
+ envs = {
93
+ "ncores": config.misc.ncores,
94
+ "cellranger": config.exe.cellranger,
95
+ "ref": config.ref.ref_cellranger_vdj,
96
+ "tmpdir": config.path.tmpdir,
97
+ }
98
+ script = "file://../scripts/cellranger/CellRangerVdj.py"
99
+ plugin_opts = {
100
+ "report": "file://../reports/cellranger/CellRangerVdj.svelte",
101
+ }
@@ -1422,6 +1422,8 @@ class CellTypeAnnotation(Proc):
1422
1422
  If the length of `cell_types` is shorter than the number of
1423
1423
  clusters, the remaining clusters will be kept as the original cell
1424
1424
  types.
1425
+ You can also use `NA` to remove the clusters from downstream analysis. This
1426
+ only works when `envs.newcol` is not specified.
1425
1427
 
1426
1428
  /// Note
1427
1429
  If `tool` is `direct` and `cell_types` is not specified or an empty list,
@@ -0,0 +1,16 @@
1
+ {% from "utils/misc.liq" import report_jobs, table_of_images -%}
2
+
3
+ {%- macro report_job(job, h=1) -%}
4
+ <h{{h}}>{{job.out.outdir | basename | escape}}</h{{h}}>
5
+ <iframe
6
+ src="{{job.out.outdir}}/outs/web_summary.html"
7
+ width="100%"
8
+ frameborder="0"
9
+ style="min-height: 80vh"></iframe>
10
+ {%- endmacro -%}
11
+
12
+ {%- macro head_job(job) -%}
13
+ <h1>{{job.out.outdir | basename | escape}}</h1>
14
+ {%- endmacro -%}
15
+
16
+ {{ report_jobs(jobs, head_job, report_job) }}
@@ -0,0 +1,16 @@
1
+ {% from "utils/misc.liq" import report_jobs, table_of_images -%}
2
+
3
+ {%- macro report_job(job, h=1) -%}
4
+ <h{{h}}>{{job.out.outdir | basename | escape}}</h{{h}}>
5
+ <iframe
6
+ src="{{job.out.outdir}}/outs/web_summary.html"
7
+ width="100%"
8
+ frameborder="0"
9
+ style="min-height: 80vh"></iframe>
10
+ {%- endmacro -%}
11
+
12
+ {%- macro head_job(job) -%}
13
+ <h1>{{job.out.outdir | basename | escape}}</h1>
14
+ {%- endmacro -%}
15
+
16
+ {{ report_jobs(jobs, head_job, report_job) }}
@@ -0,0 +1,79 @@
1
+ import uuid
2
+ import re
3
+ from pathlib import Path
4
+ from biopipen.utils.misc import run_command
5
+
6
+ fastqs = {{in.fastqs | repr}} # pyright: ignore # noqa
7
+ outdir = {{out.outdir | quote}} # pyright: ignore
8
+
9
+ cellranger = {{envs.cellranger | quote}} # pyright: ignore
10
+ tmpdir = Path({{envs.tmpdir | quote}}) # pyright: ignore
11
+ ref = {{envs.ref | quote}} # pyright: ignore
12
+ ncores = {{envs.ncores | int}} # pyright: ignore
13
+
14
+ {% if "id" in envs -%}
15
+ id = {{envs.id | quote}} # pyright: ignore
16
+ {%- else -%}
17
+ id = {{out.outdir | basename | quote}} # pyright: ignore
18
+ {%- endif %}
19
+
20
+ {% if "sample" in envs -%}
21
+ sample = {{envs.sample | quote}} # pyright: ignore
22
+ {%- else -%}
23
+ sample = {{out.outdir | basename | quote}} # pyright: ignore
24
+ {%- endif %}
25
+
26
+ # create a temporary unique directory to store the soft-linked fastq files
27
+ fastqdir = tmpdir / f"cellranger_count_{uuid.uuid4()}"
28
+ fastqdir.mkdir(parents=True, exist_ok=True)
29
+ if len(fastqs) == 1 and fastqs[0].is_dir():
30
+ fastqs = list(fastqs[0].glob("*.fastq.gz"))
31
+
32
+ # soft-link the fastq files to the temporary directory
33
+ for fastq in fastqs:
34
+ fastq = Path(fastq)
35
+ (fastqdir / fastq.name).symlink_to(fastq)
36
+
37
+ other_args = {{envs | dict_to_cli_args: dashify=True, exclude=['cellranger', 'transcriptome', 'ref', 'tmpdir', 'id', 'sample', 'ncores']}} # pyright: ignore
38
+
39
+ command = [
40
+ cellranger,
41
+ "count",
42
+ "--id",
43
+ id,
44
+ "--sample",
45
+ sample,
46
+ "--fastqs",
47
+ fastqdir,
48
+ "--transcriptome",
49
+ ref,
50
+ "--localcores",
51
+ ncores,
52
+ "--disable-ui",
53
+ *other_args,
54
+ ]
55
+
56
+ run_command(command, fg=True, cwd=str(Path(outdir).parent))
57
+
58
+ web_summary_html = Path(outdir) / "outs" / "web_summary.html"
59
+ if not web_summary_html.exists():
60
+ raise RuntimeError(
61
+ f"web_summary.html does not exist in {outdir}/outs. "
62
+ "cellranger count failed."
63
+ )
64
+
65
+ # Modify web_summary.html to move javascript to a separate file
66
+ # to void vscode live server breaking the page by injecting some code
67
+ print("# Modify web_summary.html to move javascript to a separate file")
68
+ try:
69
+ web_summary_js = Path(outdir) / "outs" / "web_summary.js"
70
+ web_summary_content = web_summary_html.read_text()
71
+ regex = re.compile(r"<script>(?=/\*! For license)(.+)</script>", re.DOTALL)
72
+ web_summary_html.write_text(regex.sub(
73
+ '<script src="web_summary.js"></script>',
74
+ web_summary_content,
75
+ ))
76
+ web_summary_js.write_text(regex.search(web_summary_content).group(1))
77
+ except Exception as e:
78
+ print(f"Error modifying web_summary.html: {e}")
79
+ raise e
@@ -0,0 +1,79 @@
1
+ import uuid
2
+ import re
3
+ from pathlib import Path
4
+ from biopipen.utils.misc import run_command
5
+
6
+ fastqs = {{in.fastqs | repr}} # pyright: ignore # noqa
7
+ outdir = {{out.outdir | quote}} # pyright: ignore
8
+
9
+ cellranger = {{envs.cellranger | quote}} # pyright: ignore
10
+ tmpdir = Path({{envs.tmpdir | quote}}) # pyright: ignore
11
+ ref = {{envs.ref | quote}} # pyright: ignore
12
+ ncores = {{envs.ncores | int}} # pyright: ignore
13
+
14
+ {% if "id" in envs -%}
15
+ id = {{envs.id | quote}} # pyright: ignore
16
+ {%- else -%}
17
+ id = {{out.outdir | basename | quote}} # pyright: ignore
18
+ {%- endif %}
19
+
20
+ {% if "sample" in envs -%}
21
+ sample = {{envs.sample | quote}} # pyright: ignore
22
+ {%- else -%}
23
+ sample = {{out.outdir | basename | quote}} # pyright: ignore
24
+ {%- endif %}
25
+
26
+ # create a temporary unique directory to store the soft-linked fastq files
27
+ fastqdir = tmpdir / f"cellranger_count_{uuid.uuid4()}"
28
+ fastqdir.mkdir(parents=True, exist_ok=True)
29
+ if len(fastqs) == 1 and fastqs[0].is_dir():
30
+ fastqs = list(fastqs[0].glob("*.fastq.gz"))
31
+
32
+ # soft-link the fastq files to the temporary directory
33
+ for fastq in fastqs:
34
+ fastq = Path(fastq)
35
+ (fastqdir / fastq.name).symlink_to(fastq)
36
+
37
+ other_args = {{envs | dict_to_cli_args: dashify=True, exclude=['cellranger', 'reference', 'ref', 'tmpdir', 'id', 'sample', 'ncores']}} # pyright: ignore
38
+
39
+ command = [
40
+ cellranger,
41
+ "vdj",
42
+ "--id",
43
+ id,
44
+ "--sample",
45
+ sample,
46
+ "--fastqs",
47
+ fastqdir,
48
+ "--reference",
49
+ ref,
50
+ "--localcores",
51
+ ncores,
52
+ "--disable-ui",
53
+ *other_args,
54
+ ]
55
+
56
+ run_command(command, fg=True, cwd=str(Path(outdir).parent))
57
+
58
+ web_summary_html = Path(outdir) / "outs" / "web_summary.html"
59
+ if not web_summary_html.exists():
60
+ raise RuntimeError(
61
+ f"web_summary.html does not exist in {outdir}/outs. "
62
+ "cellranger vdj failed."
63
+ )
64
+
65
+ # Modify web_summary.html to move javascript to a separate file
66
+ # to void vscode live server breaking the page by injecting some code
67
+ print("# Modify web_summary.html to move javascript to a separate file")
68
+ try:
69
+ web_summary_js = Path(outdir) / "outs" / "web_summary.js"
70
+ web_summary_content = web_summary_html.read_text()
71
+ regex = re.compile(r"<script>(?=/\*! For license)(.+)</script>", re.DOTALL)
72
+ web_summary_html.write_text(regex.sub(
73
+ '<script src="web_summary.js"></script>',
74
+ web_summary_content,
75
+ ))
76
+ web_summary_js.write_text(regex.search(web_summary_content).group(1))
77
+ except Exception as e:
78
+ print(f"Error modifying web_summary.html: {e}")
79
+ raise e
@@ -0,0 +1,55 @@
1
+ source("{{biopipen_dir}}/utils/misc.R")
2
+ library(Seurat)
3
+
4
+ sobjfile <- {{in.sobjfile | r}}
5
+ outfile <- {{out.outfile | r}}
6
+ celltypes <- {{envs.cell_types | r}}
7
+ newcol <- {{envs.newcol | r}}
8
+
9
+ if (is.null(celltypes) || length(celltypes) == 0) {
10
+ log_warn("No cell types are given!")
11
+
12
+ # create a symbolic link to the input file
13
+ file.symlink(sobjfile, outfile)
14
+ } else {
15
+ log_info("Loading Seurat object ...")
16
+ sobj <- readRDS(sobjfile)
17
+ idents <- as.character(unique(Idents(sobj)))
18
+ idents <- idents[order(as.numeric(idents))]
19
+
20
+ if (length(celltypes) < length(idents)) {
21
+ celltypes <- c(celltypes, idents[(length(celltypes) + 1):length(idents)])
22
+ } else if (length(celltypes) > length(idents)) {
23
+ celltypes <- celltypes[1:length(idents)]
24
+ log_warn("The length of cell types is longer than the number of clusters!")
25
+ }
26
+ for (i in seq_along(celltypes)) {
27
+ if (celltypes[i] == "-" || celltypes[i] == "") {
28
+ celltypes[i] <- idents[i]
29
+ }
30
+ }
31
+ names(celltypes) <- idents
32
+
33
+ log_info("Renaming cell types ...")
34
+ if (is.null(newcol)) {
35
+ has_na <- "NA" %in% unlist(celltypes) || anyNA(unlist(celltypes))
36
+ sobj$seurat_clusters_id <- Idents(sobj)
37
+ celltypes$object <- sobj
38
+ sobj <- do_call(RenameIdents, celltypes)
39
+ sobj$seurat_clusters <- Idents(sobj)
40
+ if (has_na) {
41
+ log_info("Filtering clusters if NA ...")
42
+ sobj <- subset(
43
+ sobj,
44
+ subset = seurat_clusters != "NA" & !is.na(seurat_clusters)
45
+ )
46
+ }
47
+ } else {
48
+ celltypes$object <- sobj
49
+ sobj <- do_call(RenameIdents, celltypes)
50
+ sobj[[newcol]] <- Idents(sobj)
51
+ Idents(sobj) <- "seurat_clusters"
52
+ }
53
+
54
+ saveRDS(sobj, outfile)
55
+ }
@@ -142,13 +142,8 @@ do_case <- function(name, case) {
142
142
  info <- casename_info(name, create = TRUE)
143
143
  cells_by <- trimws(strsplit(case$cells_by, ",")[[1]])
144
144
 
145
- sec_case_names <- strsplit(name, ":")[[1]]
146
- sec_dir <- file.path(outdir, sec_case_names[1])
147
- casename <- paste(sec_case_names[-1], collapse = ":")
148
- dir.create(sec_dir, showWarnings = FALSE, recursive = TRUE)
149
-
150
- outfile <- file.path(info$sec_dir, paste0("case-", info$case_slug, ".png"))
151
- txtfile <- file.path(info$sec_dir, paste0("case-", info$case_slug, ".txt"))
145
+ outfile <- file.path(info$sec_dir, paste0(info$case_slug, ".png"))
146
+ txtfile <- file.path(info$sec_dir, paste0(info$case_slug, ".txt"))
152
147
 
153
148
  # subset the seurat object
154
149
  meta <- srtobj@meta.data
@@ -242,7 +237,7 @@ do_case <- function(name, case) {
242
237
  ),
243
238
  txtfile,
244
239
  sep = "\t",
245
- row.names = TRUE,
240
+ row.names = FALSE,
246
241
  col.names = TRUE,
247
242
  quote = FALSE
248
243
  )
@@ -143,11 +143,13 @@ for (name in names(cases)) {
143
143
  } else if (is.null(case$each)) {
144
144
  # is.null(case$ident.1)
145
145
  sections <- c(sections, name)
146
- idents <- srtobj@meta.data %>% pull(case$group.by) %>% unique() %>% na.omit()
147
- for (ident in idents) {
148
- newcases[[paste0(name, ":", ident)]] <- case
149
- newcases[[paste0(name, ":", ident)]]$ident.1 <- ident
150
- }
146
+ newcases[[name]] <- case
147
+ newcases[[name]]$findall <- TRUE
148
+ # idents <- srtobj@meta.data %>% pull(case$group.by) %>% unique() %>% na.omit()
149
+ # for (ident in idents) {
150
+ # newcases[[paste0(name, ":", ident)]] <- case
151
+ # newcases[[paste0(name, ":", ident)]]$ident.1 <- ident
152
+ # }
151
153
  } else {
152
154
  eachs <- srtobj@meta.data %>% pull(case$each) %>% unique() %>% na.omit()
153
155
  for (each in eachs) {
@@ -160,18 +162,22 @@ for (name in names(cases)) {
160
162
  )
161
163
  )
162
164
  if (is.null(case$ident.1)) {
163
- idents <- srtobj@meta.data %>% pull(case$group.by) %>% unique() %>% na.omit()
164
- for (ident in idents) {
165
- kname <- if (name == "DEFAULT") "" else paste0(" - ", name)
166
- sections <- c(sections, paste0(each, kname))
167
- key <- paste0(each, kname, ":", ident)
168
- if (case$prefix_each) {
169
- key <- paste0(case$each, " - ", key)
170
- }
171
- newcases[[key]] <- case
172
- newcases[[key]]$ident.1 <- ident
173
- newcases[[key]]$group.by <- by
174
- }
165
+ kname <- if (name == "DEFAULT") "" else paste0(" - ", name)
166
+ sections <- c(sections, paste0(each, kname))
167
+ key <- paste0(each, kname)
168
+ newcases[[key]] <- case
169
+ newcases[[key]]$group.by <- by
170
+ newcases[[key]]$findall <- TRUE
171
+ # idents <- srtobj@meta.data %>% pull(case$group.by) %>% unique() %>% na.omit()
172
+ # for (ident in idents) {
173
+ # key <- paste0(each, kname, ":", ident)
174
+ # if (case$prefix_each) {
175
+ # key <- paste0(case$each, " - ", key)
176
+ # }
177
+ # newcases[[key]] <- case
178
+ # newcases[[key]]$ident.1 <- ident
179
+ # newcases[[key]]$group.by <- by
180
+ # }
175
181
  } else {
176
182
  sections <- c(sections, case$each)
177
183
  key <- paste0(case$each, ":", each)
@@ -312,11 +318,11 @@ do_enrich <- function(info, markers, sig, volgenes) {
312
318
  }
313
319
 
314
320
 
315
- do_dotplot <- function(info, siggenes, case, args) {
316
- dotplot_devpars <- case$dotplot$devpars
321
+ do_dotplot <- function(info, siggenes, dotplot, args) {
322
+ dotplot_devpars <- dotplot$devpars
317
323
  if (is.null(args$ident.2)) {
318
- case$dotplot$object <- args$object
319
- case$dotplot$object@meta.data <- case$dotplot$object@meta.data %>%
324
+ dotplot$object <- args$object
325
+ dotplot$object@meta.data <- dotplot$object@meta.data %>%
320
326
  mutate(
321
327
  !!sym(args$group.by) := if_else(
322
328
  !!sym(args$group.by) == args$ident.1,
@@ -329,17 +335,16 @@ do_dotplot <- function(info, siggenes, case, args) {
329
335
  )
330
336
  )
331
337
  } else {
332
- case$dotplot$object <- args$object %>%
338
+ dotplot$object <- args$object %>%
333
339
  filter(!!sym(args$group.by) %in% c(args$ident.1, args$ident.2)) %>%
334
340
  mutate(!!sym(args$group.by) := factor(
335
341
  !!sym(args$group.by),
336
342
  levels = c(args$ident.1, args$ident.2)
337
343
  ))
338
344
  }
339
- case$dotplot$devpars <- NULL
340
- case$dotplot$features <- siggenes
341
- case$dotplot$group.by <- args$group.by
342
- case$dotplot$assay <- case$assay
345
+ dotplot$devpars <- NULL
346
+ dotplot$features <- siggenes
347
+ dotplot$group.by <- args$group.by
343
348
  dotplot_width = ifelse(
344
349
  is.null(dotplot_devpars$width),
345
350
  if (length(siggenes) <= 20) length(siggenes) * 60 else length(siggenes) * 30,
@@ -351,7 +356,7 @@ do_dotplot <- function(info, siggenes, case, args) {
351
356
  png(dotplot_file, res = dotplot_res, width = dotplot_height, height = dotplot_width)
352
357
  # rotate x axis labels
353
358
  print(
354
- do_call(DotPlot, case$dotplot) +
359
+ do_call(DotPlot, dotplot) +
355
360
  theme(axis.text.x = element_text(angle = 90, hjust = 1)) +
356
361
  coord_flip()
357
362
  )
@@ -456,9 +461,79 @@ add_case_report <- function(info, sigmarkers, siggenes) {
456
461
  }
457
462
 
458
463
 
464
+ do_case_findall <- function(casename) {
465
+ log_info("- Using FindAllMarkers for case: {casename}...")
466
+
467
+ case = cases[[casename]]
468
+ args <- case$rest
469
+ args$group.by <- case$group.by
470
+ if (is.null(args$logfc.threshold)) {
471
+ args$locfc.threshold <- 0
472
+ }
473
+ if (is.null(args$min.cells.group)) {
474
+ args$min.cells.group <- 1
475
+ }
476
+ if (is.null(args$min.cells.feature)) {
477
+ args$min.cells.feature <- 1
478
+ }
479
+ if (is.null(args$min.pct)) {
480
+ args$min.pct <- 0
481
+ }
482
+ if (!is.null(case$subset)) {
483
+ args$object <- srtobj %>% filter(!!parse_expr(case$subset) & filter(!is.na(!!sym(case$group.by))))
484
+ } else {
485
+ args$object <- srtobj %>% filter(!is.na(!!sym(case$group.by)))
486
+ }
487
+ Idents(args$object) <- case$group.by
488
+ markers <- tryCatch({
489
+ do_call(FindAllMarkers, args)
490
+ # gene, p_val, avg_log2FC, pct.1, pct.2, p_val_adj, cluster
491
+ }, error = function(e) {
492
+ log_warn(e$message)
493
+ data.frame(
494
+ gene = character(),
495
+ p_val = numeric(),
496
+ avg_log2FC = numeric(),
497
+ pct.1 = numeric(),
498
+ pct.2 = numeric(),
499
+ p_val_adj=numeric(),
500
+ cluster = character()
501
+ )
502
+ })
503
+
504
+ if (is.null(case$dotplot$assay)) {
505
+ case$dotplot$assay <- assay
506
+ }
507
+ idents <- unique(markers$cluster)
508
+ for (ident in idents) {
509
+ log_info("- Dealing with ident: {ident}...")
510
+ info <- casename_info(paste0(casename, ":", ident), create = TRUE)
511
+ siggenes <- do_enrich(info, markers %>% filter(cluster == ident), case$sigmarkers, case$volcano_genes)
512
+
513
+ if (length(siggenes) > 0) {
514
+ args$ident.1 <- as.character(ident)
515
+ do_dotplot(info, siggenes, case$dotplot, args)
516
+ }
517
+ add_case_report(info, case$sigmarkers, siggenes)
518
+
519
+ if (info$section %in% overlap) {
520
+ if (is.null(overlaps[[info$section]])) {
521
+ overlaps[[info$section]] <<- list()
522
+ }
523
+ overlaps[[info$section]][[info$case]] <<- siggenes
524
+ }
525
+ }
526
+ }
527
+
528
+
459
529
  do_case <- function(casename) {
460
530
  log_info("Dealing with case: {casename}...")
461
531
 
532
+ if (isTRUE(cases[[casename]]$findall)) {
533
+ do_case_findall(casename)
534
+ return()
535
+ }
536
+
462
537
  info <- casename_info(casename, create = TRUE)
463
538
  case <- cases[[casename]]
464
539
  # ident1
@@ -507,7 +582,10 @@ do_case <- function(casename) {
507
582
  siggenes <- do_enrich(info, markers, case$sigmarkers, case$volcano_genes)
508
583
 
509
584
  if (length(siggenes) > 0) {
510
- do_dotplot(info, siggenes, case, args)
585
+ if (is.null(case$dotplot$assay)) {
586
+ case$dotplot$assay <- assay
587
+ }
588
+ do_dotplot(info, siggenes, case$dotplot, args)
511
589
  }
512
590
 
513
591
  if (info$section %in% overlap) {
@@ -173,8 +173,8 @@ do_one_features = function(name) {
173
173
  rownames_to_column("Feature") %>%
174
174
  select(Feature, everything())
175
175
 
176
- exprfile = paste0(slugify(name), ".txt")
177
- write.table(expr, file.path(odir, exprfile), sep="\t", quote=FALSE, row.names=FALSE)
176
+ exprfile = file.path(odir, paste0(slugify(name), ".txt"))
177
+ write.table(expr, exprfile, sep="\t", quote=FALSE, row.names=FALSE)
178
178
 
179
179
  add_report(
180
180
  list(