biopipen 0.27.0__tar.gz → 0.27.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 (245) hide show
  1. {biopipen-0.27.0 → biopipen-0.27.2}/PKG-INFO +1 -1
  2. biopipen-0.27.2/biopipen/__init__.py +1 -0
  3. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/ns/scrna.py +9 -12
  4. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/ns/snp.py +18 -15
  5. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/ns/tcr.py +73 -0
  6. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/scrna/RadarPlots.R +2 -2
  7. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/scrna/SeuratMap2Ref.R +38 -37
  8. biopipen-0.27.2/biopipen/scripts/snp/PlinkSimulation.py +124 -0
  9. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/stats/DiffCoexpr.R +3 -3
  10. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/tcr/CloneResidency.R +16 -4
  11. biopipen-0.27.2/biopipen/scripts/tcr/TCRDock.py +106 -0
  12. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/utils/misc.py +5 -1
  13. {biopipen-0.27.0 → biopipen-0.27.2}/pyproject.toml +1 -1
  14. {biopipen-0.27.0 → biopipen-0.27.2}/setup.py +3 -3
  15. biopipen-0.27.0/biopipen/__init__.py +0 -1
  16. biopipen-0.27.0/biopipen/scripts/snp/PlinkSimulation.py +0 -88
  17. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/core/__init__.py +0 -0
  18. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/core/config.py +0 -0
  19. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/core/config.toml +0 -0
  20. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/core/defaults.py +0 -0
  21. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/core/filters.py +0 -0
  22. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/core/proc.py +0 -0
  23. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/core/testing.py +0 -0
  24. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/ns/__init__.py +0 -0
  25. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/ns/bam.py +0 -0
  26. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/ns/bcftools.py +0 -0
  27. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/ns/bed.py +0 -0
  28. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/ns/cellranger.py +0 -0
  29. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/ns/cellranger_pipeline.py +0 -0
  30. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/ns/cnv.py +0 -0
  31. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/ns/cnvkit.py +0 -0
  32. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/ns/cnvkit_pipeline.py +0 -0
  33. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/ns/delim.py +0 -0
  34. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/ns/gene.py +0 -0
  35. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/ns/gsea.py +0 -0
  36. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/ns/misc.py +0 -0
  37. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/ns/plot.py +0 -0
  38. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/ns/rnaseq.py +0 -0
  39. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/ns/scrna_metabolic_landscape.py +0 -0
  40. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/ns/stats.py +0 -0
  41. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/ns/tcgamaf.py +0 -0
  42. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/ns/vcf.py +0 -0
  43. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/ns/web.py +0 -0
  44. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/reports/bam/CNAClinic.svelte +0 -0
  45. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/reports/bam/CNVpytor.svelte +0 -0
  46. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/reports/bam/ControlFREEC.svelte +0 -0
  47. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/reports/cellranger/CellRangerCount.svelte +0 -0
  48. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/reports/cellranger/CellRangerSummary.svelte +0 -0
  49. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/reports/cellranger/CellRangerVdj.svelte +0 -0
  50. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/reports/cnv/AneuploidyScore.svelte +0 -0
  51. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/reports/cnv/AneuploidyScoreSummary.svelte +0 -0
  52. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/reports/cnv/TMADScoreSummary.svelte +0 -0
  53. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/reports/cnvkit/CNVkitDiagram.svelte +0 -0
  54. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/reports/cnvkit/CNVkitHeatmap.svelte +0 -0
  55. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/reports/cnvkit/CNVkitScatter.svelte +0 -0
  56. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/reports/delim/SampleInfo.svelte +0 -0
  57. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/reports/gsea/FGSEA.svelte +0 -0
  58. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/reports/gsea/GSEA.svelte +0 -0
  59. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/reports/scrna/CellsDistribution.svelte +0 -0
  60. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/reports/scrna/DimPlots.svelte +0 -0
  61. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/reports/scrna/MarkersFinder.svelte +0 -0
  62. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/reports/scrna/MetaMarkers.svelte +0 -0
  63. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/reports/scrna/RadarPlots.svelte +0 -0
  64. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/reports/scrna/ScFGSEA.svelte +0 -0
  65. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/reports/scrna/SeuratClusterStats.svelte +0 -0
  66. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/reports/scrna/SeuratMap2Ref.svelte +0 -0
  67. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/reports/scrna/SeuratPreparing.svelte +0 -0
  68. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/reports/scrna/TopExpressingGenes.svelte +0 -0
  69. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/reports/scrna_metabolic_landscape/MetabolicFeatures.svelte +0 -0
  70. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/reports/scrna_metabolic_landscape/MetabolicFeaturesIntraSubset.svelte +0 -0
  71. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/reports/scrna_metabolic_landscape/MetabolicPathwayActivity.svelte +0 -0
  72. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/reports/scrna_metabolic_landscape/MetabolicPathwayHeterogeneity.svelte +0 -0
  73. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/reports/tcr/CDR3AAPhyschem.svelte +0 -0
  74. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/reports/tcr/CloneResidency.svelte +0 -0
  75. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/reports/tcr/Immunarch.svelte +0 -0
  76. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/reports/tcr/SampleDiversity.svelte +0 -0
  77. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/reports/tcr/TCRClusterStats.svelte +0 -0
  78. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/reports/tcr/TESSA.svelte +0 -0
  79. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/reports/tcr/VJUsage.svelte +0 -0
  80. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/reports/utils/gsea.liq +0 -0
  81. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/reports/utils/misc.liq +0 -0
  82. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/reports/vcf/TruvariBenchSummary.svelte +0 -0
  83. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/reports/vcf/TruvariConsistency.svelte +0 -0
  84. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/bam/BamMerge.py +0 -0
  85. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/bam/BamSplitChroms.py +0 -0
  86. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/bam/CNAClinic.R +0 -0
  87. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/bam/CNVpytor.py +0 -0
  88. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/bam/ControlFREEC.py +0 -0
  89. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/bcftools/BcftoolsAnnotate.py +0 -0
  90. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/bcftools/BcftoolsFilter.py +0 -0
  91. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/bcftools/BcftoolsSort.py +0 -0
  92. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/bed/Bed2Vcf.py +0 -0
  93. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/bed/BedConsensus.py +0 -0
  94. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/bed/BedLiftOver.sh +0 -0
  95. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/bed/BedtoolsMerge.py +0 -0
  96. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/cellranger/CellRangerCount.py +0 -0
  97. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/cellranger/CellRangerSummary.R +0 -0
  98. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/cellranger/CellRangerVdj.py +0 -0
  99. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/cnv/AneuploidyScore.R +0 -0
  100. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/cnv/AneuploidyScoreSummary.R +0 -0
  101. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/cnv/TMADScore.R +0 -0
  102. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/cnv/TMADScoreSummary.R +0 -0
  103. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/cnvkit/CNVkitAccess.py +0 -0
  104. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/cnvkit/CNVkitAutobin.py +0 -0
  105. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/cnvkit/CNVkitBatch.py +0 -0
  106. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/cnvkit/CNVkitCall.py +0 -0
  107. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/cnvkit/CNVkitCoverage.py +0 -0
  108. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/cnvkit/CNVkitDiagram.py +0 -0
  109. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/cnvkit/CNVkitFix.py +0 -0
  110. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/cnvkit/CNVkitGuessBaits.py +0 -0
  111. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/cnvkit/CNVkitHeatmap.py +0 -0
  112. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/cnvkit/CNVkitReference.py +0 -0
  113. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/cnvkit/CNVkitScatter.py +0 -0
  114. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/cnvkit/CNVkitSegment.py +0 -0
  115. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/cnvkit/guess_baits.py +0 -0
  116. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/delim/RowsBinder.R +0 -0
  117. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/delim/SampleInfo.R +0 -0
  118. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/gene/GeneNameConversion.py +0 -0
  119. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/gsea/Enrichr.R +0 -0
  120. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/gsea/FGSEA.R +0 -0
  121. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/gsea/GSEA.R +0 -0
  122. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/gsea/PreRank.R +0 -0
  123. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/misc/Config2File.py +0 -0
  124. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/misc/Str2File.py +0 -0
  125. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/plot/Heatmap.R +0 -0
  126. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/plot/VennDiagram.R +0 -0
  127. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/rnaseq/Simulation-ESCO.R +0 -0
  128. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/rnaseq/Simulation-RUVcorr.R +0 -0
  129. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/rnaseq/Simulation.R +0 -0
  130. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/rnaseq/UnitConversion.R +0 -0
  131. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/scrna/AnnData2Seurat.R +0 -0
  132. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/scrna/CellTypeAnnotation-celltypist.R +0 -0
  133. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/scrna/CellTypeAnnotation-direct.R +0 -0
  134. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/scrna/CellTypeAnnotation-hitype.R +0 -0
  135. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/scrna/CellTypeAnnotation-sccatch.R +0 -0
  136. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/scrna/CellTypeAnnotation-sctype.R +0 -0
  137. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/scrna/CellTypeAnnotation.R +0 -0
  138. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/scrna/CellsDistribution.R +0 -0
  139. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/scrna/DimPlots.R +0 -0
  140. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/scrna/ExprImpution-alra.R +0 -0
  141. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/scrna/ExprImpution-rmagic.R +0 -0
  142. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/scrna/ExprImpution-scimpute.R +0 -0
  143. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/scrna/ExprImpution.R +0 -0
  144. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/scrna/MarkersFinder.R +0 -0
  145. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/scrna/MetaMarkers.R +0 -0
  146. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/scrna/ModuleScoreCalculator.R +0 -0
  147. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/scrna/SCImpute.R +0 -0
  148. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/scrna/ScFGSEA.R +0 -0
  149. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/scrna/Seurat2AnnData.R +0 -0
  150. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/scrna/SeuratClusterStats-dimplots.R +0 -0
  151. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/scrna/SeuratClusterStats-features.R +0 -0
  152. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/scrna/SeuratClusterStats-hists.R +0 -0
  153. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/scrna/SeuratClusterStats-ngenes.R +0 -0
  154. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/scrna/SeuratClusterStats-stats.R +0 -0
  155. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/scrna/SeuratClusterStats.R +0 -0
  156. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/scrna/SeuratClustering.R +0 -0
  157. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/scrna/SeuratFilter.R +0 -0
  158. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/scrna/SeuratLoading.R +0 -0
  159. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/scrna/SeuratMetadataMutater.R +0 -0
  160. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/scrna/SeuratPreparing.R +0 -0
  161. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/scrna/SeuratSplit.R +0 -0
  162. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/scrna/SeuratSubClustering.R +0 -0
  163. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/scrna/SeuratSubset.R +0 -0
  164. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/scrna/SeuratTo10X.R +0 -0
  165. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/scrna/TopExpressingGenes.R +0 -0
  166. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/scrna/Write10X.R +0 -0
  167. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/scrna/celltypist-wrapper.py +0 -0
  168. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/scrna/sctype.R +0 -0
  169. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/scrna_metabolic_landscape/MetabolicFeatures.R +0 -0
  170. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/scrna_metabolic_landscape/MetabolicFeaturesIntraSubset.R +0 -0
  171. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/scrna_metabolic_landscape/MetabolicPathwayActivity.R +0 -0
  172. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/scrna_metabolic_landscape/MetabolicPathwayHeterogeneity.R +0 -0
  173. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/stats/ChowTest.R +0 -0
  174. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/stats/LiquidAssoc.R +0 -0
  175. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/stats/MetaPvalue.R +0 -0
  176. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/tcgamaf/Maf2Vcf.py +0 -0
  177. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/tcgamaf/MafAddChr.py +0 -0
  178. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/tcgamaf/maf2vcf.pl +0 -0
  179. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/tcr/Attach2Seurat.R +0 -0
  180. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/tcr/CDR3AAPhyschem.R +0 -0
  181. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/tcr/CloneSizeQQPlot.R +0 -0
  182. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/tcr/GIANA/GIANA.py +0 -0
  183. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/tcr/GIANA/GIANA4.py +0 -0
  184. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/tcr/GIANA/Imgt_Human_TRBV.fasta +0 -0
  185. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/tcr/GIANA/query.py +0 -0
  186. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/tcr/Immunarch-basic.R +0 -0
  187. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/tcr/Immunarch-clonality.R +0 -0
  188. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/tcr/Immunarch-diversity.R +0 -0
  189. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/tcr/Immunarch-geneusage.R +0 -0
  190. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/tcr/Immunarch-kmer.R +0 -0
  191. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/tcr/Immunarch-overlap.R +0 -0
  192. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/tcr/Immunarch-spectratyping.R +0 -0
  193. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/tcr/Immunarch-tracking.R +0 -0
  194. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/tcr/Immunarch-vjjunc.R +0 -0
  195. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/tcr/Immunarch.R +0 -0
  196. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/tcr/Immunarch2VDJtools.R +0 -0
  197. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/tcr/ImmunarchFilter.R +0 -0
  198. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/tcr/ImmunarchLoading.R +0 -0
  199. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/tcr/ImmunarchSplitIdents.R +0 -0
  200. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/tcr/SampleDiversity.R +0 -0
  201. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/tcr/TCRClusterStats.R +0 -0
  202. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/tcr/TCRClustering.R +0 -0
  203. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/tcr/TESSA.R +0 -0
  204. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/tcr/TESSA_source/Atchley_factors.csv +0 -0
  205. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/tcr/TESSA_source/BriseisEncoder.py +0 -0
  206. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/tcr/TESSA_source/MCMC_control.R +0 -0
  207. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/tcr/TESSA_source/TrainedEncoder.h5 +0 -0
  208. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/tcr/TESSA_source/fixed_b.csv +0 -0
  209. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/tcr/TESSA_source/initialization.R +0 -0
  210. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/tcr/TESSA_source/post_analysis.R +0 -0
  211. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/tcr/TESSA_source/real_data.R +0 -0
  212. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/tcr/TESSA_source/update.R +0 -0
  213. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/tcr/TESSA_source/utility.R +0 -0
  214. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/tcr/VJUsage.R +0 -0
  215. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/tcr/immunarch-patched.R +0 -0
  216. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/tcr/vdjtools-patch.sh +0 -0
  217. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/vcf/TruvariBench.sh +0 -0
  218. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/vcf/TruvariBenchSummary.R +0 -0
  219. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/vcf/TruvariConsistency.R +0 -0
  220. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/vcf/Vcf2Bed.py +0 -0
  221. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/vcf/VcfAnno.py +0 -0
  222. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/vcf/VcfDownSample.sh +0 -0
  223. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/vcf/VcfFilter.py +0 -0
  224. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/vcf/VcfFix.py +0 -0
  225. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/vcf/VcfFix_utils.py +0 -0
  226. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/vcf/VcfIndex.py +0 -0
  227. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/vcf/VcfIntersect.py +0 -0
  228. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/vcf/VcfLiftOver.sh +0 -0
  229. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/vcf/VcfSplitSamples.py +0 -0
  230. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/web/Download.py +0 -0
  231. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/scripts/web/DownloadList.py +0 -0
  232. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/utils/__init__.py +0 -0
  233. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/utils/caching.R +0 -0
  234. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/utils/common_docstrs.py +0 -0
  235. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/utils/gene.R +0 -0
  236. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/utils/gene.py +0 -0
  237. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/utils/gsea.R +0 -0
  238. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/utils/io.R +0 -0
  239. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/utils/misc.R +0 -0
  240. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/utils/mutate_helpers.R +0 -0
  241. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/utils/plot.R +0 -0
  242. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/utils/reference.py +0 -0
  243. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/utils/rnaseq.R +0 -0
  244. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/utils/single_cell.R +0 -0
  245. {biopipen-0.27.0 → biopipen-0.27.2}/biopipen/utils/vcf.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: biopipen
3
- Version: 0.27.0
3
+ Version: 0.27.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.27.2"
@@ -1761,14 +1761,12 @@ class SeuratMap2Ref(Proc):
1761
1761
  Used in `future::plan(strategy = "multicore", workers = <ncores>)`
1762
1762
  to parallelize some Seurat procedures.
1763
1763
  See also: <https://satijalab.org/seurat/articles/future_vignette.html>
1764
- use: A column name (e.g. `predicted.celltype.l1`, `predicted.celltype.l2`)
1765
- to use as the final cell types in downstream analysis, which will be stored
1766
- in the `name` column and set as the `Idents` of the seurat object.
1767
- Or an expression to pass to `mutate()` to create a new column.
1768
- When not specified, `predicted.<key>` will be used if
1769
- `envs.MapQuery.refdata` has only one key, otherwise an error will be raised.
1770
- name: The name of the final cell type column.
1771
- This will be set as the `Idents` of the seurat object.
1764
+ use: A column name of metadata from the reference
1765
+ (e.g. `celltype.l1`, `celltype.l2`) to transfer to the query as the
1766
+ cell types (ident) for downstream analysis. This field is required.
1767
+ If you want to transfer multiple columns, you can use
1768
+ `envs.MapQuery.refdata`.
1769
+ ident: The name of the ident for query transferred from `envs.use` of the reference.
1772
1770
  ref: The reference seurat object file.
1773
1771
  Either an RDS file or a h5seurat file that can be loaded by
1774
1772
  `Seurat::LoadH5Seurat()`.
@@ -1790,8 +1788,8 @@ class SeuratMap2Ref(Proc):
1790
1788
  Note that the hyphen (`-`) will be transformed into `.` for the keys.
1791
1789
  MapQuery (ns): Arguments for [`MapQuery()`](https://satijalab.org/seurat/reference/mapquery)
1792
1790
  - reference-reduction: Name of reduction to use from the reference for neighbor finding
1793
- - reduction-model: `DimReduc` object that contains the umap model
1794
- - refdata (type=json): Data to transfer
1791
+ - reduction-model: `DimReduc` object that contains the umap model.
1792
+ - refdata (type=json): Extra data to transfer from the reference to the query.
1795
1793
  - <more>: See <https://satijalab.org/seurat/reference/mapquery>.
1796
1794
  Note that the hyphen (`-`) will be transformed into `.` for the keys.
1797
1795
  MappingScore (ns): Arguments for [`MappingScore()`](https://satijalab.org/seurat/reference/mappingscore)
@@ -1807,9 +1805,8 @@ class SeuratMap2Ref(Proc):
1807
1805
  lang = config.lang.rscript
1808
1806
  envs = {
1809
1807
  "ncores": config.misc.ncores,
1810
- # "use": "predicted.celltype.l2",
1811
1808
  "use": None,
1812
- "name": "seurat_clusters",
1809
+ "ident": "seurat_clusters",
1813
1810
  "ref": None,
1814
1811
  "SCTransform": {
1815
1812
  "do-correct-umi": False,
@@ -7,12 +7,15 @@ from ..core.config import config
7
7
  class PlinkSimulation(Proc):
8
8
  """Simulate SNPs using PLINK v1.9
9
9
 
10
- See also <https://www.cog-genomics.org/plink/1.9/input#simulate>.
10
+ See also <https://www.cog-genomics.org/plink/1.9/input#simulate> and
11
+ <https://pwwang.github.io/biopipen/api/biopipen.ns.snp/#biopipen.ns.snp.PlinkSimulation>
11
12
 
12
13
  Input:
13
- nsnps: Number of SNPs to simulate
14
- ncases: Number of cases to simulate
15
- nctrls: Number of controls to simulate
14
+ configfile: Configuration file containing the parameters for the simulation.
15
+ The configuration file (in toml, yaml or json format) should contain a
16
+ dictionary of parameters. The parameters are listed in `envs` except
17
+ `ncores`, which is used for parallelization. You can set parameters
18
+ in `envs` and override them in the configuration file.
16
19
 
17
20
  Output:
18
21
  outdir: Output directory containing the simulated data
@@ -21,9 +24,11 @@ class PlinkSimulation(Proc):
21
24
  SNPs and columns representing samples.
22
25
 
23
26
  Envs:
27
+ nsnps (type=int): Number of SNPs to simulate
28
+ ncases (type=int): Number of cases to simulate
29
+ nctrls (type=int): Number of controls to simulate
24
30
  plink: Path to PLINK v1.9
25
- seed (type=int): Random seed.
26
- If not set, seed will not be set.
31
+ seed (type=int): Random seed. If not set, seed will not be set.
27
32
  label: Prefix label for the SNPs.
28
33
  prevalence (type=float): Disease prevalence.
29
34
  minfreq (type=float): Minimum allele frequency.
@@ -41,19 +46,17 @@ class PlinkSimulation(Proc):
41
46
  This only affects the sample names in the genotype matrix file
42
47
  (`out.gtmat`).
43
48
  """
44
- input = "nsnps:var, ncases:var, nctrls:var"
49
+ input = "configfile:file"
45
50
  output = [
46
- (
47
- "outdir:dir:{{in.nsnps | int}}_"
48
- "{{in.ncases | int}}xcases_{{in.nctrls | int}}xctrls.plink_sim"
49
- ),
50
- (
51
- "gtmat:file:{{in.nsnps | int}}_"
52
- "{{in.ncases | int}}xcases_{{in.nctrls | int}}xctrls.plink_sim/gtmat.txt"
53
- ),
51
+ "outdir:dir:{{in.configfile | stem}}.plink_sim",
52
+ "gtmat:file:{{in.configfile | stem}}.plink_sim/"
53
+ "{{in.configfile | stem}}-gtmat.txt",
54
54
  ]
55
55
  lang = config.lang.python
56
56
  envs = {
57
+ "nsnps": None,
58
+ "ncases": None,
59
+ "nctrls": None,
57
60
  "plink": config.exe.plink,
58
61
  "seed": None,
59
62
  "label": "SNP",
@@ -983,6 +983,7 @@ class CloneResidency(Proc):
983
983
  before calculating the clone residency. For example, `Clones > 1` to filter
984
984
  out singletons.
985
985
  prefix: The prefix of the cell barcodes in the `Seurat` object.
986
+ upset_ymax: The maximum value of the y-axis in the upset bar plots.
986
987
  upset_trans: The transformation to apply to the y axis of upset bar plots.
987
988
  For example, `log10` or `sqrt`. If not specified, the y axis will be
988
989
  plotted as is. Note that the position of the bar plots will be dodged
@@ -1007,6 +1008,7 @@ class CloneResidency(Proc):
1007
1008
  "mutaters": {},
1008
1009
  "subset": None,
1009
1010
  "prefix": "{Sample}_",
1011
+ "upset_ymax": None,
1010
1012
  "upset_trans": None,
1011
1013
  "cases": {},
1012
1014
  }
@@ -1595,3 +1597,74 @@ class TESSA(Proc):
1595
1597
  }
1596
1598
  script = "file://../scripts/tcr/TESSA.R"
1597
1599
  plugin_opts = {"report": "file://../reports/tcr/TESSA.svelte"}
1600
+
1601
+
1602
+ class TCRDock(Proc):
1603
+ """Using TCRDock to predict the structure of MHC-peptide-TCR complexes
1604
+
1605
+ See <https://github.com/phbradley/TCRdock>.
1606
+
1607
+ Input:
1608
+ configfile: The config file for TCRDock
1609
+ It's should be a toml file with the keys listed in `envs`, including
1610
+ `organism`, `mhc_class`, `mhc`, `peptide`, `va`, `ja`, `vb`, `jb`,
1611
+ `cdr3a`, and `cdr3b`.
1612
+ The values will overwrite the values in `envs`.
1613
+
1614
+ Output:
1615
+ outdir: The output directory containing the results
1616
+
1617
+ Envs:
1618
+ organism: The organism of the TCR, peptide and MHC
1619
+ mhc_class (type=int): The MHC class, either `1` or `2`
1620
+ mhc: The MHC allele, e.g., `A*02:01`
1621
+ peptide: The peptide sequence
1622
+ va: The V alpha gene
1623
+ ja: The J alpha gene
1624
+ vb: The V beta gene
1625
+ jb: The J beta gene
1626
+ cdr3a: The CDR3 alpha sequence
1627
+ cdr3b: The CDR3 beta sequence
1628
+ python: The path of python with dependencies for `tcrdock` installed.
1629
+ If not provided, `TCRDock.lang` will be used (the same interpreter
1630
+ used for the wrapper script).
1631
+ It could also be a list to specify, for example, a python in a conda
1632
+ environment (e.g., `["conda", "run", "-n", "myenv", "python"]`).
1633
+ tmpdir: The temporary directory used to clone the `tcrdock` source code if
1634
+ `envs.tcrdock` is not provided.
1635
+ tcrdock: The path to the `tcrdock` source code repo.
1636
+ You need to clone the source code from the github repository.
1637
+ <https://github.com/phbradley/TCRdock> at
1638
+ revision c5a7af42eeb0c2a4492a4d4fe803f1f9aafb6193 at main branch.
1639
+ You also have to run `download_blast.py` after cloning to download the
1640
+ blast database in the directory.
1641
+ If not provided, we will clone the source code to the `envs.tmpdir`
1642
+ directory and run the `download_blast.py` script.
1643
+ model_name: The model name to use
1644
+ model_file: The model file to use.
1645
+ If provided as a relative path, it should be relative to the
1646
+ `<envs.data_dir>/params/`, otherwise, it should be the full path.
1647
+ data_dir: The data directory that contains the model files.
1648
+ The model files should be in the `params` subdirectory.
1649
+ """
1650
+ input = "configfile:file"
1651
+ output = "outdir:dir:{{in.configfile | stem}}.tcrdock"
1652
+ lang = config.lang.python
1653
+ envs = {
1654
+ "tcrdock": None,
1655
+ "organism": "human",
1656
+ "mhc_class": 1,
1657
+ "mhc": "A*02:01",
1658
+ "peptide": None,
1659
+ "va": None,
1660
+ "ja": None,
1661
+ "vb": None,
1662
+ "jb": None,
1663
+ "cdr3a": None,
1664
+ "cdr3b": None,
1665
+ "python": None,
1666
+ "model_name": "model_2_ptm_ft4",
1667
+ "model_file": "tcrpmhc_run4_af_mhc_params_891.pkl",
1668
+ "data_dir": None,
1669
+ }
1670
+ script = "file://../scripts/tcr/TCRDock.py"
@@ -74,10 +74,10 @@ expand_each <- function(name, case) {
74
74
  }
75
75
  } else {
76
76
  if (is.null(case$subset)) {
77
- eachs <- srtobj@meta.data %>%
77
+ eachs <- meta %>%
78
78
  pull(case$each) %>% unique() %>% na.omit() %>% as.vector()
79
79
  } else {
80
- eachs <- srtobj@meta.data %>% filter(!!parse_expr(case$subset)) %>%
80
+ eachs <- meta %>% filter(!!parse_expr(case$subset)) %>%
81
81
  pull(case$each) %>% unique() %>% na.omit() %>% as.vector()
82
82
  }
83
83
  for (each in eachs) {
@@ -10,7 +10,7 @@ set.seed(8525)
10
10
  sobjfile = {{in.sobjfile | r}}
11
11
  outfile = {{out.outfile | r}}
12
12
  use = {{envs.use | r}}
13
- name = {{envs.name | r}}
13
+ ident = {{envs.ident | r}}
14
14
  ref = {{envs.ref | r}}
15
15
  ncores = {{envs.ncores | r}}
16
16
  sctransform_args = {{envs.SCTransform | r: todot="-"}}
@@ -18,23 +18,21 @@ findtransferanchors_args = {{envs.FindTransferAnchors | r: todot="-"}}
18
18
  mappingscore_args = {{envs.MappingScore | r: todot="-"}}
19
19
  mapquery_args = {{envs.MapQuery | r: todot="-"}}
20
20
 
21
- if (is.null(mapquery_args$refdata) || length(mapquery_args$refdata) == 0) {
22
- stop("No refdata provided for MapQuery (envs.MapQuery.refdata)")
23
- }
24
-
25
21
  # See if we have a reference
26
22
  if (is.null(ref)) {
27
23
  stop("No reference provided (envs.ref)")
28
24
  }
29
25
 
30
26
  if (is.null(use)) {
31
- if (length(mapquery_args$refdata) == 1) {
32
- use = paste0("predicted.", names(mapquery_args$refdata)[1])
33
- } else {
34
- stop("No use provided (envs.use), don't know which column to use as cluster")
35
- }
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()
36
32
  }
37
33
 
34
+ mapquery_args$refdata[[use]] = use
35
+
38
36
  outdir = dirname(outfile)
39
37
  options(future.globals.maxSize = 80000 * 1024^2)
40
38
  plan(strategy = "multicore", workers = ncores)
@@ -49,7 +47,7 @@ plan(strategy = "multicore", workers = ncores)
49
47
  findtransferanchors_args = .expand_dims(findtransferanchors_args)
50
48
 
51
49
  # Load reference
52
- log_info("Loading reference")
50
+ log_info("- Loading reference")
53
51
  if (endsWith(ref, ".rds") || endsWith(ref, ".RDS")) {
54
52
  reference = readRDS(ref)
55
53
  } else if (endsWith(ref, ".h5ad") || endsWith(ref, ".H5AD")) {
@@ -59,30 +57,30 @@ if (endsWith(ref, ".rds") || endsWith(ref, ".RDS")) {
59
57
  }
60
58
 
61
59
  # Load Seurat object
62
- log_info("Loading Seurat object")
60
+ log_info("- Loading Seurat object")
63
61
  sobj = readRDS(sobjfile)
64
62
 
65
63
  # Normalize data
66
- log_info("Normalizing data")
64
+ log_info("- Normalizing data")
67
65
  sctransform_args$object = sobj
68
66
  sctransform_args$residual.features = rownames(x = reference)
69
67
  query = do_call(SCTransform, sctransform_args)
70
68
 
71
69
  # Find anchors between query and reference
72
- log_info("Finding anchors")
70
+ log_info("- Finding anchors")
73
71
  findtransferanchors_args$reference = reference
74
72
  findtransferanchors_args$query = query
75
73
  anchors = do_call(FindTransferAnchors, findtransferanchors_args)
76
74
 
77
75
  # Map query to reference
78
- log_info("Mapping query to reference")
76
+ log_info("- Mapping query to reference")
79
77
  mapquery_args$reference = reference
80
78
  mapquery_args$query = query
81
79
  mapquery_args$anchorset = anchors
82
80
  query = do_call(MapQuery, mapquery_args)
83
81
 
84
82
  # Calculating mapping score
85
- log_info("Calculating mapping score")
83
+ log_info("- Calculating mapping score")
86
84
  mappingscore_args$anchors = anchors
87
85
  mappingscore = tryCatch({
88
86
  do_call(MappingScore, mappingscore_args)
@@ -98,7 +96,7 @@ mappingscore = tryCatch({
98
96
  })
99
97
 
100
98
  # Calculate mapping score and add to metadata
101
- log_info("Calculating mapping score")
99
+ log_info("- Calculating mapping score")
102
100
  query = AddMetaData(
103
101
  object = query,
104
102
  metadata = mappingscore,
@@ -106,12 +104,14 @@ query = AddMetaData(
106
104
  )
107
105
 
108
106
  # Add the alias to the metadata for the clusters
109
- log_info("Adding name to metadata and set as ident")
110
- query@meta.data = query@meta.data %>% mutate(!!sym(name) := as.factor(!!parse_expr(use)))
111
- Idents(query) = name
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
112
 
113
113
  # Save
114
- log_info("Saving")
114
+ log_info("- Saving result ...")
115
115
  saveRDS(query, file = outfile)
116
116
 
117
117
 
@@ -120,36 +120,37 @@ saveRDS(query, file = outfile)
120
120
  # ############################
121
121
 
122
122
  # # Plot the UMAP
123
- log_info("Plotting")
124
- for (refname in names(mapquery_args$refdata)) {
125
- if (refname == "predicted_ADT") {
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}")
126
130
  next
127
131
  }
128
- reduction = if (is.null(mapquery_args$reduction.model)) "wnn.umap" else mapquery_args$reduction.model
129
- print(paste0("Plotting UMAP for ", refname))
130
- p = DimPlot(
132
+
133
+ log_info(" Plotting transferred data: {qname} -> {rname}")
134
+
135
+ ref_p <- DimPlot(
131
136
  object = reference,
132
- reduction = reduction,
133
- group.by = refname,
137
+ reduction = ref.reduction,
138
+ group.by = rname,
134
139
  label = TRUE,
135
140
  label.size = 3,
136
141
  repel = TRUE,
137
142
  ) + NoLegend()
138
143
 
139
- png(file.path(outdir, paste0("Reference_UMAP_", refname, ".png")), width = 1000, height = 1000, res = 100)
140
- print(p)
141
- dev.off()
142
-
143
- p = DimPlot(
144
+ query_p <- DimPlot(
144
145
  object = query,
145
146
  reduction = "ref.umap",
146
- group.by = paste0("predicted.", refname),
147
+ group.by = paste0("predicted.", qname),
147
148
  label = TRUE,
148
149
  label.size = 3,
149
150
  repel = TRUE,
150
151
  ) + NoLegend()
151
152
 
152
- png(file.path(outdir, paste0("Query_UMAP_", refname, ".png")), width = 1000, height = 1000, res = 100)
153
- print(p)
153
+ png(file.path(outdir, paste0("UMAPs.png")), width = 1400, height = 700, res = 100)
154
+ print(ref_p | query_p)
154
155
  dev.off()
155
156
  }
@@ -0,0 +1,124 @@
1
+ from pathlib import Path
2
+ from multiprocessing import Pool
3
+ from slugify import slugify
4
+ from simpleconf import Config
5
+ from biopipen.utils.misc import logger, run_command, dict_to_cli_args
6
+
7
+ configfile = {{in.configfile | repr}} # pyright: ignore # noqa: E999
8
+ outdir = {{out.outdir | repr}} # pyright: ignore
9
+ gtmatfile = {{out.gtmat | repr}} # pyright: ignore
10
+ config = Config.load(configfile)
11
+
12
+ default_nsnps = {{envs.nsnps | repr}} # pyright: ignore
13
+ default_ncases = {{envs.ncases | repr}} # pyright: ignore
14
+ default_nctrls = {{envs.nctrls | repr}} # pyright: ignore
15
+ default_plink = {{envs.plink | repr}} # pyright: ignore
16
+ default_seed = {{envs.seed | repr}} # pyright: ignore
17
+ default_label = {{envs.label | repr}} # pyright: ignore
18
+ default_prevalence = {{envs.prevalence | repr}} # pyright: ignore
19
+ default_minfreq = {{envs.minfreq | repr}} # pyright: ignore
20
+ default_maxfreq = {{envs.maxfreq | repr}} # pyright: ignore
21
+ default_hetodds = {{envs.hetodds | repr}} # pyright: ignore
22
+ default_homodds = {{envs.homodds | repr}} # pyright: ignore
23
+ default_missing = {{envs.missing | repr}} # pyright: ignore
24
+ default_args = {{envs.args | repr}} # pyright: ignore
25
+ default_transpose_gtmat = {{envs.transpose_gtmat | repr}} # pyright: ignore
26
+ default_sample_prefix = {{envs.sample_prefix | repr}} # pyright: ignore
27
+
28
+ defaults = {
29
+ "nsnps": default_nsnps,
30
+ "ncases": default_ncases,
31
+ "nctrls": default_nctrls,
32
+ "plink": default_plink,
33
+ "seed": default_seed,
34
+ "label": default_label,
35
+ "prevalence": default_prevalence,
36
+ "minfreq": default_minfreq,
37
+ "maxfreq": default_maxfreq,
38
+ "hetodds": default_hetodds,
39
+ "homodds": default_homodds,
40
+ "missing": default_missing,
41
+ # "args": default_args,
42
+ "transpose_gtmat": default_transpose_gtmat,
43
+ "sample_prefix": default_sample_prefix,
44
+ }
45
+
46
+ def do_one_simulation(confitems):
47
+ args = default_args.copy()
48
+ args.update(confitems.pop("args", {}))
49
+ confs = defaults.copy()
50
+ confs.update(confitems)
51
+ transpose_gtmat = confs.pop("transpose_gtmat")
52
+ sample_prefix = confs.pop("sample_prefix")
53
+
54
+
55
+ logger.debug(" Generating parameters file")
56
+ params_file = Path(outdir) / "params.txt"
57
+ params_file.write_text(
58
+ f"{confs['nsnps']}\t{confs['label']}\t{confs['minfreq']}\t"
59
+ f"{confs['maxfreq']}\t{confs['hetodds']}\t{confs['homodds']}\n"
60
+ )
61
+
62
+ if confs.get('seed') is not None:
63
+ args["seed"] = confs['seed']
64
+
65
+ args["simulate"] = params_file
66
+ args["out"] = Path(outdir) / "sim_snps"
67
+ args["simulate-ncases"] = confs['ncases']
68
+ args["simulate-ncontrols"] = confs['nctrls']
69
+ args["simulate-prevalence"] = confs['prevalence']
70
+ args["simulate-missing"] = confs['missing']
71
+
72
+ cmd = [confs['plink']] + dict_to_cli_args(args)
73
+
74
+ logger.debug(" Running PLINK simulation ...")
75
+ run_command(cmd, fg=True)
76
+
77
+ # Transpose the genotype matrix
78
+ # CHR SNP (C)M POS COUNTED ALT per0_per0 per1_per1 per2_per2
79
+ # 1 SNP_0 0 1 D d 1 0 1
80
+ # 1 SNP_1 0 2 d D 0 1 0
81
+ # 1 SNP_2 0 3 d D 0 0 0
82
+ # 1 SNP_3 0 4 d D 0 0 0
83
+ # 1 SNP_4 0 5 D d 1 2 1
84
+ cmd = [
85
+ confs['plink'],
86
+ "--recode",
87
+ "A" if transpose_gtmat else "A-transpose",
88
+ "tab",
89
+ "--bfile",
90
+ args["out"],
91
+ "--out",
92
+ gtmatfile + ".plink.recoded",
93
+ ]
94
+ logger.debug("- Recoding into genotype matrix ...")
95
+ run_command(cmd, fg=True)
96
+
97
+ logger.debug(" Saving genotype matrix ...")
98
+ ## transpose_gtmat = False
99
+ # SNP_COUNTED per0_per0 per1_per1 per2_per2
100
+ # SNP_0_D 1 0 1
101
+ # SNP_1_d 0 1 0
102
+ # SNP_2_d 0 0 0
103
+ # SNP_3_d 0 0 0
104
+ # SNP_4_D 1 2 1
105
+ ## transpose_gtmat = True
106
+ # FID_IID SNP_0_D SNP_1_D SNP_2_D
107
+ # per0_per0 0 1 1
108
+ # per1_per1 0 2 0
109
+ # per2_per2 0 0 0
110
+ # per3_per3 1 1 0
111
+ # per4_per4 0 0 0
112
+ if transpose_gtmat:
113
+ cmd = f"cut -f1,2,7- {gtmatfile}.plink.recoded.raw | sed 's/\\t/_/'"
114
+ else:
115
+ cmd = f"cut -f2,5,7- {gtmatfile}.plink.recoded.traw | sed 's/\\t/_/'"
116
+
117
+ if sample_prefix:
118
+ cmd = f"{cmd} | sed 's/per[0-9]\\+_per/{sample_prefix}/g'"
119
+
120
+ cmd = f"{cmd} > {gtmatfile}"
121
+ run_command(cmd, fg=True)
122
+
123
+
124
+ do_one_simulation(config)
@@ -42,21 +42,21 @@ diffcoex_score <- function(group) {
42
42
 
43
43
  gvals <- unique(gdata[, group, drop = TRUE])
44
44
  if (length(gvals) < 2) {
45
- log_warn(" Less than 2 groups in the input. Skipping ...")
45
+ log_debug(" Less than 2 groups in the input. Skipping ...")
46
46
  return(NULL)
47
47
  }
48
48
  rs <- lapply(gvals, function(gval) {
49
49
  samples <- rownames(gdata[gdata[[group]] == gval, , drop = FALSE])
50
50
  expr <- indata[samples, , drop = FALSE]
51
51
  if (length(samples) < 3) {
52
- log_warn(" Less than 3 samples in one of the groups. Skipping ...")
52
+ log_debug(" Less than 3 samples in one of the groups. Skipping ...")
53
53
  return(NULL)
54
54
  }
55
55
  cor.pairs(as.matrix(expr), cor.method = method)
56
56
  })
57
57
  rs[sapply(rs, is.null)] <- NULL
58
58
  if (length(rs) < 2) {
59
- log_warn(" Less than 2 groups with at least 3 samples. Skipping ...")
59
+ log_debug(" Less than 2 groups with at least 3 samples. Skipping ...")
60
60
  return(NULL)
61
61
  }
62
62
  N <- length(rs)
@@ -26,6 +26,7 @@ section <- {{ envs.section | r }}
26
26
  mutaters <- {{ envs.mutaters | r }}
27
27
  subset <- {{ envs.subset | r }}
28
28
  prefix <- {{ envs.prefix | r }}
29
+ upset_ymax <- {{ envs.upset_ymax | r }}
29
30
  upset_trans <- {{ envs.upset_trans | r }}
30
31
  cases <- {{ envs.cases | r }}
31
32
 
@@ -40,6 +41,7 @@ if (is.null(cases) || length(cases) == 0) {
40
41
  order = sample_order,
41
42
  subset = subset,
42
43
  section = section,
44
+ upset_ymax = upset_ymax,
43
45
  upset_trans = upset_trans
44
46
  )
45
47
  )
@@ -50,6 +52,7 @@ if (is.null(cases) || length(cases) == 0) {
50
52
  cases[[key]]$order <- cases[[key]]$order %||% sample_order
51
53
  cases[[key]]$section <- cases[[key]]$section %||% section
52
54
  cases[[key]]$subset <- cases[[key]]$subset %||% subset
55
+ cases[[key]]$upset_ymax <- cases[[key]]$upset_ymax %||% upset_ymax
53
56
  cases[[key]]$upset_trans <- cases[[key]]$upset_trans %||% upset_trans
54
57
  }
55
58
  }
@@ -320,7 +323,7 @@ plot_venndg <- function(counts, groups, singletons) {
320
323
  venn_p
321
324
  }
322
325
 
323
- plot_upset <- function(counts, singletons, upset_trans) {
326
+ plot_upset <- function(counts, singletons, upset_ymax, upset_trans) {
324
327
 
325
328
  cnts <- column_to_rownames(counts, "CDR3.aa") %>%
326
329
  mutate(across(everything(), ~ as.integer(as.logical(.x))))
@@ -345,12 +348,21 @@ plot_upset <- function(counts, singletons, upset_trans) {
345
348
  geom_text(
346
349
  aes(label = ..count.., vjust = ifelse(..type == "Multiplets", -0.25, +1.25)),
347
350
  stat = "count", position = "stack", size = 2.8)
351
+ if (!is.null(upset_ymax)) {
352
+ p <- p + ylim(0, upset_ymax)
353
+ }
348
354
  } else {
349
355
  p <- p + geom_bar(stat = "count", position = "dodge2") +
350
356
  geom_text(
351
357
  aes(label = ..count..),
352
- stat = "count", position = position_dodge(width = 0.9), vjust = -0.25, size = 2.5) +
353
- scale_y_continuous(trans = "log10")
358
+ stat = "count", position = position_dodge(width = 0.9), vjust = -0.25, size = 2.5)
359
+
360
+ # limit the y and do log10 transformation
361
+ if (!is.null(upset_ymax)) {
362
+ p <- p + scale_y_continuous(trans = "log10", limits = c(1, upset_ymax))
363
+ } else {
364
+ p <- p + scale_y_continuous(trans = "log10")
365
+ }
354
366
  }
355
367
 
356
368
  upset(
@@ -519,7 +531,7 @@ handle_subject <- function(i, subjects, casename, case) {
519
531
  upset_dir <- file.path(casedir, "upset")
520
532
  upset_png <- file.path(upset_dir, paste0("upset_", slugify(subject), ".png"))
521
533
  png(upset_png, res = 100, height = 600, width = 800)
522
- print(plot_upset(counts, singletons, case$upset_trans))
534
+ print(plot_upset(counts, singletons, case$upset_ymax, case$upset_trans))
523
535
  dev.off()
524
536
 
525
537
  h <- headings(case$section, casename, "Overlapping Clones (UpSet Plots)")