biopipen 0.27.1__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.1 → biopipen-0.27.2}/PKG-INFO +1 -1
  2. biopipen-0.27.2/biopipen/__init__.py +1 -0
  3. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/ns/snp.py +18 -15
  4. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/ns/tcr.py +73 -0
  5. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/scrna/RadarPlots.R +2 -2
  6. biopipen-0.27.2/biopipen/scripts/snp/PlinkSimulation.py +124 -0
  7. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/stats/DiffCoexpr.R +3 -3
  8. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/tcr/CloneResidency.R +16 -4
  9. biopipen-0.27.2/biopipen/scripts/tcr/TCRDock.py +106 -0
  10. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/utils/misc.py +5 -1
  11. {biopipen-0.27.1 → biopipen-0.27.2}/pyproject.toml +1 -1
  12. {biopipen-0.27.1 → biopipen-0.27.2}/setup.py +3 -3
  13. biopipen-0.27.1/biopipen/__init__.py +0 -1
  14. biopipen-0.27.1/biopipen/scripts/snp/PlinkSimulation.py +0 -88
  15. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/core/__init__.py +0 -0
  16. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/core/config.py +0 -0
  17. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/core/config.toml +0 -0
  18. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/core/defaults.py +0 -0
  19. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/core/filters.py +0 -0
  20. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/core/proc.py +0 -0
  21. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/core/testing.py +0 -0
  22. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/ns/__init__.py +0 -0
  23. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/ns/bam.py +0 -0
  24. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/ns/bcftools.py +0 -0
  25. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/ns/bed.py +0 -0
  26. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/ns/cellranger.py +0 -0
  27. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/ns/cellranger_pipeline.py +0 -0
  28. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/ns/cnv.py +0 -0
  29. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/ns/cnvkit.py +0 -0
  30. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/ns/cnvkit_pipeline.py +0 -0
  31. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/ns/delim.py +0 -0
  32. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/ns/gene.py +0 -0
  33. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/ns/gsea.py +0 -0
  34. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/ns/misc.py +0 -0
  35. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/ns/plot.py +0 -0
  36. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/ns/rnaseq.py +0 -0
  37. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/ns/scrna.py +0 -0
  38. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/ns/scrna_metabolic_landscape.py +0 -0
  39. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/ns/stats.py +0 -0
  40. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/ns/tcgamaf.py +0 -0
  41. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/ns/vcf.py +0 -0
  42. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/ns/web.py +0 -0
  43. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/reports/bam/CNAClinic.svelte +0 -0
  44. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/reports/bam/CNVpytor.svelte +0 -0
  45. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/reports/bam/ControlFREEC.svelte +0 -0
  46. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/reports/cellranger/CellRangerCount.svelte +0 -0
  47. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/reports/cellranger/CellRangerSummary.svelte +0 -0
  48. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/reports/cellranger/CellRangerVdj.svelte +0 -0
  49. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/reports/cnv/AneuploidyScore.svelte +0 -0
  50. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/reports/cnv/AneuploidyScoreSummary.svelte +0 -0
  51. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/reports/cnv/TMADScoreSummary.svelte +0 -0
  52. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/reports/cnvkit/CNVkitDiagram.svelte +0 -0
  53. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/reports/cnvkit/CNVkitHeatmap.svelte +0 -0
  54. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/reports/cnvkit/CNVkitScatter.svelte +0 -0
  55. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/reports/delim/SampleInfo.svelte +0 -0
  56. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/reports/gsea/FGSEA.svelte +0 -0
  57. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/reports/gsea/GSEA.svelte +0 -0
  58. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/reports/scrna/CellsDistribution.svelte +0 -0
  59. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/reports/scrna/DimPlots.svelte +0 -0
  60. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/reports/scrna/MarkersFinder.svelte +0 -0
  61. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/reports/scrna/MetaMarkers.svelte +0 -0
  62. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/reports/scrna/RadarPlots.svelte +0 -0
  63. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/reports/scrna/ScFGSEA.svelte +0 -0
  64. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/reports/scrna/SeuratClusterStats.svelte +0 -0
  65. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/reports/scrna/SeuratMap2Ref.svelte +0 -0
  66. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/reports/scrna/SeuratPreparing.svelte +0 -0
  67. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/reports/scrna/TopExpressingGenes.svelte +0 -0
  68. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/reports/scrna_metabolic_landscape/MetabolicFeatures.svelte +0 -0
  69. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/reports/scrna_metabolic_landscape/MetabolicFeaturesIntraSubset.svelte +0 -0
  70. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/reports/scrna_metabolic_landscape/MetabolicPathwayActivity.svelte +0 -0
  71. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/reports/scrna_metabolic_landscape/MetabolicPathwayHeterogeneity.svelte +0 -0
  72. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/reports/tcr/CDR3AAPhyschem.svelte +0 -0
  73. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/reports/tcr/CloneResidency.svelte +0 -0
  74. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/reports/tcr/Immunarch.svelte +0 -0
  75. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/reports/tcr/SampleDiversity.svelte +0 -0
  76. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/reports/tcr/TCRClusterStats.svelte +0 -0
  77. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/reports/tcr/TESSA.svelte +0 -0
  78. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/reports/tcr/VJUsage.svelte +0 -0
  79. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/reports/utils/gsea.liq +0 -0
  80. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/reports/utils/misc.liq +0 -0
  81. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/reports/vcf/TruvariBenchSummary.svelte +0 -0
  82. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/reports/vcf/TruvariConsistency.svelte +0 -0
  83. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/bam/BamMerge.py +0 -0
  84. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/bam/BamSplitChroms.py +0 -0
  85. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/bam/CNAClinic.R +0 -0
  86. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/bam/CNVpytor.py +0 -0
  87. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/bam/ControlFREEC.py +0 -0
  88. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/bcftools/BcftoolsAnnotate.py +0 -0
  89. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/bcftools/BcftoolsFilter.py +0 -0
  90. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/bcftools/BcftoolsSort.py +0 -0
  91. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/bed/Bed2Vcf.py +0 -0
  92. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/bed/BedConsensus.py +0 -0
  93. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/bed/BedLiftOver.sh +0 -0
  94. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/bed/BedtoolsMerge.py +0 -0
  95. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/cellranger/CellRangerCount.py +0 -0
  96. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/cellranger/CellRangerSummary.R +0 -0
  97. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/cellranger/CellRangerVdj.py +0 -0
  98. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/cnv/AneuploidyScore.R +0 -0
  99. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/cnv/AneuploidyScoreSummary.R +0 -0
  100. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/cnv/TMADScore.R +0 -0
  101. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/cnv/TMADScoreSummary.R +0 -0
  102. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/cnvkit/CNVkitAccess.py +0 -0
  103. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/cnvkit/CNVkitAutobin.py +0 -0
  104. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/cnvkit/CNVkitBatch.py +0 -0
  105. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/cnvkit/CNVkitCall.py +0 -0
  106. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/cnvkit/CNVkitCoverage.py +0 -0
  107. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/cnvkit/CNVkitDiagram.py +0 -0
  108. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/cnvkit/CNVkitFix.py +0 -0
  109. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/cnvkit/CNVkitGuessBaits.py +0 -0
  110. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/cnvkit/CNVkitHeatmap.py +0 -0
  111. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/cnvkit/CNVkitReference.py +0 -0
  112. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/cnvkit/CNVkitScatter.py +0 -0
  113. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/cnvkit/CNVkitSegment.py +0 -0
  114. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/cnvkit/guess_baits.py +0 -0
  115. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/delim/RowsBinder.R +0 -0
  116. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/delim/SampleInfo.R +0 -0
  117. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/gene/GeneNameConversion.py +0 -0
  118. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/gsea/Enrichr.R +0 -0
  119. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/gsea/FGSEA.R +0 -0
  120. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/gsea/GSEA.R +0 -0
  121. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/gsea/PreRank.R +0 -0
  122. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/misc/Config2File.py +0 -0
  123. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/misc/Str2File.py +0 -0
  124. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/plot/Heatmap.R +0 -0
  125. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/plot/VennDiagram.R +0 -0
  126. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/rnaseq/Simulation-ESCO.R +0 -0
  127. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/rnaseq/Simulation-RUVcorr.R +0 -0
  128. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/rnaseq/Simulation.R +0 -0
  129. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/rnaseq/UnitConversion.R +0 -0
  130. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/scrna/AnnData2Seurat.R +0 -0
  131. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/scrna/CellTypeAnnotation-celltypist.R +0 -0
  132. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/scrna/CellTypeAnnotation-direct.R +0 -0
  133. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/scrna/CellTypeAnnotation-hitype.R +0 -0
  134. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/scrna/CellTypeAnnotation-sccatch.R +0 -0
  135. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/scrna/CellTypeAnnotation-sctype.R +0 -0
  136. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/scrna/CellTypeAnnotation.R +0 -0
  137. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/scrna/CellsDistribution.R +0 -0
  138. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/scrna/DimPlots.R +0 -0
  139. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/scrna/ExprImpution-alra.R +0 -0
  140. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/scrna/ExprImpution-rmagic.R +0 -0
  141. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/scrna/ExprImpution-scimpute.R +0 -0
  142. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/scrna/ExprImpution.R +0 -0
  143. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/scrna/MarkersFinder.R +0 -0
  144. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/scrna/MetaMarkers.R +0 -0
  145. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/scrna/ModuleScoreCalculator.R +0 -0
  146. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/scrna/SCImpute.R +0 -0
  147. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/scrna/ScFGSEA.R +0 -0
  148. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/scrna/Seurat2AnnData.R +0 -0
  149. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/scrna/SeuratClusterStats-dimplots.R +0 -0
  150. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/scrna/SeuratClusterStats-features.R +0 -0
  151. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/scrna/SeuratClusterStats-hists.R +0 -0
  152. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/scrna/SeuratClusterStats-ngenes.R +0 -0
  153. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/scrna/SeuratClusterStats-stats.R +0 -0
  154. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/scrna/SeuratClusterStats.R +0 -0
  155. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/scrna/SeuratClustering.R +0 -0
  156. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/scrna/SeuratFilter.R +0 -0
  157. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/scrna/SeuratLoading.R +0 -0
  158. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/scrna/SeuratMap2Ref.R +0 -0
  159. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/scrna/SeuratMetadataMutater.R +0 -0
  160. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/scrna/SeuratPreparing.R +0 -0
  161. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/scrna/SeuratSplit.R +0 -0
  162. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/scrna/SeuratSubClustering.R +0 -0
  163. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/scrna/SeuratSubset.R +0 -0
  164. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/scrna/SeuratTo10X.R +0 -0
  165. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/scrna/TopExpressingGenes.R +0 -0
  166. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/scrna/Write10X.R +0 -0
  167. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/scrna/celltypist-wrapper.py +0 -0
  168. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/scrna/sctype.R +0 -0
  169. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/scrna_metabolic_landscape/MetabolicFeatures.R +0 -0
  170. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/scrna_metabolic_landscape/MetabolicFeaturesIntraSubset.R +0 -0
  171. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/scrna_metabolic_landscape/MetabolicPathwayActivity.R +0 -0
  172. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/scrna_metabolic_landscape/MetabolicPathwayHeterogeneity.R +0 -0
  173. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/stats/ChowTest.R +0 -0
  174. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/stats/LiquidAssoc.R +0 -0
  175. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/stats/MetaPvalue.R +0 -0
  176. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/tcgamaf/Maf2Vcf.py +0 -0
  177. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/tcgamaf/MafAddChr.py +0 -0
  178. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/tcgamaf/maf2vcf.pl +0 -0
  179. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/tcr/Attach2Seurat.R +0 -0
  180. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/tcr/CDR3AAPhyschem.R +0 -0
  181. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/tcr/CloneSizeQQPlot.R +0 -0
  182. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/tcr/GIANA/GIANA.py +0 -0
  183. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/tcr/GIANA/GIANA4.py +0 -0
  184. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/tcr/GIANA/Imgt_Human_TRBV.fasta +0 -0
  185. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/tcr/GIANA/query.py +0 -0
  186. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/tcr/Immunarch-basic.R +0 -0
  187. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/tcr/Immunarch-clonality.R +0 -0
  188. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/tcr/Immunarch-diversity.R +0 -0
  189. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/tcr/Immunarch-geneusage.R +0 -0
  190. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/tcr/Immunarch-kmer.R +0 -0
  191. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/tcr/Immunarch-overlap.R +0 -0
  192. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/tcr/Immunarch-spectratyping.R +0 -0
  193. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/tcr/Immunarch-tracking.R +0 -0
  194. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/tcr/Immunarch-vjjunc.R +0 -0
  195. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/tcr/Immunarch.R +0 -0
  196. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/tcr/Immunarch2VDJtools.R +0 -0
  197. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/tcr/ImmunarchFilter.R +0 -0
  198. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/tcr/ImmunarchLoading.R +0 -0
  199. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/tcr/ImmunarchSplitIdents.R +0 -0
  200. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/tcr/SampleDiversity.R +0 -0
  201. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/tcr/TCRClusterStats.R +0 -0
  202. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/tcr/TCRClustering.R +0 -0
  203. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/tcr/TESSA.R +0 -0
  204. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/tcr/TESSA_source/Atchley_factors.csv +0 -0
  205. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/tcr/TESSA_source/BriseisEncoder.py +0 -0
  206. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/tcr/TESSA_source/MCMC_control.R +0 -0
  207. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/tcr/TESSA_source/TrainedEncoder.h5 +0 -0
  208. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/tcr/TESSA_source/fixed_b.csv +0 -0
  209. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/tcr/TESSA_source/initialization.R +0 -0
  210. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/tcr/TESSA_source/post_analysis.R +0 -0
  211. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/tcr/TESSA_source/real_data.R +0 -0
  212. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/tcr/TESSA_source/update.R +0 -0
  213. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/tcr/TESSA_source/utility.R +0 -0
  214. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/tcr/VJUsage.R +0 -0
  215. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/tcr/immunarch-patched.R +0 -0
  216. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/tcr/vdjtools-patch.sh +0 -0
  217. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/vcf/TruvariBench.sh +0 -0
  218. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/vcf/TruvariBenchSummary.R +0 -0
  219. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/vcf/TruvariConsistency.R +0 -0
  220. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/vcf/Vcf2Bed.py +0 -0
  221. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/vcf/VcfAnno.py +0 -0
  222. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/vcf/VcfDownSample.sh +0 -0
  223. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/vcf/VcfFilter.py +0 -0
  224. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/vcf/VcfFix.py +0 -0
  225. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/vcf/VcfFix_utils.py +0 -0
  226. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/vcf/VcfIndex.py +0 -0
  227. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/vcf/VcfIntersect.py +0 -0
  228. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/vcf/VcfLiftOver.sh +0 -0
  229. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/vcf/VcfSplitSamples.py +0 -0
  230. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/web/Download.py +0 -0
  231. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/scripts/web/DownloadList.py +0 -0
  232. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/utils/__init__.py +0 -0
  233. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/utils/caching.R +0 -0
  234. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/utils/common_docstrs.py +0 -0
  235. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/utils/gene.R +0 -0
  236. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/utils/gene.py +0 -0
  237. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/utils/gsea.R +0 -0
  238. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/utils/io.R +0 -0
  239. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/utils/misc.R +0 -0
  240. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/utils/mutate_helpers.R +0 -0
  241. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/utils/plot.R +0 -0
  242. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/utils/reference.py +0 -0
  243. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/utils/rnaseq.R +0 -0
  244. {biopipen-0.27.1 → biopipen-0.27.2}/biopipen/utils/single_cell.R +0 -0
  245. {biopipen-0.27.1 → 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.1
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"
@@ -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) {
@@ -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)")
@@ -0,0 +1,106 @@
1
+ import os
2
+ import sys
3
+ from pathlib import Path
4
+
5
+ import rtoml
6
+ import pandas as pd
7
+ from tempfile import gettempdir
8
+ from biopipen.utils.misc import logger, run_command
9
+
10
+ configfile = {{in.configfile | repr}} # pyright: ignore
11
+ outdir = Path({{out.outdir | repr}}) # pyright: ignore
12
+ envs = {{envs | dict | repr}} # pyright: ignore
13
+ python = sys.executable
14
+
15
+ args = envs.copy()
16
+ config = rtoml.load(Path(configfile))
17
+ args.update(config)
18
+ model_name = args.pop("model_name")
19
+ model_file = Path(args.pop("model_file"))
20
+ data_dir = args.pop("data_dir", None)
21
+ tcrdock = args.pop("tcrdock", None)
22
+ tmpdir = args.pop("tmpdir", gettempdir())
23
+ python = args.pop("python", python)
24
+
25
+ if not isinstance(python, (list, tuple)):
26
+ python = [python]
27
+
28
+ if not data_dir:
29
+ raise ValueError("`envs.data_dir` is required")
30
+
31
+ if not tcrdock:
32
+ logger.info("- `envs.tcrdock` is not provided, cloning the repository ... ")
33
+ repo_url = "https://github.com/phbradley/TCRdock"
34
+ commit_id = "c5a7af42eeb0c2a4492a4d4fe803f1f9aafb6193"
35
+ branch = "main"
36
+
37
+ from git import Repo
38
+ repo = Repo.clone_from(repo_url, tmpdir, branch=branch, no_checkout=True)
39
+ repo.git.checkout(commit_id)
40
+ tcrdock = Path(tmpdir) / "TCRdock"
41
+
42
+ logger.info("- Running download_blast.py ...")
43
+ cmd = [
44
+ *python,
45
+ tcrdock / "download_blast.py",
46
+ ]
47
+ run_command(cmd, fg=True, cwd=str(tcrdock))
48
+
49
+ if not model_file.is_absolute():
50
+ model_file = Path(data_dir) / "params" / model_file
51
+
52
+ os.environ['TF_FORCE_UNIFIED_MEMORY'] = '1'
53
+ os.environ['XLA_PYTHON_CLIENT_MEM_FRACTION'] = '4.0'
54
+
55
+ logger.info("- Composing targets file ... ")
56
+ targets_file = outdir / "user_targets.tsv"
57
+ targets = pd.DataFrame(
58
+ [
59
+ dict(
60
+ organism=args['organism'],
61
+ mhc_class=args['mhc_class'],
62
+ mhc=args['mhc'],
63
+ peptide=args['peptide'],
64
+ va=args['va'],
65
+ ja=args['ja'],
66
+ cdr3a=args['cdr3a'],
67
+ vb=args['vb'],
68
+ jb=args['jb'],
69
+ cdr3b=args['cdr3b'],
70
+ )
71
+ ]
72
+ )
73
+ targets.to_csv(targets_file, sep="\t", index=False)
74
+
75
+ logger.info("- Generating inputs for AlphaFold modeling ... ")
76
+ cmd = [
77
+ *python,
78
+ tcrdock + "/setup_for_alphafold.py",
79
+ "--targets_tsvfile", targets_file,
80
+ "--output_dir", outdir / "user_output",
81
+ "--new_docking",
82
+ ]
83
+ run_command(cmd, fg=True)
84
+
85
+ logger.info("- Running AlphaFold modeling ... ")
86
+ cmd = [
87
+ *python,
88
+ tcrdock + "/run_prediction.py",
89
+ "--verbose",
90
+ "--targets", outdir / "user_output/targets.tsv",
91
+ "--outfile_prefix", f"{outdir}/{args['peptide']}",
92
+ "--model_names", model_name,
93
+ "--data_dir", data_dir,
94
+ "--model_params_files", model_file,
95
+ ]
96
+ run_command(cmd, fg=True, env={"XLA_FLAGS": "--xla_gpu_force_compilation_parallelism=1"})
97
+
98
+ logger.info("- Calculating the PAE ... ")
99
+ cmd = [
100
+ *python,
101
+ tcrdock + "/add_pmhc_tcr_pae_to_tsvfile.py",
102
+ "--infile", f"{outdir}/{args['peptide']}_final.tsv",
103
+ "--outfile", f"{outdir}/{args['peptide']}_w_pae.tsv",
104
+ ]
105
+
106
+ run_command(cmd, fg=True)
@@ -1,13 +1,14 @@
1
1
  from __future__ import annotations
2
2
  from pathlib import Path
3
3
 
4
+ import os
4
5
  import sys
5
6
  import logging
6
7
  from typing import List
7
8
  from biopipen.core.filters import dict_to_cli_args # noqa: F401
8
9
 
9
10
  logger = logging.getLogger("biopipen_job")
10
- logger.setLevel(logging.INFO)
11
+ logger.setLevel(logging.DEBUG)
11
12
  _handler = logging.StreamHandler(sys.stdout)
12
13
  # Use same log format as in R
13
14
  # {sprintf("%-7s", level)} [{format(time, "%Y-%m-%d %H:%M:%S")}] {msg}
@@ -100,6 +101,9 @@ def run_command(
100
101
  kwargs["stderr"] = sys.stderr
101
102
  kwargs["universal_newlines"] = True
102
103
 
104
+ if "env" in kwargs:
105
+ kwargs["env"] = {**os.environ, **kwargs["env"]}
106
+
103
107
  try:
104
108
  p = Popen(cmd, **kwargs)
105
109
  except Exception as e:
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "biopipen"
3
- version = "0.27.1"
3
+ version = "0.27.2"
4
4
  description = "Bioinformatics processes/pipelines that can be run from `pipen run`"
5
5
  authors = ["pwwang <pwwang@pwwang.com>"]
6
6
  license = "MIT"
@@ -15,6 +15,7 @@ packages = \
15
15
  'biopipen.scripts.scrna',
16
16
  'biopipen.scripts.snp',
17
17
  'biopipen.scripts.tcgamaf',
18
+ 'biopipen.scripts.tcr',
18
19
  'biopipen.scripts.tcr.GIANA',
19
20
  'biopipen.scripts.tcr.TESSA_source',
20
21
  'biopipen.scripts.vcf',
@@ -40,8 +41,7 @@ package_data = \
40
41
  'scripts/plot/*',
41
42
  'scripts/rnaseq/*',
42
43
  'scripts/scrna_metabolic_landscape/*',
43
- 'scripts/stats/*',
44
- 'scripts/tcr/*']}
44
+ 'scripts/stats/*']}
45
45
 
46
46
  install_requires = \
47
47
  ['datar[pandas]>=0.15.6,<0.16.0',
@@ -81,7 +81,7 @@ entry_points = \
81
81
 
82
82
  setup_kwargs = {
83
83
  'name': 'biopipen',
84
- 'version': '0.27.1',
84
+ 'version': '0.27.2',
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.1"
@@ -1,88 +0,0 @@
1
- from pathlib import Path
2
- from biopipen.utils.misc import logger, run_command, dict_to_cli_args
3
-
4
- nsnps = {{in.nsnps | repr}} # pyright: ignore
5
- ncases = {{in.ncases | repr}} # pyright: ignore
6
- nctrls = {{in.nctrls | repr}} # pyright: ignore
7
- outdir = {{out.outdir | repr}} # pyright: ignore
8
- gtmatfile = {{out.gtmat | repr}} # pyright: ignore
9
- plink = {{envs.plink | repr}} # pyright: ignore
10
- seed = {{envs.seed | repr}} # pyright: ignore
11
- label = {{envs.label | repr}} # pyright: ignore
12
- prevalence = {{envs.prevalence | repr}} # pyright: ignore
13
- minfreq = {{envs.minfreq | repr}} # pyright: ignore
14
- maxfreq = {{envs.maxfreq | repr}} # pyright: ignore
15
- hetodds = {{envs.hetodds | repr}} # pyright: ignore
16
- homodds = {{envs.homodds | repr}} # pyright: ignore
17
- missing = {{envs.missing | repr}} # pyright: ignore
18
- args = {{envs.args | repr}} # pyright: ignore
19
- transpose_gtmat = {{envs.transpose_gtmat | repr}} # pyright: ignore
20
- sample_prefix = {{envs.sample_prefix | repr}} # pyright: ignore
21
-
22
- logger.info("Generating parameters file")
23
- params_file = Path(outdir) / "params.txt"
24
- params_file.write_text(
25
- f"{nsnps}\t{label}\t{minfreq}\t{maxfreq}\t{hetodds}\t{homodds}\n"
26
- )
27
-
28
- if seed is not None:
29
- args["seed"] = seed
30
-
31
- args["simulate"] = params_file
32
- args["out"] = Path(outdir) / "sim_snps"
33
- args["simulate-ncases"] = ncases
34
- args["simulate-ncontrols"] = nctrls
35
- args["simulate-prevalence"] = prevalence
36
- args["simulate-missing"] = missing
37
-
38
- cmd = [plink] + dict_to_cli_args(args)
39
-
40
- logger.info("Running PLINK simulation ...")
41
- run_command(cmd, fg=True)
42
-
43
- # Transpose the genotype matrix
44
- # CHR SNP (C)M POS COUNTED ALT per0_per0 per1_per1 per2_per2
45
- # 1 SNP_0 0 1 D d 1 0 1
46
- # 1 SNP_1 0 2 d D 0 1 0
47
- # 1 SNP_2 0 3 d D 0 0 0
48
- # 1 SNP_3 0 4 d D 0 0 0
49
- # 1 SNP_4 0 5 D d 1 2 1
50
- cmd = [
51
- plink,
52
- "--recode",
53
- "A" if transpose_gtmat else "A-transpose",
54
- "tab",
55
- "--bfile",
56
- args["out"],
57
- "--out",
58
- gtmatfile + ".plink.recoded",
59
- ]
60
- logger.info("Recoding into genotype matrix ...")
61
- run_command(cmd, fg=True)
62
-
63
- logger.info("Saving genotype matrix ...")
64
- ## transpose_gtmat = False
65
- # SNP_COUNTED per0_per0 per1_per1 per2_per2
66
- # SNP_0_D 1 0 1
67
- # SNP_1_d 0 1 0
68
- # SNP_2_d 0 0 0
69
- # SNP_3_d 0 0 0
70
- # SNP_4_D 1 2 1
71
- ## transpose_gtmat = True
72
- # FID_IID SNP_0_D SNP_1_D SNP_2_D
73
- # per0_per0 0 1 1
74
- # per1_per1 0 2 0
75
- # per2_per2 0 0 0
76
- # per3_per3 1 1 0
77
- # per4_per4 0 0 0
78
- if transpose_gtmat:
79
- cmd = f"cut -f1,2,7- {gtmatfile}.plink.recoded.raw | sed 's/\\t/_/'"
80
- else:
81
- cmd = f"cut -f2,5,7- {gtmatfile}.plink.recoded.traw | sed 's/\\t/_/'"
82
-
83
- if sample_prefix:
84
- cmd = f"{cmd} | sed 's/per[0-9]\\+_per/{sample_prefix}/g'"
85
-
86
- cmd = f"{cmd} > {gtmatfile}"
87
-
88
- run_command(cmd, fg=True)
File without changes